Skip to content

Commit

Permalink
Merge branch 'develop' into pr/12643
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Dec 14, 2023
2 parents f893142 + 2cfe64e commit 825f6c1
Show file tree
Hide file tree
Showing 32 changed files with 391 additions and 163 deletions.
22 changes: 11 additions & 11 deletions .config/docker_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ dbReplications: false
# You can configure any number of replicas here
#dbSlaves:
# -
# host:
# port:
# db:
# user:
# pass:
# host:
# port:
# db:
# user:
# pass:
# -
# host:
# port:
# db:
# user:
# pass:
# host:
# port:
# db:
# user:
# pass:

# ┌─────────────────────┐
#───┘ Redis configuration └─────────────────────────────────────
Expand Down Expand Up @@ -151,7 +151,7 @@ id: 'aidx'

# Job rate limiter
# deliverJobPerSec: 128
# inboxJobPerSec: 16
# inboxJobPerSec: 32

# Job attempts
# deliverJobMaxAttempts: 12
Expand Down
2 changes: 1 addition & 1 deletion .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ id: 'aidx'

# Job rate limiter
#deliverJobPerSec: 128
#inboxJobPerSec: 16
#inboxJobPerSec: 32
#relashionshipJobPerSec: 64

# Job attempts
Expand Down
22 changes: 11 additions & 11 deletions .devcontainer/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ dbReplications: false
# You can configure any number of replicas here
#dbSlaves:
# -
# host:
# port:
# db:
# user:
# pass:
# host:
# port:
# db:
# user:
# pass:
# -
# host:
# port:
# db:
# user:
# pass:
# host:
# port:
# db:
# user:
# pass:

# ┌─────────────────────┐
#───┘ Redis configuration └─────────────────────────────────────
Expand Down Expand Up @@ -147,7 +147,7 @@ id: 'aidx'

# Job rate limiter
# deliverJobPerSec: 128
# inboxJobPerSec: 16
# inboxJobPerSec: 32

# Job attempts
# deliverJobMaxAttempts: 12
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Feat: メールアドレスの認証にverifymail.ioを使えるように (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/971ba07a44550f68d2ba31c62066db2d43a0caed)
- Feat: モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能を追加 (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/e0eb5a752f6e5616d6312bb7c9790302f9dbff83)
- Feat: TL上からノートが見えなくなるワードミュートであるハードミュートを追加
- Enhance: アイコンデコレーションを複数設定できるように
- Fix: MFM `$[unixtime ]` に不正な値を入力した際に発生する各種エラーを修正

### Client
Expand Down Expand Up @@ -50,6 +51,7 @@
- Fix: 通知のグルーピング設定を変更してもリロードされるまで表示が変わらない問題を修正 #12470
- Fix: 長い名前のチャンネルにおける投稿フォームの表示が崩れる問題を修正
- Fix: セキュリティ向上のためAiScriptの`Mk:apiExternal`を無効化
- Fix: ノート中の絵文字をタップして「リアクションする」からリアクションした際にリアクションサウンドが鳴らない不具合を修正

### Server
- Enhance: MFM `$[ruby ]` が他ソフトウェアと連合されるように
Expand All @@ -67,6 +69,7 @@
- Fix: チャンネルのノート一覧にてインスタンスミュートが効かない問題
- Fix: 「みつける」が年越し時に壊れる問題を修正
- Fix: アカウントをブロックした際に、自身のユーザーのページでノートが相手に表示される問題を修正
- Fix: モデレーションログがモデレーターは閲覧できないように修正

## 2023.11.1

Expand Down
22 changes: 11 additions & 11 deletions chart/files/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ dbReplications: false
# You can configure any number of replicas here
#dbSlaves:
# -
# host:
# port:
# db:
# user:
# pass:
# host:
# port:
# db:
# user:
# pass:
# -
# host:
# port:
# db:
# user:
# pass:
# host:
# port:
# db:
# user:
# pass:

# ┌─────────────────────┐
#───┘ Redis configuration └─────────────────────────────────────
Expand Down Expand Up @@ -167,7 +167,7 @@ id: "aidx"

# Job rate limiter
# deliverJobPerSec: 128
# inboxJobPerSec: 16
# inboxJobPerSec: 32

# Job attempts
# deliverJobMaxAttempts: 12
Expand Down
5 changes: 5 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export interface Locale {
"removeAreYouSure": string;
"deleteAreYouSure": string;
"resetAreYouSure": string;
"areYouSure": string;
"saved": string;
"messaging": string;
"upload": string;
Expand Down Expand Up @@ -1160,6 +1161,7 @@ export interface Locale {
"avatarDecorations": string;
"attach": string;
"detach": string;
"detachAll": string;
"angle": string;
"flip": string;
"showAvatarDecorations": string;
Expand All @@ -1173,6 +1175,7 @@ export interface Locale {
"doReaction": string;
"code": string;
"reloadRequiredToApplySettings": string;
"remainingN": string;
"_announcement": {
"forExistingUsers": string;
"forExistingUsersDescription": string;
Expand Down Expand Up @@ -1701,6 +1704,7 @@ export interface Locale {
"canHideAds": string;
"canSearchNotes": string;
"canUseTranslator": string;
"avatarDecorationLimit": string;
};
"_condition": {
"isLocal": string;
Expand Down Expand Up @@ -2181,6 +2185,7 @@ export interface Locale {
"changeAvatar": string;
"changeBanner": string;
"verifiedLinkDescription": string;
"avatarDecorationMax": string;
};
"_exportOrImport": {
"allNotes": string;
Expand Down
5 changes: 5 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ removed: "削除しました"
removeAreYouSure: "「{x}」を削除しますか?"
deleteAreYouSure: "「{x}」を削除しますか?"
resetAreYouSure: "リセットしますか?"
areYouSure: "よろしいですか?"
saved: "保存しました"
messaging: "チャット"
upload: "アップロード"
Expand Down Expand Up @@ -1157,6 +1158,7 @@ tosAndPrivacyPolicy: "利用規約・プライバシーポリシー"
avatarDecorations: "アイコンデコレーション"
attach: "付ける"
detach: "外す"
detachAll: "全て外す"
angle: "角度"
flip: "反転"
showAvatarDecorations: "アイコンのデコレーションを表示"
Expand All @@ -1170,6 +1172,7 @@ cwNotationRequired: "「内容を隠す」がオンの場合は注釈の記述
doReaction: "リアクションする"
code: "コード"
reloadRequiredToApplySettings: "設定の反映にはリロードが必要です。"
remainingN: "残り: {n}"

_announcement:
forExistingUsers: "既存ユーザーのみ"
Expand Down Expand Up @@ -1610,6 +1613,7 @@ _role:
canHideAds: "広告の非表示"
canSearchNotes: "ノート検索の利用"
canUseTranslator: "翻訳機能の利用"
avatarDecorationLimit: "アイコンデコレーションの最大取付個数"
_condition:
isLocal: "ローカルユーザー"
isRemote: "リモートユーザー"
Expand Down Expand Up @@ -2084,6 +2088,7 @@ _profile:
changeAvatar: "アイコン画像を変更"
changeBanner: "バナー画像を変更"
verifiedLinkDescription: "内容にURLを設定すると、リンク先のWebサイトに自分のプロフィールへのリンクが含まれている場合に所有者確認済みアイコンを表示させることができます。"
avatarDecorationMax: "最大{max}つまでデコレーションを付けられます。"

_exportOrImport:
allNotes: "全てのノート"
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"decoratorMetadata": true
},
"experimental": {
"keepImportAttributes": true
"keepImportAssertions": true
},
"baseUrl": "src",
"paths": {
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/core/RoleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export type RolePolicies = {
userListLimit: number;
userEachUserListsLimit: number;
rateLimitFactor: number;
avatarDecorationLimit: number;
};

export const DEFAULT_POLICIES: RolePolicies = {
Expand All @@ -73,6 +74,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
userListLimit: 10,
userEachUserListsLimit: 50,
rateLimitFactor: 1,
avatarDecorationLimit: 1,
};

@Injectable()
Expand Down Expand Up @@ -326,6 +328,7 @@ export class RoleService implements OnApplicationShutdown {
userListLimit: calc('userListLimit', vs => Math.max(...vs)),
userEachUserListsLimit: calc('userEachUserListsLimit', vs => Math.max(...vs)),
rateLimitFactor: calc('rateLimitFactor', vs => Math.max(...vs)),
avatarDecorationLimit: calc('avatarDecorationLimit', vs => Math.max(...vs)),
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/models/json-schema/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const packedRoleSchema = {
userEachUserListsLimit: rolePolicyValue,
canManageAvatarDecorations: rolePolicyValue,
canUseTranslator: rolePolicyValue,
avatarDecorationLimit: rolePolicyValue,
},
},
usersCount: {
Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/models/json-schema/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ export const packedMeDetailedOnlySchema = {
type: 'number',
nullable: false, optional: false,
},
avatarDecorationLimit: {
type: 'number',
nullable: false, optional: false,
},
},
},
//#region secrets
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/queue/QueueProcessorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class QueueProcessorService implements OnApplicationShutdown {
autorun: false,
concurrency: this.config.inboxJobConcurrency ?? 16,
limiter: {
max: this.config.inboxJobPerSec ?? 16,
max: this.config.inboxJobPerSec ?? 32,
duration: 1000,
},
settings: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const meta = {
tags: ['admin'],

requireCredential: true,
requireModerator: true,
requireAdmin: true,

res: {
type: 'array',
Expand Down
10 changes: 6 additions & 4 deletions packages/backend/src/server/api/endpoints/i/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const meta = {

const muteWords = { type: 'array', items: { oneOf: [
{ type: 'array', items: { type: 'string' } },
{ type: 'string' }
{ type: 'string' },
] } } as const;

export const paramDef = {
Expand All @@ -137,7 +137,7 @@ export const paramDef = {
birthday: { ...birthdaySchema, nullable: true },
lang: { type: 'string', enum: [null, ...Object.keys(langmap)] as string[], nullable: true },
avatarId: { type: 'string', format: 'misskey:id', nullable: true },
avatarDecorations: { type: 'array', maxItems: 1, items: {
avatarDecorations: { type: 'array', maxItems: 16, items: {
type: 'object',
properties: {
id: { type: 'string', format: 'misskey:id' },
Expand Down Expand Up @@ -251,7 +251,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

function validateMuteWordRegex(mutedWords: (string[] | string)[]) {
for (const mutedWord of mutedWords) {
if (typeof mutedWord !== "string") continue;
if (typeof mutedWord !== 'string') continue;

const regexp = mutedWord.match(/^\/(.+)\/(.*)$/);
if (!regexp) throw new ApiError(meta.errors.invalidRegexp);
Expand Down Expand Up @@ -329,12 +329,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

if (ps.avatarDecorations) {
const decorations = await this.avatarDecorationService.getAll(true);
const myRoles = await this.roleService.getUserRoles(user.id);
const [myRoles, myPolicies] = await Promise.all([this.roleService.getUserRoles(user.id), this.roleService.getUserPolicies(user.id)]);
const allRoles = await this.roleService.getRoles();
const decorationIds = decorations
.filter(d => d.roleIdsThatCanBeUsedThisDecoration.filter(roleId => allRoles.some(r => r.id === roleId)).length === 0 || myRoles.some(r => d.roleIdsThatCanBeUsedThisDecoration.includes(r.id)))
.map(d => d.id);

if (ps.avatarDecorations.length > myPolicies.avatarDecorationLimit) throw new ApiError(meta.errors.restrictedByRole);

updates.avatarDecorations = ps.avatarDecorations.filter(d => decorationIds.includes(d.id)).map(d => ({
id: d.id,
angle: d.angle ?? 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export async function openAccountMenu(opts: {
text: i18n.ts.profile,
to: `/@${ $i.username }`,
avatar: $i,
}, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, {
}, { type: 'divider' }, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, {
type: 'parent' as const,
icon: 'ti ti-plus',
text: i18n.ts.addAccount,
Expand Down
Loading

0 comments on commit 825f6c1

Please sign in to comment.