diff --git a/.config/example.yml b/.config/example.yml index 60a6a0aa71b..bae574d9c3a 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -321,3 +321,7 @@ signToActivityPubGet: true # PID File of master process #pidFile: /tmp/misskey.pid + +# ローカル宛てのメンション、リプライ、引用ノートの発行元が、ローカルユーザーにフォローされていない場合に投稿を拒否するかどうか +# default: false +# misskeyBlockMentionsFromUnfamiliarRemoteUsers: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fa756c0f05..e8615c0c69a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2024.11.0-voskey +### Server +- 以下の借用機能は任意にON/OFF出来るのでわざわざ除去する必要がなく、使いたい状況がある事に気付いたので、OFFの状態で再度導入 → (ローカルユーザーがまだ誰もフォローしていないリモートユーザーによる通知を引き起こす可能性のある投稿を拒否できるように) + ## 2024.11.0 ### Note @@ -345,6 +349,14 @@ - Feat: `/drive/files/create` のリクエストに対応(`multipart/form-data`に対応) - Feat: `/admin/role/create` のロールポリシーの型を修正 + +## 2024.5.0-voskey +### Server +- 以下の機能を除去して元に戻す → (ローカルユーザーがまだ誰もフォローしていないリモートユーザーによる通知を引き起こす可能性のある投稿を拒否できるように) +### Client +- デフォルトで「常に広告を表示する」をオンに +- デフォルトのピン留め(リアクション)を変更 + ## 2024.5.0 ### Note @@ -450,6 +462,7 @@ - Fix: もともとセンシティブではないと連合されていたファイルがセンシティブとして連合された場合にセンシティブとしてそのファイルを扱うように - センシティブとして連合したファイルは非センシティブとして連合されてもセンシティブとして扱われます + ## 2024.3.1 ### General @@ -502,6 +515,10 @@ - `category`および`licence`が指定なしの時勝手にnullに上書きされる挙動を修正 - Fix: 通知の受信設定で「相互フォロー」が正しく動作しない問題を修正 +## 2024.2.0-voskey +### Server +- ローカルユーザーがまだ誰もフォローしていないリモートユーザーによる通知を引き起こす可能性のある投稿を拒否できるように(すしすきー様 2024.2.0-sushiskiより借用) + ## 2024.2.0 ### Note diff --git a/Dockerfile b/Dockerfile index ee765abe7cb..3a386d96dc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,8 +66,11 @@ RUN --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ FROM --platform=$TARGETPLATFORM node:${NODE_VERSION}-slim AS runner -ARG UID="991" -ARG GID="991" +ARG UID_H +ARG GID_H + +ARG UID=${UID_H} +ARG GID=${GID_H} RUN apt-get update \ && apt-get install -y --no-install-recommends \ diff --git a/package.json b/package.json index 60de6f4e15e..e357d112404 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.11.0", + "version": "2024.11.0-voskey", "codename": "nasubi", "repository": { "type": "git", diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 42f1033b9d0..474f198c97d 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -99,6 +99,7 @@ type Source = { perUserNotificationsMaxCount?: number; deactivateAntennaThreshold?: number; pidFile: string; + misskeyBlockMentionsFromUnfamiliarRemoteUsers?: boolean; }; export type Config = { @@ -182,6 +183,7 @@ export type Config = { perUserNotificationsMaxCount: number; deactivateAntennaThreshold: number; pidFile: string; + misskeyBlockMentionsFromUnfamiliarRemoteUsers: boolean; }; const _filename = fileURLToPath(import.meta.url); @@ -293,6 +295,7 @@ export function loadConfig(): Config { perUserNotificationsMaxCount: config.perUserNotificationsMaxCount ?? 500, deactivateAntennaThreshold: config.deactivateAntennaThreshold ?? (1000 * 60 * 60 * 24 * 7), pidFile: config.pidFile, + misskeyBlockMentionsFromUnfamiliarRemoteUsers: config.misskeyBlockMentionsFromUnfamiliarRemoteUsers ?? false, }; } diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 56ddcefd7c4..cb5e98e9c55 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -368,6 +368,15 @@ export class NoteCreateService implements OnApplicationShutdown { // if the host is media-silenced, custom emojis are not allowed if (this.utilityService.isMediaSilencedHost(this.meta.mediaSilencedHosts, user.host)) emojis = []; + const willCauseNotification = mentionedUsers.filter(u => u.host === null).length > 0 || data.reply?.userHost === null || data.renote?.userHost === null; + + if (this.config.misskeyBlockMentionsFromUnfamiliarRemoteUsers === true && user.host !== null && willCauseNotification) { + const userEntity = await this.usersRepository.findOneBy({ id: user.id }); + if ((userEntity?.followersCount ?? 0) === 0) { + throw new Error('Temporarily, notes including mentions, replies and renotes to local-user from remote users which is not followed by local-users are not allowed'); + } + } + tags = tags.filter(tag => Array.from(tag).length <= 128).splice(0, 32); if (data.reply && (user.id !== data.reply.userId) && !mentionedUsers.some(u => u.id === data.reply!.userId)) { diff --git a/packages/backend/src/server/api/endpoints/clips/add-note.ts b/packages/backend/src/server/api/endpoints/clips/add-note.ts index d7c9ea3964b..a40936553e5 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -20,7 +20,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 20, + max: 100, }, errors: { diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 1d981e897bd..423ee067d01 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -126,7 +126,7 @@ export const defaultStore = markRaw(new Storage('base', { }, reactions: { where: 'account', - default: ['👍', '❤️', '😆', '🤔', '😮', '🎉', '💢', '😥', '😇', '🍮'], + default: ['👍', '❤️', '⭐', '🤔', '😩', '㊗️', '🍮' , ':iihanashi:','🈂️',':kandou:', ':voskey_icon:' , ':takahashi_fankit:'], }, pinnedEmojis: { where: 'account', @@ -376,7 +376,7 @@ export const defaultStore = markRaw(new Storage('base', { }, forceShowAds: { where: 'device', - default: false, + default: true, }, aiChanMode: { where: 'device',