This commit is contained in:
syuilo 2025-05-05 14:24:42 +09:00
parent 4bd94005a5
commit 6051b46266
8 changed files with 48 additions and 0 deletions

8
locales/index.d.ts vendored
View File

@ -6384,6 +6384,14 @@ export interface Locale extends ILocale {
* semver 使>= 2024.3.1 2024.3.1-custom.0 >= 2024.3.1-0 prerelease
*/
"deliverSuspendedSoftwareDescription": string;
/**
*
*/
"singleUserMode": string;
/**
*
*/
"singleUserMode_description": string;
};
"_accountMigration": {
/**

View File

@ -1622,6 +1622,8 @@ _serverSettings:
thisSettingWillAutomaticallyOffWhenModeratorsInactive: "一定期間モデレーターのアクティビティが検出されなかった場合、スパム防止のためこの設定は自動でオフになります。"
deliverSuspendedSoftware: "配信停止中のソフトウェア"
deliverSuspendedSoftwareDescription: "脆弱性などの理由で、サーバーのソフトウェアの名前及びバージョンの範囲を指定して配信を停止できます。このバージョン情報はサーバーが提供したものであり、信頼性は保証されません。バージョン指定には semver の範囲指定が使用できますが、>= 2024.3.1 と指定すると 2024.3.1-custom.0 のようなカスタムバージョンが含まれないため、>= 2024.3.1-0 のように prerelease の指定を行うことを推奨します。"
singleUserMode: "お一人様モード"
singleUserMode_description: "このサーバーを利用するのが自分だけの場合、このモードを有効にすることで動作が最適化されます。"
_accountMigration:
moveFrom: "別のアカウントからこのアカウントに移行"

View File

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class SingleUserMode1746422049376 {
name = 'SingleUserMode1746422049376'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "singleUserMode" boolean NOT NULL DEFAULT false`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "singleUserMode"`);
}
}

View File

@ -669,6 +669,11 @@ export class MiMeta {
default: [],
})
public deliverSuspendedSoftware: SoftwareSuspension[];
@Column('boolean', {
default: false,
})
public singleUserMode: boolean;
}
export type SoftwareSuspension = {

View File

@ -546,6 +546,10 @@ export const meta = {
},
},
},
singleUserMode: {
type: 'boolean',
optional: false, nullable: false,
},
},
},
} as const;
@ -691,6 +695,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
federation: instance.federation,
federationHosts: instance.federationHosts,
deliverSuspendedSoftware: instance.deliverSuspendedSoftware,
singleUserMode: instance.singleUserMode,
};
});
}

View File

@ -196,6 +196,7 @@ export const paramDef = {
required: ['software', 'versionRange'],
},
},
singleUserMode: { type: 'boolean' },
},
required: [],
} as const;
@ -690,6 +691,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.federationHosts = ps.federationHosts.filter(Boolean).map(x => x.toLowerCase());
}
if (ps.singleUserMode !== undefined) {
set.singleUserMode = ps.singleUserMode;
}
const before = await this.metaService.fetch(true);
await this.metaService.update(set);

View File

@ -89,6 +89,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #icon><i class="ti ti-adjustments-alt"></i></template>
<div class="_gaps_s">
<div>
<div><b>{{ i18n.ts._serverSettings.singleUserMode }}:</b></div>
<div>{{ serverSettings.singleUserMode ? i18n.ts.yes : i18n.ts.no }}</div>
</div>
<div>
<div><b>{{ i18n.ts._serverSettings.openRegistration }}:</b></div>
<div>{{ !serverSettings.disableRegistration ? i18n.ts.yes : i18n.ts.no }}</div>
@ -207,6 +211,7 @@ const serverSettings = computed<Misskey.entities.AdminUpdateMetaRequest>(() => {
}
return {
singleUserMode: q_use.value === 'single',
disableRegistration: q_use.value !== 'open',
emailRequiredForSignup: q_use.value === 'open',
enableIpLogging: q_use.value === 'open',

View File

@ -8769,6 +8769,7 @@ export type operations = {
software: string;
versionRange: string;
}[];
singleUserMode: boolean;
};
};
};
@ -11439,6 +11440,7 @@ export type operations = {
software: string;
versionRange: string;
}[];
singleUserMode?: boolean;
};
};
};