enhance(backend): リモートサーバーのチャート生成を無効にするオプションを追加

This commit is contained in:
syuilo
2023-03-24 19:08:08 +09:00
parent 09a846a45c
commit 31f3f5f0f0
14 changed files with 87 additions and 20 deletions

View File

@@ -243,6 +243,10 @@ export const meta = {
type: 'boolean',
optional: false, nullable: false,
},
enableChartsForFederatedInstances: {
type: 'boolean',
optional: false, nullable: false,
},
policies: {
type: 'object',
optional: false, nullable: false,
@@ -341,6 +345,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
enableIpLogging: instance.enableIpLogging,
enableActiveEmailValidation: instance.enableActiveEmailValidation,
enableChartsForRemoteUser: instance.enableChartsForRemoteUser,
enableChartsForFederatedInstances: instance.enableChartsForFederatedInstances,
policies: { ...DEFAULT_POLICIES, ...instance.policies },
};
});

View File

@@ -93,6 +93,7 @@ export const paramDef = {
enableIpLogging: { type: 'boolean' },
enableActiveEmailValidation: { type: 'boolean' },
enableChartsForRemoteUser: { type: 'boolean' },
enableChartsForFederatedInstances: { type: 'boolean' },
},
required: [],
} as const;
@@ -382,6 +383,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
set.enableChartsForRemoteUser = ps.enableChartsForRemoteUser;
}
if (ps.enableChartsForFederatedInstances !== undefined) {
set.enableChartsForFederatedInstances = ps.enableChartsForFederatedInstances;
}
await this.metaService.update(set);
this.moderationLogService.insertModerationLog(me, 'updateMeta');
});