Add 親切なエラーメッセージ
This commit is contained in:
		
							parent
							
								
									da346a685e
								
							
						
					
					
						commit
						10bb5fe0ea
					
				
					 1 changed files with 9 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue