1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 07:25:49 +02:00

enhance: いくつかの設定ファイルの項目をコントロールパネルで設定するように (#16026)

* wip

* Update CHANGELOG.md

* feat: migrate to existing config value (#16030)

* wip

* Update CHANGELOG.md

---------

Co-authored-by: anatawa12 <anatawa12@icloud.com>
This commit is contained in:
syuilo
2025-05-12 16:55:01 +09:00
committed by GitHub
parent 51b5d740f6
commit 26506677c2
20 changed files with 193 additions and 98 deletions

View File

@@ -3,6 +3,29 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { path as configYamlPath } from '../../built/config.js';
import * as yaml from 'js-yaml';
import fs from "node:fs";
export function isConcurrentIndexMigrationEnabled() {
return process.env.MISSKEY_MIGRATION_CREATE_INDEX_CONCURRENTLY === '1';
}
let loadedConfigCache = undefined;
function loadConfigInternal() {
const config = yaml.load(fs.readFileSync(configYamlPath, 'utf-8'));
return {
disallowExternalApRedirect: Boolean(config.disallowExternalApRedirect ?? false),
proxyRemoteFiles: Boolean(config.proxyRemoteFiles ?? false),
signToActivityPubGet: Boolean(config.signToActivityPubGet ?? true),
}
}
export function loadConfig() {
if (loadedConfigCache === undefined) {
loadedConfigCache = loadConfigInternal();
}
return loadedConfigCache;
}