メンテナ情報をDBに保存するように
This commit is contained in:
		
							parent
							
								
									2de48110bb
								
							
						
					
					
						commit
						06b66f0209
					
				
					 15 changed files with 77 additions and 33 deletions
				
			
		| 
						 | 
				
			
			@ -114,7 +114,21 @@ export const meta = {
 | 
			
		|||
		proxyAccount: {
 | 
			
		||||
			validator: $.str.optional.nullable,
 | 
			
		||||
			desc: {
 | 
			
		||||
				'ja-JP': 'Proxy account username'
 | 
			
		||||
				'ja-JP': 'プロキシアカウントのユーザー名'
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		maintainerName: {
 | 
			
		||||
			validator: $.str.optional,
 | 
			
		||||
			desc: {
 | 
			
		||||
				'ja-JP': 'インスタンスの管理者名'
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		maintainerEmail: {
 | 
			
		||||
			validator: $.str.optional.nullable,
 | 
			
		||||
			desc: {
 | 
			
		||||
				'ja-JP': 'インスタンス管理者の連絡先メールアドレス'
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -183,6 +197,14 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
 | 
			
		|||
		set.proxyAccount = ps.proxyAccount;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (ps.maintainerName !== undefined) {
 | 
			
		||||
		set['maintainer.name'] = ps.maintainerName;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (ps.maintainerEmail !== undefined) {
 | 
			
		||||
		set['maintainer.email'] = ps.maintainerEmail;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	await Meta.update({}, {
 | 
			
		||||
		$set: set
 | 
			
		||||
	}, { upsert: true });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
 | 
			
		|||
	});
 | 
			
		||||
 | 
			
		||||
	const response: any = {
 | 
			
		||||
		maintainer: config.maintainer,
 | 
			
		||||
		maintainer: instance.maintainer,
 | 
			
		||||
 | 
			
		||||
		version: pkg.version,
 | 
			
		||||
		clientVersion: client.version,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,7 +48,7 @@ router.get('/v1/instance', async ctx => { // TODO: This is a temporary implement
 | 
			
		|||
		uri: config.hostname,
 | 
			
		||||
		title: meta.name || 'Misskey',
 | 
			
		||||
		description: meta.description || '',
 | 
			
		||||
		email: config.maintainer.email || config.maintainer.url.startsWith('mailto:') ? config.maintainer.url.slice(7) : '',
 | 
			
		||||
		email: meta.maintainer.email,
 | 
			
		||||
		version: `0.0.0:compatible:misskey:${pkg.version}`, // TODO: How to tell about that this is an api for compatibility?
 | 
			
		||||
		thumbnail: meta.bannerUrl,
 | 
			
		||||
		/*
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue