From 10bb5fe0eabfc3c04e7884f90b18e241765f5db7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 22 Feb 2017 04:36:09 +0900 Subject: [PATCH] =?UTF-8?q?Add=20=E8=A6=AA=E5=88=87=E3=81=AA=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config.ts b/src/config.ts index d2916c39c..2bbe46fb9 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);