From 00cbf9fe8085afe4190721b80a5bd55d0099c4cf Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sat, 9 Nov 2024 14:09:02 +0900 Subject: [PATCH 01/10] Update CONTRIBUTING.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76a5f42eac..f8af6b3df0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,6 +85,7 @@ Be willing to comment on the good points and not just the things you want fixed 読んでおくといいやつ - https://blog.lacolaco.net/posts/1e2cf439b3c2/ +- https://konifar-zatsu.hatenadiary.jp/entry/2024/11/05/192421 ### Review perspective - Scope From 1496700b3754be3a91d0123fc5ca17b6e8845488 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: Sat, 9 Nov 2024 15:51:49 +0900 Subject: [PATCH 02/10] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit たぶんリリースワークフローはこうしないと認識してくれない --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76abe42e10..a302632a6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2024.10.2 +## 2024.11.0 ### General - Feat: コンテンツの表示にログインを必須にできるように From e0a83e9c9ecbabcaa017d0b586b7ad56b3b4b6db 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: Sat, 9 Nov 2024 15:57:10 +0900 Subject: [PATCH 03/10] =?UTF-8?q?Update=20CHANGELOG.md=20(=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E6=96=B9=E3=82=92=E6=8F=83=E3=81=88=E3=82=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a302632a6c..8f428c1c15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,8 @@ - Enhance: 起動前の疎通チェックで、DBとメイン以外のRedisの疎通確認も行うように (Based on https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/588) (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/715) -- fix(backend): フォロワーへのメッセージの絵文字をemojisに含めるように +- Enhance: リモートユーザーの照会をオリジナルにリダイレクトするように +- Fix: フォロワーへのメッセージの絵文字をemojisに含めるように - Fix: Nested proxy requestsを検出した際にブロックするように [ghsa-gq5q-c77c-v236](https://github.com/misskey-dev/misskey/security/advisories/ghsa-gq5q-c77c-v236) - Fix: 招待コードの発行可能な残り数算出に使用すべきロールポリシーの値が違う問題を修正 @@ -41,7 +42,6 @@ (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/712) - Fix: FTT無効時にユーザーリストタイムラインが使用できない問題を修正 (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/709) -- Enhance: リモートユーザーの照会をオリジナルにリダイレクトするように ### Misskey.js - Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正 From 31e5f0bd09175baba8b1cc9e617c83934b423596 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, 10 Nov 2024 15:08:58 +0900 Subject: [PATCH 04/10] =?UTF-8?q?fix(frontend):=20=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E6=9C=89=E5=8A=B9=E5=8C=96=E6=99=82=E3=81=AE=E3=80=8C=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=E3=80=8D=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=83=9C=E3=83=83=E3=82=AF=E3=82=B9=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=82=92=E4=BF=AE=E6=AD=A3=20(#14928)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): メールアドレス登録有効化時の「完了」ダイアログボックスの表示条件を修正 * Update MkSignupDialog.form.vue * fix condition --- packages/frontend/src/components/MkSignupDialog.form.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkSignupDialog.form.vue b/packages/frontend/src/components/MkSignupDialog.form.vue index 3d1c44fc90..e1f4e26d62 100644 --- a/packages/frontend/src/components/MkSignupDialog.form.vue +++ b/packages/frontend/src/components/MkSignupDialog.form.vue @@ -277,7 +277,7 @@ async function onSubmit(): Promise { return null; }); - if (res) { + if (res && res.ok) { if (res.status === 204 || instance.emailRequiredForSignup) { os.alert({ type: 'success', @@ -295,6 +295,8 @@ async function onSubmit(): Promise { await login(resJson.token); } } + } else { + onSignupApiError(); } submitting.value = false; From 6bd3ed2074b9cfdfc46db0ca5a7a2a7507103519 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 10 Nov 2024 15:10:04 +0900 Subject: [PATCH 05/10] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f428c1c15..e5bbda36fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ### General - Feat: コンテンツの表示にログインを必須にできるように - Feat: 過去のノートを非公開化/フォロワーのみ表示可能にできるように +- Enhance: 依存関係の更新 +- Enhance: l10nの更新 ### Client - Enhance: Bull DashboardでRelationship Queueの状態も確認できるように @@ -25,6 +27,7 @@ - Fix: リンク切れを修正 = Fix: ノート投稿ボタンにホバー時のスタイルが適用されていないのを修正 (Cherry-picked from https://github.com/taiyme/misskey/pull/305) +- Fix: メールアドレス登録有効化時の「完了」ダイアログボックスの表示条件を修正 ### Server - Enhance: 起動前の疎通チェックで、DBとメイン以外のRedisの疎通確認も行うように From ffd5c9066d16022ad2ae2e65484e722c5ca7ce32 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 10 Nov 2024 00:10:52 -0600 Subject: [PATCH 06/10] autodeploy add profiles Signed-off-by: eternal-flame-AD --- yume-mods/misskey-auto-deploy/src/lib.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/yume-mods/misskey-auto-deploy/src/lib.rs b/yume-mods/misskey-auto-deploy/src/lib.rs index d23c209f94..93f3ae5153 100644 --- a/yume-mods/misskey-auto-deploy/src/lib.rs +++ b/yume-mods/misskey-auto-deploy/src/lib.rs @@ -49,6 +49,7 @@ pub struct RefConfig { pub stdout: Option, pub stderr: Option, pub working_dir: PathBuf, + pub profiles: Option>, pub compose_flags: Option>, pub env: Option>, pub uid: u32, @@ -200,6 +201,17 @@ impl App { let mut command = Command::new("docker") .arg("compose") + .args( + matched_ref + .config + .profiles + .as_ref() + .map(|profiles| + profiles.iter() + .flat_map(|profiles| ["--profile", profiles.as_str()]) + .collect::>()) + .unwrap_or(Vec::new()), + ) .arg("up") .arg("--detach") .arg("--build") @@ -289,7 +301,7 @@ impl App { State(state): State, Query(query): Query, ) -> Result, ApiError> { - let ref_ = match (&query.ref_, &query.branch) { + let ref_ = match (query.ref_.as_ref(), query.branch.as_ref()) { (Some(ref_), None) => ref_.clone(), (None, Some(branch)) => format!("refs/heads/{}", branch), _ => { From e74174dea390688273ea2af6333d1b7abb9012aa Mon Sep 17 00:00:00 2001 From: fly_mc Date: Sun, 10 Nov 2024 13:29:28 +0800 Subject: [PATCH 07/10] more stable ws stream Signed-off-by: eternal-flame-AD --- packages/frontend/src/stream.ts | 88 ++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/packages/frontend/src/stream.ts b/packages/frontend/src/stream.ts index e63dac951c..e23937e6b6 100644 --- a/packages/frontend/src/stream.ts +++ b/packages/frontend/src/stream.ts @@ -7,45 +7,85 @@ import * as Misskey from 'misskey-js'; import { markRaw } from 'vue'; import { $i } from '@/account.js'; import { wsOrigin } from '@@/js/config.js'; +import { DEFAULT_DEVICE_KIND } from '@/scripts/device-kind.js'; // TODO: No WebsocketモードでStreamMockが使えそう //import { StreamMock } from '@/scripts/stream-mock.js'; // heart beat interval in ms -const HEART_BEAT_INTERVAL = 1000 * 60; +const HEART_BEAT_INTERVAL = DEFAULT_DEVICE_KIND === 'desktop' ? 1000 * 15 : 1000 * 30; + +const RECONNECT_MAX_ATTEMPTS = 10; +const RECONNECT_INITIAL_DELAY = 1000; +const RECONNECT_MAX_DELAY = 1000 * 30; let stream: Misskey.IStream | null = null; let timeoutHeartBeat: number | null = null; let lastHeartbeatCall = 0; +let reconnectAttempts = 0; +let reconnectTimeout: number | null = null; + +function getReconnectDelay(): number { + const delay = RECONNECT_INITIAL_DELAY * Math.pow(2, reconnectAttempts); + return Math.min(delay, RECONNECT_MAX_DELAY); +} + +function createStream(): Misskey.IStream { + const newStream = markRaw(new Misskey.Stream(wsOrigin, $i ? { + token: $i.token, + } : null)); + + newStream.on('_disconnected_', () => { + console.log('Stream disconnected, attempting to reconnect...'); + if (reconnectAttempts < RECONNECT_MAX_ATTEMPTS) { + const delay = getReconnectDelay(); + reconnectTimeout = window.setTimeout(() => { + reconnectAttempts++; + stream = null; + useStream(); + }, delay); + } else { + console.error('Max reconnection attempts reached'); + } + }); + + newStream.on('_connected_', () => { + console.log('Stream connected successfully'); + reconnectAttempts = 0; + if (reconnectTimeout) { + clearTimeout(reconnectTimeout); + reconnectTimeout = null; + } + }); + + return newStream; +} export function useStream(): Misskey.IStream { - if (stream) return stream; + if (stream) return stream; - // TODO: No Websocketモードもここで判定 - stream = markRaw(new Misskey.Stream(wsOrigin, $i ? { - token: $i.token, - } : null)); + stream = createStream(); - if (timeoutHeartBeat) window.clearTimeout(timeoutHeartBeat); - timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL); + if (timeoutHeartBeat) window.clearTimeout(timeoutHeartBeat); + timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL); - // send heartbeat right now when last send time is over HEART_BEAT_INTERVAL - document.addEventListener('visibilitychange', () => { - if ( - !stream - || document.visibilityState !== 'visible' - || Date.now() - lastHeartbeatCall < HEART_BEAT_INTERVAL - ) return; - heartbeat(); - }); + // send heartbeat right now when last send time is over HEART_BEAT_INTERVAL + document.addEventListener('visibilitychange', () => { + if ( + !stream + || document.visibilityState !== 'visible' + || Date.now() - lastHeartbeatCall < HEART_BEAT_INTERVAL + ) return; + heartbeat(); + }); - return stream; + return stream; } function heartbeat(): void { - if (stream != null && document.visibilityState === 'visible') { - stream.heartbeat(); - } - lastHeartbeatCall = Date.now(); - if (timeoutHeartBeat) window.clearTimeout(timeoutHeartBeat); - timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL); + if (stream != null && document.visibilityState === 'visible') { + stream.heartbeat(); + } + lastHeartbeatCall = Date.now(); + if (timeoutHeartBeat) window.clearTimeout(timeoutHeartBeat); + timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL); } From 997c5b3d35ce9b9862b33674eb932ba5cc9fcc54 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 10 Nov 2024 00:09:08 -0600 Subject: [PATCH 08/10] fix(frontend): eventListener leak Signed-off-by: eternal-flame-AD --- packages/frontend/src/stream.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/stream.ts b/packages/frontend/src/stream.ts index e23937e6b6..57fae49d4b 100644 --- a/packages/frontend/src/stream.ts +++ b/packages/frontend/src/stream.ts @@ -68,14 +68,20 @@ export function useStream(): Misskey.IStream { if (timeoutHeartBeat) window.clearTimeout(timeoutHeartBeat); timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL); - // send heartbeat right now when last send time is over HEART_BEAT_INTERVAL - document.addEventListener('visibilitychange', () => { + const target = () => { if ( !stream || document.visibilityState !== 'visible' || Date.now() - lastHeartbeatCall < HEART_BEAT_INTERVAL ) return; heartbeat(); + }; + + // send heartbeat right now when last send time is over HEART_BEAT_INTERVAL + document.addEventListener('visibilitychange', target); + + stream.on('_disconnected_', () => { + document.removeEventListener('visibilitychange', target); }); return stream; From 8652fd27b96a4133c09471c367eb201bba8cbc96 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 10 Nov 2024 00:41:40 -0600 Subject: [PATCH 09/10] add git info to build Signed-off-by: eternal-flame-AD --- packages/backend/src/config.ts | 6 +++++- packages/backend/src/server/NodeinfoServerService.ts | 2 ++ scripts/build-pre.js | 11 ++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index db5c9357e3..54f77764f0 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -155,6 +155,8 @@ export type Config = { signToActivityPubGet: boolean | undefined; version: string; + gitDescribe: string; + gitCommit: string; publishTarballInsteadOfProvideRepositoryUrl: boolean; setupPassword: string | undefined; host: string; @@ -218,7 +220,7 @@ export function loadConfig(): Config { const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source; const url = tryCreateUrl(config.url ?? process.env.MISSKEY_URL ?? ''); - const version = meta.version; + const { version, gitDescribe, gitCommit } = meta; const host = url.host; const hostname = url.hostname; const scheme = url.protocol.replace(/:$/, ''); @@ -236,6 +238,8 @@ export function loadConfig(): Config { return { version, + gitCommit, + gitDescribe, publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl, setupPassword: config.setupPassword, url: url.origin, diff --git a/packages/backend/src/server/NodeinfoServerService.ts b/packages/backend/src/server/NodeinfoServerService.ts index 9a641007ee..740d6b6a58 100644 --- a/packages/backend/src/server/NodeinfoServerService.ts +++ b/packages/backend/src/server/NodeinfoServerService.ts @@ -105,6 +105,8 @@ export class NodeinfoServerService { name: meta.maintainerName, email: meta.maintainerEmail, }, + gitCommit: this.config.gitCommit, + gitDescribe: this.config.gitDescribe, langs: meta.langs, tosUrl: meta.termsOfServiceUrl, privacyPolicyUrl: meta.privacyPolicyUrl, diff --git a/scripts/build-pre.js b/scripts/build-pre.js index a90d53c75d..d269754196 100644 --- a/scripts/build-pre.js +++ b/scripts/build-pre.js @@ -4,14 +4,23 @@ */ const fs = require('fs'); +const child_process = require('child_process'); const packageJsonPath = __dirname + '/../package.json' function build() { try { + const gitDescribe = child_process.execSync('git describe --tags --always').toString().trim(); + const gitCommit = child_process.execSync('git rev-parse HEAD').toString().trim(); const json = fs.readFileSync(packageJsonPath, 'utf-8') const meta = JSON.parse(json); fs.mkdirSync(__dirname + '/../built', { recursive: true }); - fs.writeFileSync(__dirname + '/../built/meta.json', JSON.stringify({ version: meta.version }), 'utf-8'); + fs.writeFileSync(__dirname + '/../built/meta.json', + JSON.stringify( + { + version: meta.version, + gitCommit: gitCommit, + gitDescribe: gitDescribe, + }), 'utf-8'); } catch (e) { console.error(e) } From 94ce0fd41408f90012ded5de485c0a9aa0df1358 Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 10 Nov 2024 00:55:00 -0600 Subject: [PATCH 10/10] tag: 2024.11.0-yumechinokuni.1 Signed-off-by: eternal-flame-AD --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 532c4cb7c9..ca3366ff74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.11.0-yumechinokuni.0", + "version": "2024.11.0-yumechinokuni.1", "codename": "nasubi", "repository": { "type": "git",