summaryrefslogtreecommitdiff
path: root/src/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.ts')
-rw-r--r--src/config.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts
index d2916c39c4..2bbe46fb96 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -3,6 +3,7 @@
*/
import * as fs from 'fs';
+import * as URL from 'url';
import * as yaml from 'js-yaml';
import isUrl = require('is-url');
@@ -91,6 +92,14 @@ export default function load() {
if (!isUrl(config.url)) urlError(config.url);
if (!isUrl(config.secondary_url)) urlError(config.secondary_url);
+ const url = URL.parse(config.url);
+ const head = url.host.split('.')[0];
+
+ if (head != 'misskey') {
+ console.error(`プライマリドメインは、必ず「misskey」ドメインで始まっていなければなりません(現在の設定では「${head}」で始まっています)。例えば「https://misskey.xyz」「http://misskey.my.app.example.com」などが正しいプライマリURLです。`);
+ process.exit();
+ }
+
config.url = normalizeUrl(config.url);
config.secondary_url = normalizeUrl(config.secondary_url);