Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .config/docker_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Misskey configuration
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

# Validate this configuration before Misskey starts.
# Use "legacy" only temporarily to retain the unvalidated behavior of older versions.
# configValidation: strict

# ┌─────┐
#───┘ URL └─────────────────────────────────────────────────────

Expand Down
4 changes: 4 additions & 0 deletions .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
#
# setupPassword: example_password_please_change_this_or_you_will_get_hacked

# Validate this configuration before Misskey starts.
# Use "legacy" only temporarily to retain the unvalidated behavior of older versions.
# configValidation: strict

# ┌─────┐
#───┘ URL └─────────────────────────────────────────────────────

Expand Down
2 changes: 0 additions & 2 deletions .github/misskey/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ redis:
host: 127.0.0.1
port: 56312
id: aidx

proxyRemoteFiles: true
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
## Unreleased

### Note

- configファイルはデフォルトで設定値の検証が行われるようになりました。ソフトウェア更新に際して `pnpm --filter backend validate-config` を実行し、報告された問題を修正してください。
- `signToActivityPubGet`、`proxyRemoteFiles`、`disallowExternalApRedirect` がconfigファイルに残っている場合は削除してください。これらの設定はコントロールパネルへ移動済みです。
- 問題をすぐに修正できない場合は、configファイルに `configValidation: legacy` を指定すると、警告を出しつつ従来どおり検証せずに起動できます。

### General
-

### Client
-

### Server
-

- Enhance: configファイルの読み込み時の設定値検証と検証コマンドを追加

## 2026.7.0

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"private": true,
"scripts": {
"compile-config": "cd packages/backend && pnpm compile-config",
"validate-config": "cd packages/backend && pnpm validate-config",
"build-pre": "node scripts/build-pre.mjs",
"build-assets": "node ./scripts/build-assets.mjs",
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default [
languageOptions: {
parserOptions: {
parser: tsParser,
project: ['./tsconfig.json', './test/tsconfig.json', './test-federation/tsconfig.json'],
project: ['./tsconfig.json', './scripts/tsconfig.json', './test/tsconfig.json', './test-federation/tsconfig.json'],
sourceType: 'module',
tsconfigRootDir: import.meta.dirname,
},
Expand Down
7 changes: 5 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
"cli": "pnpm compile-config && node ./built/cli.js",
"check:connect": "pnpm compile-config && node ./scripts/check_connect.js",
"compile-config": "node ./scripts/compile_config.js",
"validate-config": "pnpm compile-config && tsx ./scripts/validate_config.ts",
"build": "rolldown -c",
"build:unit": "rolldown -c --sourcemap",
"build:e2e": "rolldown -c --e2e",
"build:tsc": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
"watch": "pnpm compile-config && node ./scripts/watch.mjs",
"restart": "pnpm build && pnpm start",
"dev": "pnpm compile-config && rolldown -c --watch",
"typecheck": "tsc --noEmit && tsc -p test --noEmit && tsc -p test-federation --noEmit",
"eslint": "eslint --quiet \"{src,test-federation}/**/*.ts\"",
"typecheck": "tsc --noEmit && tsc -p scripts --noEmit && tsc -p test --noEmit && tsc -p test-federation --noEmit",
"eslint": "eslint --quiet \"{src,scripts,test-federation}/**/*.ts\"",
"lint": "pnpm typecheck && pnpm eslint",
"test": "pnpm build:unit && cross-env NODE_ENV=test pnpm compile-config && vitest --config vitest.config.unit.ts",
"test:e2e": "pnpm build:e2e && cross-env NODE_ENV=test pnpm compile-config && vitest --config vitest.config.e2e.ts",
Expand Down Expand Up @@ -138,8 +139,10 @@
"tinycolor2": "1.6.0",
"tmp": "0.2.7",
"tsc-alias": "1.9.0",
"tsx": "4.23.1",
"typeorm": "1.1.0",
"ulid": "3.0.2",
"valibot": "1.4.2",
"vary": "1.1.2",
"web-push": "3.6.7",
"ws": "8.21.0",
Expand Down
10 changes: 10 additions & 0 deletions packages/backend/scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"rootDir": ".."
},
"include": [
"./validate_config.ts"
]
}
14 changes: 14 additions & 0 deletions packages/backend/scripts/validate_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { loadConfig } from '../src/config.js';

try {
loadConfig({ forceConfigValidation: true });
console.log('Configuration is valid ✓');
} catch (error) {
console.error(error instanceof Error ? error.message : 'Configuration validation failed');
process.exitCode = 1;
}
11 changes: 10 additions & 1 deletion packages/backend/src/boot/master.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,20 @@ function showNodejsVersion(): void {
/** 設定を読み込み、成功時に後続のログ出力形式を適用します。 */
function loadConfigBoot(): Config {
const configLogger = bootLogger.createSubLogger('config');
const configWarnings: string[] = [];
let config;

try {
config = loadConfig();
config = loadConfig({
onWarning: warning => configWarnings.push(warning),
});
configureLogging(config.logging);
for (const warning of configWarnings) {
configLogger.warn({
message: warning,
eventName: 'config.validation.disabled',
});
}
} catch (exception) {
if (typeof exception === 'string') {
configLogger.error(exception);
Expand Down
Loading
Loading