From 6dd6fcf88f621d787c6524d81844b1d514434859 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
<67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 14 Jul 2024 14:49:50 +0900
Subject: [PATCH 01/14] =?UTF-8?q?enhance(frontend):=20=E3=82=B5=E3=83=BC?=
=?UTF-8?q?=E3=83=90=E3=83=BC=E6=83=85=E5=A0=B1=E3=83=BB=E3=81=8A=E5=95=8F?=
=?UTF-8?q?=E3=81=84=E5=90=88=E3=82=8F=E3=81=9B=E3=83=9A=E3=83=BC=E3=82=B8?=
=?UTF-8?q?=E3=82=92=E6=94=B9=E4=BF=AE=20(#14198)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* improve(frontend): サーバー情報・お問い合わせページを改修 (#238)
* Revert "Revert "enhance(frontend): add contact page" (#208)" (This reverts commit 5a329a09c987b3249f97f9d53af67d1bffb09eea.)
* improve(frontend): サーバー情報・お問い合わせページを改修
(cherry picked from commit e72758d8cda3db009c5d1bf1f4141682931b91f8)
* fix
* Update Changelog
* tweak
* lint
* 既存の翻訳を使用するように
---------
Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com>
---
CHANGELOG.md | 2 +
packages/frontend/src/components/MkMenu.vue | 1 +
.../src/components/MkVisitorDashboard.vue | 11 +-
.../frontend/src/pages/about.overview.vue | 205 ++++++++++++++++++
packages/frontend/src/pages/about.vue | 201 +----------------
packages/frontend/src/pages/contact.vue | 26 ++-
packages/frontend/src/ui/_common_/common.ts | 24 +-
7 files changed, 250 insertions(+), 220 deletions(-)
create mode 100644 packages/frontend/src/pages/about.overview.vue
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bcc2aa29c6..6e411e5329 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,8 @@
- Enhance: 非ログイン時のハイライトTLのデザインを改善
- Enhance: フロントエンドのアクセシビリティ改善
(Based on https://github.com/taiyme/misskey/pull/226)
+- Enhance: サーバー情報ページ・お問い合わせページを改善
+ (Cherry-picked from https://github.com/taiyme/misskey/pull/238)
- Fix: `/about#federation` ページなどで各インスタンスのチャートが表示されなくなっていた問題を修正
- Fix: ユーザーページの追加情報のラベルを投稿者のサーバーの絵文字で表示する (#13968)
- Fix: リバーシの対局を正しく共有できないことがある問題を修正
diff --git a/packages/frontend/src/components/MkMenu.vue b/packages/frontend/src/components/MkMenu.vue
index 68479989b2..2276da1d21 100644
--- a/packages/frontend/src/components/MkMenu.vue
+++ b/packages/frontend/src/components/MkMenu.vue
@@ -54,6 +54,7 @@ SPDX-License-Identifier: AGPL-3.0-only
:class="['_button', $style.item]"
:href="item.href"
:target="item.target"
+ :rel="item.target === '_blank' ? 'noopener noreferrer' : undefined"
:download="item.download"
@click.passive="close(true)"
@mouseenter.passive="onItemMouseEnter"
diff --git a/packages/frontend/src/components/MkVisitorDashboard.vue b/packages/frontend/src/components/MkVisitorDashboard.vue
index 4d81bd0283..445780eca7 100644
--- a/packages/frontend/src/components/MkVisitorDashboard.vue
+++ b/packages/frontend/src/components/MkVisitorDashboard.vue
@@ -23,7 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.joinThisServer }}
- {{ i18n.ts.exploreOtherServers }}
+ {{ i18n.ts.exploreOtherServers }}
{{ i18n.ts.login }}
@@ -65,7 +65,8 @@ import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js';
import MkNumber from '@/components/MkNumber.vue';
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
-import { openInstanceMenu } from '@/ui/_common_/common';
+import { openInstanceMenu } from '@/ui/_common_/common.js';
+import type { MenuItem } from '@/types/menu.js';
const stats = ref(null);
@@ -89,13 +90,9 @@ function signup() {
});
}
-function showMenu(ev) {
+function showMenu(ev: MouseEvent) {
openInstanceMenu(ev);
}
-
-function exploreOtherServers() {
- window.open('https://misskey-hub.net/servers/', '_blank', 'noopener');
-}
diff --git a/packages/frontend/src/pages/about.vue b/packages/frontend/src/pages/about.vue
index 324d1c11de..8dfeb6d2a7 100644
--- a/packages/frontend/src/pages/about.vue
+++ b/packages/frontend/src/pages/about.vue
@@ -8,113 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
-
-
![]()
-
- {{ instance.name ?? host }}
-
-
-
-
-
- {{ i18n.ts.description }}
-
-
-
-
-
-
- Misskey
- {{ version }}
-
-
-
-
-
- {{ i18n.ts.aboutMisskey }}
-
-
-
- {{ i18n.ts.sourceCode }}
-
-
- {{ i18n.ts.sourceCodeIsNotYetProvided }}
-
-
-
-
-
-
-
-
- {{ i18n.ts.administrator }}
- {{ instance.maintainerName }}
-
-
- {{ i18n.ts.contact }}
- {{ instance.maintainerEmail }}
-
-
-
-
- {{ i18n.ts.impressum }}
-
-
-
-
-
- {{ i18n.ts.serverRules }}
-
-
-
-
-
-
-
-
- {{ i18n.ts.termsOfService }}
-
-
-
- {{ i18n.ts.privacyPolicy }}
-
-
-
- {{ i18n.ts.feedback }}
-
-
-
-
-
-
-
- {{ i18n.ts.statistics }}
-
-
- {{ i18n.ts.users }}
- {{ number(stats.originalUsersCount) }}
-
-
- {{ i18n.ts.notes }}
- {{ number(stats.originalNotesCount) }}
-
-
-
-
-
-
- Well-known resources
-
- host-meta
- host-meta.json
- nodeinfo
- robots.txt
- manifest.json
-
-
-
+
@@ -130,26 +24,16 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
diff --git a/packages/frontend/src/pages/contact.vue b/packages/frontend/src/pages/contact.vue
index bcdcf43275..1f2bee5a77 100644
--- a/packages/frontend/src/pages/contact.vue
+++ b/packages/frontend/src/pages/contact.vue
@@ -7,18 +7,26 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
- {{ i18n.ts.inquiry }}
+
+
+ {{ i18n.ts.administrator }}
- {{ instance.inquiryUrl }}
+ {{ instance.maintainerName }}
+ ({{ i18n.ts.none }})
-
-
- {{ i18n.ts.email }}
+
+ {{ i18n.ts.contact }}
- {{ instance.maintainerEmail }}
+ {{ instance.maintainerEmail }}
+ ({{ i18n.ts.none }})
+
+
+
+ {{ i18n.ts.inquiry }}
+
+ {{ instance.inquiryUrl }}
+ ({{ i18n.ts.none }})
@@ -28,8 +36,8 @@ SPDX-License-Identifier: AGPL-3.0-only
diff --git a/packages/frontend/src/components/MkSigninDialog.vue b/packages/frontend/src/components/MkSigninDialog.vue
index 33355bb99e..524c62b4d3 100644
--- a/packages/frontend/src/components/MkSigninDialog.vue
+++ b/packages/frontend/src/components/MkSigninDialog.vue
@@ -6,21 +6,22 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.login }}
-
+
diff --git a/packages/frontend/src/pages/lookup.vue b/packages/frontend/src/pages/lookup.vue
new file mode 100644
index 0000000000..3233953942
--- /dev/null
+++ b/packages/frontend/src/pages/lookup.vue
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+ {{ i18n.ts.close }}
+ {{ i18n.ts.goToMisskey }}
+
+
+
+
+
+
+
+
+
diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue
index 834d799072..d67990e9a2 100644
--- a/packages/frontend/src/pages/user/home.vue
+++ b/packages/frontend/src/pages/user/home.vue
@@ -32,9 +32,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.followsYou }}
-
diff --git a/packages/frontend/src/router/definition.ts b/packages/frontend/src/router/definition.ts
index 12ab633af1..f7a219c57e 100644
--- a/packages/frontend/src/router/definition.ts
+++ b/packages/frontend/src/router/definition.ts
@@ -237,8 +237,18 @@ const routes: RouteDef[] = [{
origin: 'origin',
},
}, {
+ // Legacy Compatibility
path: '/authorize-follow',
- component: page(() => import('@/pages/follow.vue')),
+ redirect: '/lookup',
+ loginRequired: true,
+}, {
+ // Mastodon Compatibility
+ path: '/authorize_interaction',
+ redirect: '/lookup',
+ loginRequired: true,
+}, {
+ path: '/lookup',
+ component: page(() => import('@/pages/lookup.vue')),
loginRequired: true,
}, {
path: '/share',
diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts
index ac8774fad0..2d1fea8ea4 100644
--- a/packages/frontend/src/scripts/get-user-menu.ts
+++ b/packages/frontend/src/scripts/get-user-menu.ts
@@ -186,7 +186,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${toUnicode(user.host)}`;
copyToClipboard(`${url}/${canonical}`);
},
- }, {
+ }, ...($i ? [{
icon: 'ti ti-mail',
text: i18n.ts.sendMessage,
action: () => {
@@ -259,7 +259,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
},
}));
},
- }] as any;
+ }] : [])] as any;
if ($i && meId !== user.id) {
if (iAmModerator) {
diff --git a/packages/frontend/src/scripts/please-login.ts b/packages/frontend/src/scripts/please-login.ts
index 363da5f633..b04062a58a 100644
--- a/packages/frontend/src/scripts/please-login.ts
+++ b/packages/frontend/src/scripts/please-login.ts
@@ -8,12 +8,24 @@ import { $i } from '@/account.js';
import { i18n } from '@/i18n.js';
import { popup } from '@/os.js';
-export function pleaseLogin(path?: string) {
+export type OpenOnRemoteOptions = {
+ type: 'web';
+ path: string;
+} | {
+ type: 'lookup';
+ path: string;
+} | {
+ type: 'share';
+ params: Record;
+};
+
+export function pleaseLogin(path?: string, openOnRemote?: OpenOnRemoteOptions) {
if ($i) return;
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
autoSet: true,
- message: i18n.ts.signinRequired,
+ message: openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired,
+ openOnRemote,
}, {
cancelled: () => {
if (path) {
diff --git a/packages/frontend/src/scripts/url.ts b/packages/frontend/src/scripts/url.ts
index e3072b3b7d..c477fb5506 100644
--- a/packages/frontend/src/scripts/url.ts
+++ b/packages/frontend/src/scripts/url.ts
@@ -21,3 +21,8 @@ export function query(obj: Record): string {
export function appendQuery(url: string, query: string): string {
return `${url}${/\?/.test(url) ? url.endsWith('?') ? '' : '&' : '?'}${query}`;
}
+
+export function extractDomain(url: string) {
+ const match = url.match(/^(https)?:?\/{0,2}([^\/]+)/);
+ return match ? match[2] : null;
+}
From 76181385d2a8397c7df68c93f6ce9e5c293fc6b3 Mon Sep 17 00:00:00 2001
From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com>
Date: Sun, 14 Jul 2024 15:52:43 +0900
Subject: [PATCH 03/14] refactor(misskey-js): enable exactOptionalPropertyTypes
(#14203)
* refactor(misskey-js): enable exactOptionalPropertyTypes
* refactor(misskey-js): fix error where is appeared by enabling
---
packages/misskey-js/src/streaming.ts | 4 +++-
packages/misskey-js/tsconfig.json | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/packages/misskey-js/src/streaming.ts b/packages/misskey-js/src/streaming.ts
index 0f26857782..83930e621c 100644
--- a/packages/misskey-js/src/streaming.ts
+++ b/packages/misskey-js/src/streaming.ts
@@ -291,7 +291,9 @@ export abstract class Connection = any> extends
this.stream = stream;
this.channel = channel;
- this.name = name;
+ if (name !== undefined) {
+ this.name = name;
+ }
}
public send(type: T, body: Channel['receives'][T]): void {
diff --git a/packages/misskey-js/tsconfig.json b/packages/misskey-js/tsconfig.json
index 6e34e332e0..f7bbc47304 100644
--- a/packages/misskey-js/tsconfig.json
+++ b/packages/misskey-js/tsconfig.json
@@ -15,6 +15,7 @@
"experimentalDecorators": true,
"noImplicitReturns": true,
"esModuleInterop": true,
+ "exactOptionalPropertyTypes": true,
"typeRoots": [
"./node_modules/@types"
],
From b9f3fccfac6818c1c25ce06c0d63f7d61ce6cbbb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
<67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 14 Jul 2024 16:21:59 +0900
Subject: [PATCH 04/14] =?UTF-8?q?fix(frontend):=20Nested=20Route=E3=81=AE?=
=?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=ABRouterView=E3=81=AB=E5=BD=93?=
=?UTF-8?q?=E3=81=9F=E3=82=8B=E3=82=AD=E3=83=BC=E3=81=8C=E3=83=AB=E3=83=BC?=
=?UTF-8?q?=E3=83=88=E3=81=AEpath=E3=81=A8=E3=81=B6=E3=81=A1=E5=BD=93?=
=?UTF-8?q?=E3=81=9F=E3=82=8B=E5=8F=AF=E8=83=BD=E6=80=A7=E3=81=8C=E3=81=82?=
=?UTF-8?q?=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#14202)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
---
packages/frontend/src/components/global/RouterView.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/frontend/src/components/global/RouterView.vue b/packages/frontend/src/components/global/RouterView.vue
index 06cb30eff1..02a2edee3f 100644
--- a/packages/frontend/src/components/global/RouterView.vue
+++ b/packages/frontend/src/components/global/RouterView.vue
@@ -60,7 +60,7 @@ function onChange({ resolved, key: newKey }) {
if (current == null || 'redirect' in current.route) return;
currentPageComponent.value = current.route.component;
currentPageProps.value = current.props;
- key.value = current.route.path + JSON.stringify(Object.fromEntries(current.props));
+ key.value = newKey + JSON.stringify(Object.fromEntries(current.props));
nextTick(() => {
// ページ遷移完了後に再びキャッシュを有効化
From 09d30fef5b274c988e98e52f474afe11ff843111 Mon Sep 17 00:00:00 2001
From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com>
Date: Sun, 14 Jul 2024 17:27:27 +0900
Subject: [PATCH 05/14] =?UTF-8?q?ci:=20=E3=83=AF=E3=83=BC=E3=82=AF?=
=?UTF-8?q?=E3=83=95=E3=83=AD=E3=83=BC=E3=81=8C=E6=9B=B4=E6=96=B0=E3=81=95?=
=?UTF-8?q?=E3=82=8C=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AB=E3=82=82=E3=83=AF?=
=?UTF-8?q?=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=81=8C=E8=B5=B7?=
=?UTF-8?q?=E5=8B=95=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?=
=?UTF-8?q?=E3=82=8B=20(#14207)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* ci: include themselves in `on.push.paths`
command: find .github/workflows -type f \( -name '*.yaml' -or -name '*.yml' \) | xargs -I {} yq_4.44.2-linux_x86-64 'select(.on.push.paths != null) | .[0] | map("{}")[0]' {} | xargs -I {} ~/.local/bin/yq_4.44.2-linux_x86-64 -i '.on.push.paths += ["{}"]' {}
* ci: include themselves in `on.pull_request.paths`
command: find .github/workflows -type f \( -name '*.yaml' -or -name '*.yml' \) | xargs -I {} yq_4.44.2-linux_x86-64 'select(.on.pull_request.paths != null) | .[0] | map("{}")[0]' {} | xargs -I {} ~/.local/bin/yq_4.44.2-linux_x86-64 -i '.on.pull_request.paths += ["{}"]' {}
---
.github/workflows/api-misskey-js.yml | 3 ++-
.github/workflows/check-misskey-js-version.yml | 3 ++-
.github/workflows/get-api-diff.yml | 2 +-
.github/workflows/lint.yml | 3 ++-
.github/workflows/locale.yml | 3 ++-
.github/workflows/release-edit-with-push.yml | 2 +-
.github/workflows/test-backend.yml | 3 ++-
.github/workflows/test-frontend.yml | 4 ++--
.github/workflows/test-misskey-js.yml | 3 ++-
.github/workflows/validate-api-json.yml | 3 ++-
10 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml
index 1b7b68b14f..f9385239b0 100644
--- a/.github/workflows/api-misskey-js.yml
+++ b/.github/workflows/api-misskey-js.yml
@@ -4,10 +4,11 @@ on:
push:
paths:
- packages/misskey-js/**
+ - .github/workflows/api-misskey-js.yml
pull_request:
paths:
- packages/misskey-js/**
-
+ - .github/workflows/api-misskey-js.yml
jobs:
report:
diff --git a/.github/workflows/check-misskey-js-version.yml b/.github/workflows/check-misskey-js-version.yml
index 325a893605..99c29ac974 100644
--- a/.github/workflows/check-misskey-js-version.yml
+++ b/.github/workflows/check-misskey-js-version.yml
@@ -6,12 +6,13 @@ on:
paths:
- packages/misskey-js/package.json
- package.json
+ - .github/workflows/check-misskey-js-version.yml
pull_request:
branches: [ develop ]
paths:
- packages/misskey-js/package.json
- package.json
-
+ - .github/workflows/check-misskey-js-version.yml
jobs:
check-version:
# ルートの package.json と packages/misskey-js/package.json のバージョンが一致しているかを確認する
diff --git a/.github/workflows/get-api-diff.yml b/.github/workflows/get-api-diff.yml
index 9b9c8f11c4..33fa2ccc39 100644
--- a/.github/workflows/get-api-diff.yml
+++ b/.github/workflows/get-api-diff.yml
@@ -9,7 +9,7 @@ on:
paths:
- packages/backend/**
- .github/workflows/get-api-diff.yml
-
+ - .github/workflows/get-api-diff.yml
jobs:
get-from-misskey:
runs-on: ubuntu-latest
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 1a1b30168a..cd8ae0b45b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -11,6 +11,7 @@ on:
- packages/sw/**
- packages/misskey-js/**
- packages/shared/eslint.config.js
+ - .github/workflows/lint.yml
pull_request:
paths:
- packages/backend/**
@@ -18,7 +19,7 @@ on:
- packages/sw/**
- packages/misskey-js/**
- packages/shared/eslint.config.js
-
+ - .github/workflows/lint.yml
jobs:
pnpm_install:
runs-on: ubuntu-latest
diff --git a/.github/workflows/locale.yml b/.github/workflows/locale.yml
index de2247e772..be3764f3e4 100644
--- a/.github/workflows/locale.yml
+++ b/.github/workflows/locale.yml
@@ -4,10 +4,11 @@ on:
push:
paths:
- locales/**
+ - .github/workflows/locale.yml
pull_request:
paths:
- locales/**
-
+ - .github/workflows/locale.yml
jobs:
locale_verify:
runs-on: ubuntu-latest
diff --git a/.github/workflows/release-edit-with-push.yml b/.github/workflows/release-edit-with-push.yml
index 57657a4ba7..f86c1948f8 100644
--- a/.github/workflows/release-edit-with-push.yml
+++ b/.github/workflows/release-edit-with-push.yml
@@ -6,7 +6,7 @@ on:
- develop
paths:
- 'CHANGELOG.md'
-
+ # - .github/workflows/release-edit-with-push.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml
index b1c54bb3e7..99ca09a8ec 100644
--- a/.github/workflows/test-backend.yml
+++ b/.github/workflows/test-backend.yml
@@ -9,12 +9,13 @@ on:
- packages/backend/**
# for permissions
- packages/misskey-js/**
+ - .github/workflows/test-backend.yml
pull_request:
paths:
- packages/backend/**
# for permissions
- packages/misskey-js/**
-
+ - .github/workflows/test-backend.yml
jobs:
unit:
runs-on: ubuntu-latest
diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml
index 9d5053b82a..5acf85cb0e 100644
--- a/.github/workflows/test-frontend.yml
+++ b/.github/workflows/test-frontend.yml
@@ -11,7 +11,7 @@ on:
- packages/misskey-js/**
# for e2e
- packages/backend/**
-
+ - .github/workflows/test-frontend.yml
pull_request:
paths:
- packages/frontend/**
@@ -19,7 +19,7 @@ on:
- packages/misskey-js/**
# for e2e
- packages/backend/**
-
+ - .github/workflows/test-frontend.yml
jobs:
vitest:
runs-on: ubuntu-latest
diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml
index 2589d908b8..43f5b5b860 100644
--- a/.github/workflows/test-misskey-js.yml
+++ b/.github/workflows/test-misskey-js.yml
@@ -8,11 +8,12 @@ on:
branches: [ develop ]
paths:
- packages/misskey-js/**
+ - .github/workflows/test-misskey-js.yml
pull_request:
branches: [ develop ]
paths:
- packages/misskey-js/**
-
+ - .github/workflows/test-misskey-js.yml
jobs:
test:
diff --git a/.github/workflows/validate-api-json.yml b/.github/workflows/validate-api-json.yml
index 24340e7d81..b931e64790 100644
--- a/.github/workflows/validate-api-json.yml
+++ b/.github/workflows/validate-api-json.yml
@@ -7,10 +7,11 @@ on:
- develop
paths:
- packages/backend/**
+ - .github/workflows/validate-api-json.yml
pull_request:
paths:
- packages/backend/**
-
+ - .github/workflows/validate-api-json.yml
jobs:
validate-api-json:
runs-on: ubuntu-latest
From 722acf5986bda0ddea3a4724d171e4d553037bbf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
<67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 14 Jul 2024 17:28:34 +0900
Subject: [PATCH 06/14] fix(frontend): follow-up of #13089 (#14206)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(frontend): #13089 を修正
* fix
* 正規表現を強化
* fix
---
locales/index.d.ts | 2 +-
packages/frontend/src/components/MkNote.vue | 16 +++++------
.../src/components/MkNoteDetailed.vue | 16 +++++------
packages/frontend/src/components/MkPoll.vue | 9 ++++---
packages/frontend/src/components/MkSignin.vue | 10 ++++---
packages/frontend/src/scripts/please-login.ts | 27 ++++++++++++++++++-
packages/frontend/src/scripts/url.ts | 4 +--
7 files changed, 56 insertions(+), 28 deletions(-)
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 84a402b0de..694ee53a1f 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -5004,7 +5004,7 @@ export interface Locale extends ILocale {
* お問い合わせ
*/
"inquiry": string;
- /**
+ /**
* もう一度お試しください。
*/
"tryAgain": string;
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index c518c7dd41..13273a53b4 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -174,7 +174,7 @@ import MkPoll from '@/components/MkPoll.vue';
import MkUsersTooltip from '@/components/MkUsersTooltip.vue';
import MkUrlPreview from '@/components/MkUrlPreview.vue';
import MkInstanceTicker from '@/components/MkInstanceTicker.vue';
-import { pleaseLogin } from '@/scripts/please-login.js';
+import { pleaseLogin, type OpenOnRemoteOptions } from '@/scripts/please-login.js';
import { checkWordMute } from '@/scripts/check-word-mute.js';
import { userPage } from '@/filters/user.js';
import number from '@/filters/number.js';
@@ -279,10 +279,10 @@ const renoteCollapsed = ref(
),
);
-const pleaseLoginContext = {
+const pleaseLoginContext = computed(() => ({
type: 'lookup',
- path: `https://${host}/notes/${appearNote.value.id}`,
-} as const;
+ url: `https://${host}/notes/${appearNote.value.id}`,
+}));
/* Overload FunctionにLintが対応していないのでコメントアウト
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array | undefined | null, checkOnly: true): boolean;
@@ -417,7 +417,7 @@ if (!props.mock) {
}
function renote(viaKeyboard = false) {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
showMovedDialog();
const { menu } = getRenoteMenu({ note: note.value, renoteButton, mock: props.mock });
@@ -427,7 +427,7 @@ function renote(viaKeyboard = false) {
}
function reply(): void {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
if (props.mock) {
return;
}
@@ -440,7 +440,7 @@ function reply(): void {
}
function react(): void {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
showMovedDialog();
if (appearNote.value.reactionAcceptance === 'likeOnly') {
sound.playMisskeySfx('reaction');
@@ -571,7 +571,7 @@ function showRenoteMenu(): void {
}
if (isMyRenote) {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
os.popupMenu([
getCopyNoteLinkMenu(note.value, i18n.ts.copyLinkRenote),
{ type: 'divider' },
diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue
index 737e9a853a..9a3e595789 100644
--- a/packages/frontend/src/components/MkNoteDetailed.vue
+++ b/packages/frontend/src/components/MkNoteDetailed.vue
@@ -209,7 +209,7 @@ import MkPoll from '@/components/MkPoll.vue';
import MkUsersTooltip from '@/components/MkUsersTooltip.vue';
import MkUrlPreview from '@/components/MkUrlPreview.vue';
import MkInstanceTicker from '@/components/MkInstanceTicker.vue';
-import { pleaseLogin } from '@/scripts/please-login.js';
+import { pleaseLogin, type OpenOnRemoteOptions } from '@/scripts/please-login.js';
import { checkWordMute } from '@/scripts/check-word-mute.js';
import { userPage } from '@/filters/user.js';
import { notePage } from '@/filters/note.js';
@@ -297,10 +297,10 @@ const conversation = ref([]);
const replies = ref([]);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || appearNote.value.userId === $i?.id);
-const pleaseLoginContext = {
+const pleaseLoginContext = computed(() => ({
type: 'lookup',
- path: `https://${host}/notes/${appearNote.value.id}`,
-} as const;
+ url: `https://${host}/notes/${appearNote.value.id}`,
+}));
const keymap = {
'r': () => reply(),
@@ -402,7 +402,7 @@ if (appearNote.value.reactionAcceptance === 'likeOnly') {
}
function renote() {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
showMovedDialog();
const { menu } = getRenoteMenu({ note: note.value, renoteButton });
@@ -410,7 +410,7 @@ function renote() {
}
function reply(): void {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
showMovedDialog();
os.post({
reply: appearNote.value,
@@ -421,7 +421,7 @@ function reply(): void {
}
function react(): void {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
showMovedDialog();
if (appearNote.value.reactionAcceptance === 'likeOnly') {
sound.playMisskeySfx('reaction');
@@ -505,7 +505,7 @@ async function clip(): Promise {
function showRenoteMenu(): void {
if (!isMyRenote) return;
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
os.popupMenu([{
text: i18n.ts.unrenote,
icon: 'ti ti-trash',
diff --git a/packages/frontend/src/components/MkPoll.vue b/packages/frontend/src/components/MkPoll.vue
index 82e2a605f1..72bd8f4f6c 100644
--- a/packages/frontend/src/components/MkPoll.vue
+++ b/packages/frontend/src/components/MkPoll.vue
@@ -36,6 +36,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
import { i18n } from '@/i18n.js';
import { host } from '@/config.js';
import { useInterval } from '@/scripts/use-interval.js';
+import type { OpenOnRemoteOptions } from '@/scripts/please-login.js';
const props = defineProps<{
noteId: string;
@@ -61,10 +62,10 @@ const timer = computed(() => i18n.tsx._poll[
const showResult = ref(props.readOnly || isVoted.value);
-const pleaseLoginContext = {
+const pleaseLoginContext = computed(() => ({
type: 'lookup',
- path: `https://${host}/notes/${props.note.id}`,
-} as const;
+ url: `https://${host}/notes/${props.noteId}`,
+}));
// 期限付きアンケート
if (props.poll.expiresAt) {
@@ -82,7 +83,7 @@ if (props.poll.expiresAt) {
}
const vote = async (id) => {
- pleaseLogin(undefined, pleaseLoginContext);
+ pleaseLogin(undefined, pleaseLoginContext.value);
if (props.readOnly || closed.value || isVoted.value) return;
diff --git a/packages/frontend/src/components/MkSignin.vue b/packages/frontend/src/components/MkSignin.vue
index 746ddd7154..a123bbddc6 100644
--- a/packages/frontend/src/components/MkSignin.vue
+++ b/packages/frontend/src/components/MkSignin.vue
@@ -236,12 +236,14 @@ function openRemote(options: OpenOnRemoteOptions, targetHost?: string): void {
switch (options.type) {
case 'web':
case 'lookup': {
- let _path = options.path;
+ let _path: string;
if (options.type === 'lookup') {
- // TODO: v2024.2.0以降が浸透してきたら正式なURLに変更する▼
+ // TODO: v2024.7.0以降が浸透してきたら正式なURLに変更する▼
// _path = `/lookup?uri=${encodeURIComponent(_path)}`;
- _path = `/authorize-follow?acct=${encodeURIComponent(_path)}`;
+ _path = `/authorize-follow?acct=${encodeURIComponent(options.url)}`;
+ } else {
+ _path = options.path;
}
if (targetHost) {
@@ -252,7 +254,7 @@ function openRemote(options: OpenOnRemoteOptions, targetHost?: string): void {
break;
}
case 'share': {
- const params = query(options.params);
+ const params = query(options.params);
if (targetHost) {
window.open(`https://${targetHost}/share?${params}`, '_blank', 'noopener');
} else {
diff --git a/packages/frontend/src/scripts/please-login.ts b/packages/frontend/src/scripts/please-login.ts
index b04062a58a..18f05bc7f4 100644
--- a/packages/frontend/src/scripts/please-login.ts
+++ b/packages/frontend/src/scripts/please-login.ts
@@ -9,13 +9,38 @@ import { i18n } from '@/i18n.js';
import { popup } from '@/os.js';
export type OpenOnRemoteOptions = {
+ /**
+ * 外部のMisskey Webで特定のパスを開く
+ */
type: 'web';
+
+ /**
+ * 内部パス(例: `/settings`)
+ */
path: string;
} | {
+ /**
+ * 外部のMisskey Webで照会する
+ */
type: 'lookup';
- path: string;
+
+ /**
+ * 照会したいエンティティのURL
+ *
+ * (例: `https://misskey.example.com/notes/abcdexxxxyz`)
+ */
+ url: string;
} | {
+ /**
+ * 外部のMisskeyでノートする
+ */
type: 'share';
+
+ /**
+ * `/share` ページに渡すクエリストリング
+ *
+ * @see https://go.misskey-hub.net/spec/share/
+ */
params: Record;
};
diff --git a/packages/frontend/src/scripts/url.ts b/packages/frontend/src/scripts/url.ts
index c477fb5506..5a8265af9e 100644
--- a/packages/frontend/src/scripts/url.ts
+++ b/packages/frontend/src/scripts/url.ts
@@ -23,6 +23,6 @@ export function appendQuery(url: string, query: string): string {
}
export function extractDomain(url: string) {
- const match = url.match(/^(https)?:?\/{0,2}([^\/]+)/);
- return match ? match[2] : null;
+ const match = url.match(/^(?:https?:)?(?:\/\/)?(?:[^@\n]+@)?([^:\/\n]+)/im);
+ return match ? match[1] : null;
}
From c5607d86333bdca38b9ff8c02a5979492f9d602c Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Sun, 14 Jul 2024 20:14:43 +0900
Subject: [PATCH 07/14] =?UTF-8?q?enhance(backend):=20config=E3=81=ABsignTo?=
=?UTF-8?q?ActivityPubGet=E3=81=AE=E6=8C=87=E5=AE=9A=E3=81=8C=E7=84=A1?=
=?UTF-8?q?=E3=81=84=E5=A0=B4=E5=90=88true=E3=81=A8=E8=A6=8B=E5=81=9A?=
=?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E3=81=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
trueの方が望ましいため
---
packages/backend/src/config.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts
index 0ac521d409..4cc27898be 100644
--- a/packages/backend/src/config.ts
+++ b/packages/backend/src/config.ts
@@ -259,7 +259,7 @@ export function loadConfig(): Config {
deliverJobMaxAttempts: config.deliverJobMaxAttempts,
inboxJobMaxAttempts: config.inboxJobMaxAttempts,
proxyRemoteFiles: config.proxyRemoteFiles,
- signToActivityPubGet: config.signToActivityPubGet,
+ signToActivityPubGet: config.signToActivityPubGet ?? true,
mediaProxy: externalMediaProxy ?? internalMediaProxy,
externalMediaProxyEnabled: externalMediaProxy !== null && externalMediaProxy !== internalMediaProxy,
videoThumbnailGenerator: config.videoThumbnailGenerator ?
From 4b9c60ad21704e7e75df830205cec2db7afc2baa Mon Sep 17 00:00:00 2001
From: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Date: Sun, 14 Jul 2024 20:24:29 +0900
Subject: [PATCH 08/14] =?UTF-8?q?fix(backend):=20=E3=83=A6=E3=83=BC?=
=?UTF-8?q?=E3=82=B6=E3=83=BC=E3=81=AE=E3=83=AA=E3=82=A2=E3=82=AF=E3=82=B7?=
=?UTF-8?q?=E3=83=A7=E3=83=B3=E4=B8=80=E8=A6=A7=E3=81=A7=E3=83=9F=E3=83=A5?=
=?UTF-8?q?=E3=83=BC=E3=83=88/=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF?=
=?UTF-8?q?=E3=81=8C=E6=A9=9F=E8=83=BD=E3=81=97=E3=81=A6=E3=81=84=E3=81=AA?=
=?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=20(#14100)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: mute/block was not considered on users/reactions
* docs(changelog): update changelog
* chore: Apply suggestion from code review
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
---------
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
---
CHANGELOG.md | 1 +
packages/backend/src/misc/is-user-related.ts | 4 ++++
.../server/api/endpoints/users/reactions.ts | 19 +++++++++++++++++--
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2156c81474..e50dbfec9b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -53,6 +53,7 @@
4. フォローしていない非アクティブなユーザ
- Fix: 一般ユーザーから見たユーザーのバッジの一覧に公開されていないものが含まれることがある問題を修正
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/652)
+- Fix: ユーザーのリアクション一覧でミュート/ブロックが機能していなかった問題を修正
### Misskey.js
- Feat: `/drive/files/create` のリクエストに対応(`multipart/form-data`に対応)
diff --git a/packages/backend/src/misc/is-user-related.ts b/packages/backend/src/misc/is-user-related.ts
index 93c9b2b814..862d6e6a38 100644
--- a/packages/backend/src/misc/is-user-related.ts
+++ b/packages/backend/src/misc/is-user-related.ts
@@ -4,6 +4,10 @@
*/
export function isUserRelated(note: any, userIds: Set, ignoreAuthor = false): boolean {
+ if (!note) {
+ return false;
+ }
+
if (userIds.has(note.userId) && !ignoreAuthor) {
return true;
}
diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts
index aca883a052..7805ae3288 100644
--- a/packages/backend/src/server/api/endpoints/users/reactions.ts
+++ b/packages/backend/src/server/api/endpoints/users/reactions.ts
@@ -12,6 +12,7 @@ import { DI } from '@/di-symbols.js';
import { CacheService } from '@/core/CacheService.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { RoleService } from '@/core/RoleService.js';
+import { isUserRelated } from '@/misc/is-user-related.js';
import { ApiError } from '../../error.js';
export const meta = {
@@ -74,6 +75,7 @@ export default class extends Endpoint { // eslint-
private roleService: RoleService,
) {
super(meta, paramDef, async (ps, me) => {
+ const userIdsWhoBlockingMe = me ? await this.cacheService.userBlockedCache.fetch(me.id) : new Set();
const iAmModerator = me ? await this.roleService.isModerator(me) : false; // Moderators can see reactions of all users
if (!iAmModerator) {
const user = await this.cacheService.findUserById(ps.userId);
@@ -85,8 +87,15 @@ export default class extends Endpoint { // eslint-
if ((me == null || me.id !== ps.userId) && !profile.publicReactions) {
throw new ApiError(meta.errors.reactionsNotPublic);
}
+
+ // early return if me is blocked by requesting user
+ if (userIdsWhoBlockingMe.has(ps.userId)) {
+ return [];
+ }
}
+ const userIdsWhoMeMuting = me ? await this.cacheService.userMutingsCache.fetch(me.id) : new Set();
+
const query = this.queryService.makePaginationQuery(this.noteReactionsRepository.createQueryBuilder('reaction'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('reaction.userId = :userId', { userId: ps.userId })
@@ -94,9 +103,15 @@ export default class extends Endpoint { // eslint-
this.queryService.generateVisibilityQuery(query, me);
- const reactions = await query
+ const reactions = (await query
.limit(ps.limit)
- .getMany();
+ .getMany()).filter(reaction => {
+ if (reaction.note?.userId === ps.userId) return true; // we can see reactions to note of requesting user
+ if (me && isUserRelated(reaction.note, userIdsWhoBlockingMe)) return false;
+ if (me && isUserRelated(reaction.note, userIdsWhoMeMuting)) return false;
+
+ return true;
+ });
return await this.noteReactionEntityService.packMany(reactions, me, { withNote: true });
});
From d47fd4ffe152d3dbd4b224e63f350e29ace75e81 Mon Sep 17 00:00:00 2001
From: anatawa12
Date: Sun, 14 Jul 2024 21:29:35 +0900
Subject: [PATCH 09/14] fix: error with trying to handle SIGKILL (#14208)
---
packages/misskey-bubble-game/build.js | 1 -
packages/misskey-js/build.js | 1 -
packages/misskey-reversi/build.js | 1 -
3 files changed, 3 deletions(-)
diff --git a/packages/misskey-bubble-game/build.js b/packages/misskey-bubble-game/build.js
index 0b79f4b915..e626c97a59 100644
--- a/packages/misskey-bubble-game/build.js
+++ b/packages/misskey-bubble-game/build.js
@@ -95,7 +95,6 @@ async function watchSrc() {
process.on('SIGHUP', resolve);
process.on('SIGINT', resolve);
process.on('SIGTERM', resolve);
- process.on('SIGKILL', resolve);
process.on('uncaughtException', reject);
process.on('exit', resolve);
}).finally(async () => {
diff --git a/packages/misskey-js/build.js b/packages/misskey-js/build.js
index a13d9c1186..a80b71646f 100644
--- a/packages/misskey-js/build.js
+++ b/packages/misskey-js/build.js
@@ -95,7 +95,6 @@ async function watchSrc() {
process.on('SIGHUP', resolve);
process.on('SIGINT', resolve);
process.on('SIGTERM', resolve);
- process.on('SIGKILL', resolve);
process.on('uncaughtException', reject);
process.on('exit', resolve);
}).finally(async () => {
diff --git a/packages/misskey-reversi/build.js b/packages/misskey-reversi/build.js
index 0b79f4b915..e626c97a59 100644
--- a/packages/misskey-reversi/build.js
+++ b/packages/misskey-reversi/build.js
@@ -95,7 +95,6 @@ async function watchSrc() {
process.on('SIGHUP', resolve);
process.on('SIGINT', resolve);
process.on('SIGTERM', resolve);
- process.on('SIGKILL', resolve);
process.on('uncaughtException', reject);
process.on('exit', resolve);
}).finally(async () => {
From aa0632727f3de73b0e348f86ffd1c5c3135a46e4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 14 Jul 2024 21:29:57 +0900
Subject: [PATCH 10/14] chore(deps): bump actions/setup-node from 4.0.2 to
4.0.3 (#14165)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4.0.2...v4.0.3)
---
updated-dependencies:
- dependency-name: actions/setup-node
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/api-misskey-js.yml | 2 +-
.github/workflows/changelog-check.yml | 2 +-
.github/workflows/check-misskey-js-autogen.yml | 2 +-
.github/workflows/get-api-diff.yml | 2 +-
.github/workflows/lint.yml | 6 +++---
.github/workflows/locale.yml | 2 +-
.github/workflows/on-release-created.yml | 2 +-
.github/workflows/storybook.yml | 2 +-
.github/workflows/test-backend.yml | 4 ++--
.github/workflows/test-frontend.yml | 4 ++--
.github/workflows/test-misskey-js.yml | 2 +-
.github/workflows/test-production.yml | 2 +-
.github/workflows/validate-api-json.yml | 2 +-
13 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml
index f9385239b0..e7db18316c 100644
--- a/.github/workflows/api-misskey-js.yml
+++ b/.github/workflows/api-misskey-js.yml
@@ -21,7 +21,7 @@ jobs:
- run: corepack enable
- name: Setup Node.js
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: 'pnpm'
diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml
index f254af0d1f..d4e99f966e 100644
--- a/.github/workflows/changelog-check.yml
+++ b/.github/workflows/changelog-check.yml
@@ -14,7 +14,7 @@ jobs:
- name: Checkout head
uses: actions/checkout@v4.1.1
- name: Setup Node.js
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
diff --git a/.github/workflows/check-misskey-js-autogen.yml b/.github/workflows/check-misskey-js-autogen.yml
index 39acad8bc3..3a2a2d5f8d 100644
--- a/.github/workflows/check-misskey-js-autogen.yml
+++ b/.github/workflows/check-misskey-js-autogen.yml
@@ -28,7 +28,7 @@ jobs:
- name: setup node
id: setup-node
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: pnpm
diff --git a/.github/workflows/get-api-diff.yml b/.github/workflows/get-api-diff.yml
index 33fa2ccc39..4afafabf2e 100644
--- a/.github/workflows/get-api-diff.yml
+++ b/.github/workflows/get-api-diff.yml
@@ -34,7 +34,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index cd8ae0b45b..1c5cab208c 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -29,7 +29,7 @@ jobs:
fetch-depth: 0
submodules: true
- uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4.0.2
+ - uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: 'pnpm'
@@ -53,7 +53,7 @@ jobs:
fetch-depth: 0
submodules: true
- uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4.0.2
+ - uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: 'pnpm'
@@ -76,7 +76,7 @@ jobs:
fetch-depth: 0
submodules: true
- uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4.0.2
+ - uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: 'pnpm'
diff --git a/.github/workflows/locale.yml b/.github/workflows/locale.yml
index be3764f3e4..95251bfe31 100644
--- a/.github/workflows/locale.yml
+++ b/.github/workflows/locale.yml
@@ -19,7 +19,7 @@ jobs:
fetch-depth: 0
submodules: true
- uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4.0.2
+ - uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: 'pnpm'
diff --git a/.github/workflows/on-release-created.yml b/.github/workflows/on-release-created.yml
index edfdab99e9..22c04ff297 100644
--- a/.github/workflows/on-release-created.yml
+++ b/.github/workflows/on-release-created.yml
@@ -26,7 +26,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml
index daa76509c8..68452aacaf 100644
--- a/.github/workflows/storybook.yml
+++ b/.github/workflows/storybook.yml
@@ -36,7 +36,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js 20.x
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version-file: '.node-version'
cache: 'pnpm'
diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml
index 99ca09a8ec..bfb79ef090 100644
--- a/.github/workflows/test-backend.yml
+++ b/.github/workflows/test-backend.yml
@@ -46,7 +46,7 @@ jobs:
- name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
@@ -93,7 +93,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml
index 5acf85cb0e..c17a9fd387 100644
--- a/.github/workflows/test-frontend.yml
+++ b/.github/workflows/test-frontend.yml
@@ -35,7 +35,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
@@ -90,7 +90,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml
index 43f5b5b860..6ee67e8735 100644
--- a/.github/workflows/test-misskey-js.yml
+++ b/.github/workflows/test-misskey-js.yml
@@ -31,7 +31,7 @@ jobs:
- run: corepack enable
- name: Setup Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml
index 7f8db65293..18d02ec030 100644
--- a/.github/workflows/test-production.yml
+++ b/.github/workflows/test-production.yml
@@ -25,7 +25,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
diff --git a/.github/workflows/validate-api-json.yml b/.github/workflows/validate-api-json.yml
index b931e64790..90f2929a25 100644
--- a/.github/workflows/validate-api-json.yml
+++ b/.github/workflows/validate-api-json.yml
@@ -27,7 +27,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4.0.2
+ uses: actions/setup-node@v4.0.3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
From f0b9d70720b27977051563713e02abf38eb2b45a Mon Sep 17 00:00:00 2001
From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com>
Date: Sun, 14 Jul 2024 21:30:57 +0900
Subject: [PATCH 11/14] ci: cache eslint (#14204)
* ci: cache eslint
* dummy commit to trigger
* fix syntax error
---
.github/workflows/lint.yml | 11 ++++++++++-
packages/backend/src/const.ts | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 1c5cab208c..c21fc95123 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -40,6 +40,8 @@ jobs:
needs: [pnpm_install]
runs-on: ubuntu-latest
continue-on-error: true
+ env:
+ eslint-cache-version: v1
strategy:
matrix:
workspace:
@@ -59,7 +61,14 @@ jobs:
cache: 'pnpm'
- run: corepack enable
- run: pnpm i --frozen-lockfile
- - run: pnpm --filter ${{ matrix.workspace }} run eslint
+ - name: Restore eslint cache
+ uses: actions/cache@v4.0.2
+ with:
+ path: node_modules/.cache/eslint
+ key: eslint-${{ env.eslint-cache-version }}-${{ hashFiles('/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }}
+ restore-keys: |
+ eslint-${{ env.eslint-cache-version }}-${{ hashFiles('/pnpm-lock.yaml') }}-
+ - run: pnpm --filter ${{ matrix.workspace }} run eslint --cache --cache-location node_modules/.cache/eslint --cache-strategy content
typecheck:
needs: [pnpm_install]
diff --git a/packages/backend/src/const.ts b/packages/backend/src/const.ts
index a238f4973a..4dc689238b 100644
--- a/packages/backend/src/const.ts
+++ b/packages/backend/src/const.ts
@@ -3,6 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
+// dummy
export const MAX_NOTE_TEXT_LENGTH = 3000;
export const USER_ONLINE_THRESHOLD = 1000 * 60 * 10; // 10min
From 16795f18a7d9672f408b81228db67c7df77417f6 Mon Sep 17 00:00:00 2001
From: easrng
Date: Sun, 14 Jul 2024 06:31:30 -0600
Subject: [PATCH 12/14] Enhance(frontend): Allow negative delay in MFM (#14200)
Co-authored-by: easrng
---
CHANGELOG.md | 1 +
.../frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e50dbfec9b..83f2261c1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@
- Fix: 配信停止したインスタンス一覧が見れなくなる問題を修正
- Fix: Dockerコンテナの立ち上げ時に`pnpm`のインストールで固まることがある問題
- Fix: デフォルトテーマに無効なテーマコードを入力するとUIが使用できなくなる問題を修正
+- Enhance: Allow negative delay for MFM animation elements (`tada`, `jelly`, `twitch`, `shake`, `spin`, `jump`, `bounce`, `rainbow`)
### Client
- Enhance: 内蔵APIドキュメントのデザイン・パフォーマンスを改善
diff --git a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts
index cab8d9c704..0d869892bd 100644
--- a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts
+++ b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts
@@ -65,7 +65,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext {
if (t == null) return null;
if (typeof t === 'boolean') return null;
- return t.match(/^[0-9.]+s$/) ? t : null;
+ return t.match(/^\-?[0-9.]+s$/) ? t : null;
};
const validColor = (c: unknown): string | null => {
From 1b84760c19a56c8928ac639d514fe28c7d01e42d Mon Sep 17 00:00:00 2001
From: Souma <101255979+5ouma@users.noreply.github.com>
Date: Sun, 14 Jul 2024 21:33:22 +0900
Subject: [PATCH 13/14] enhance(backend): Load settings via environment
variables (#14179)
* feat(backend): Load settings via environment variables
If they're not loaded from the config file.
* chore(docker): Add hints for environment variables
It supports users to know about them.
* docs(changelog): Add the description about this change
Users can notice what's changed by this PR.
* style(backend): Fix code syntax
To pass the linter.
---
.config/docker_example.env | 6 ++++++
.config/docker_example.yml | 3 +++
CHANGELOG.md | 1 +
compose_example.yml | 2 ++
packages/backend/src/config.ts | 16 ++++++++++------
5 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/.config/docker_example.env b/.config/docker_example.env
index 4fe8e76b78..c61248da2e 100644
--- a/.config/docker_example.env
+++ b/.config/docker_example.env
@@ -1,5 +1,11 @@
+# misskey settings
+# MISSKEY_URL=https://example.tld/
+
# db settings
POSTGRES_PASSWORD=example-misskey-pass
+# DATABASE_PASSWORD=${POSTGRES_PASSWORD}
POSTGRES_USER=example-misskey-user
+# DATABASE_USER=${POSTGRES_USER}
POSTGRES_DB=misskey
+# DATABASE_DB=${POSTGRES_DB}
DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}"
diff --git a/.config/docker_example.yml b/.config/docker_example.yml
index 42ac18de1b..d347882d1a 100644
--- a/.config/docker_example.yml
+++ b/.config/docker_example.yml
@@ -6,6 +6,7 @@
#───┘ URL └─────────────────────────────────────────────────────
# Final accessible URL seen by a user.
+# You can set url from an environment variable instead.
url: https://example.tld/
# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE
@@ -38,9 +39,11 @@ db:
port: 5432
# Database name
+ # You can set db from an environment variable instead.
db: misskey
# Auth
+ # You can set user and pass from environment variables instead.
user: example-misskey-user
pass: example-misskey-pass
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83f2261c1d..14cae5d3de 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,6 +37,7 @@
- Enhance: エンドポイント`gallery/posts/update`の必須項目を`postId`のみに
- Enhance: エンドポイント`i/webhook/update`の必須項目を`webhookId`のみに
- Enhance: エンドポイント`admin/ad/update`の必須項目を`id`のみに
+- Enhance: `default.yml`内の`url`, `db.db`, `db.user`, `db.pass`を環境変数から読み込めるように
- Fix: チャート生成時にinstance.suspentionStateに置き換えられたinstance.isSuspendedが参照されてしまう問題を修正
- Fix: ユーザーのフィードページのMFMをHTMLに展開するように (#14006)
- Fix: アンテナ・クリップ・リスト・ウェブフックがロールポリシーの上限より一つ多く作れてしまうのを修正 (#14036)
diff --git a/compose_example.yml b/compose_example.yml
index 75d0d3a59c..336bd814a7 100644
--- a/compose_example.yml
+++ b/compose_example.yml
@@ -17,6 +17,8 @@ services:
networks:
- internal_network
- external_network
+ # env_file:
+ # - .config/docker.env
volumes:
- ./files:/misskey/files
- ./.config:/misskey/.config:ro
diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts
index 4cc27898be..3e5a1e81cd 100644
--- a/packages/backend/src/config.ts
+++ b/packages/backend/src/config.ts
@@ -23,7 +23,7 @@ type RedisOptionsSource = Partial & {
* 設定ファイルの型
*/
type Source = {
- url: string;
+ url?: string;
port?: number;
socket?: string;
chmodSocket?: string;
@@ -31,9 +31,9 @@ type Source = {
db: {
host: string;
port: number;
- db: string;
- user: string;
- pass: string;
+ db?: string;
+ user?: string;
+ pass?: string;
disableCache?: boolean;
extra?: { [x: string]: string };
};
@@ -202,13 +202,17 @@ export function loadConfig(): Config {
: { 'src/_boot_.ts': { file: 'src/_boot_.ts' } };
const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
- const url = tryCreateUrl(config.url);
+ const url = tryCreateUrl(config.url ?? process.env.MISSKEY_URL ?? '');
const version = meta.version;
const host = url.host;
const hostname = url.hostname;
const scheme = url.protocol.replace(/:$/, '');
const wsScheme = scheme.replace('http', 'ws');
+ const dbDb = config.db.db ?? process.env.DATABASE_DB ?? '';
+ const dbUser = config.db.user ?? process.env.DATABASE_USER ?? '';
+ const dbPass = config.db.pass ?? process.env.DATABASE_PASSWORD ?? '';
+
const externalMediaProxy = config.mediaProxy ?
config.mediaProxy.endsWith('/') ? config.mediaProxy.substring(0, config.mediaProxy.length - 1) : config.mediaProxy
: null;
@@ -231,7 +235,7 @@ export function loadConfig(): Config {
apiUrl: `${scheme}://${host}/api`,
authUrl: `${scheme}://${host}/auth`,
driveUrl: `${scheme}://${host}/files`,
- db: config.db,
+ db: { ...config.db, db: dbDb, user: dbUser, pass: dbPass },
dbReplications: config.dbReplications,
dbSlaves: config.dbSlaves,
meilisearch: config.meilisearch,
From ce39c3a2fbf9ab9efaff82fdbad84ac9f2311c6e Mon Sep 17 00:00:00 2001
From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com>
Date: Mon, 15 Jul 2024 14:58:48 +0900
Subject: [PATCH 14/14] chore(backend): registed -> registered (#14213)
* chore(backend): registed -> registered
* Update CHANGELOG.md
---
CHANGELOG.md | 1 +
.../backend/src/core/activitypub/models/ApQuestionService.ts | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14cae5d3de..d7b5979a21 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -56,6 +56,7 @@
- Fix: 一般ユーザーから見たユーザーのバッジの一覧に公開されていないものが含まれることがある問題を修正
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/652)
- Fix: ユーザーのリアクション一覧でミュート/ブロックが機能していなかった問題を修正
+- Fix: エラーメッセージの誤字を修正 (#14213)
### Misskey.js
- Feat: `/drive/files/create` のリクエストに対応(`multipart/form-data`に対応)
diff --git a/packages/backend/src/core/activitypub/models/ApQuestionService.ts b/packages/backend/src/core/activitypub/models/ApQuestionService.ts
index 4fae1e897b..73004d10b0 100644
--- a/packages/backend/src/core/activitypub/models/ApQuestionService.ts
+++ b/packages/backend/src/core/activitypub/models/ApQuestionService.ts
@@ -74,10 +74,10 @@ export class ApQuestionService {
//#region このサーバーに既に登録されているか
const note = await this.notesRepository.findOneBy({ uri });
- if (note == null) throw new Error('Question is not registed');
+ if (note == null) throw new Error('Question is not registered');
const poll = await this.pollsRepository.findOneBy({ noteId: note.id });
- if (poll == null) throw new Error('Question is not registed');
+ if (poll == null) throw new Error('Question is not registered');
//#endregion
// resolve new Question object