Resolve #3098
This commit is contained in:
parent
af4f1a7bd6
commit
1855ab60f1
9 changed files with 82 additions and 17 deletions
|
@ -45,6 +45,20 @@ export const meta = {
|
|||
'ja-JP': 'インスタンスのバナー画像URL'
|
||||
}
|
||||
},
|
||||
|
||||
name: {
|
||||
validator: $.str.optional.nullable,
|
||||
desc: {
|
||||
'ja-JP': 'インスタンス名'
|
||||
}
|
||||
},
|
||||
|
||||
description: {
|
||||
validator: $.str.optional.nullable,
|
||||
desc: {
|
||||
'ja-JP': 'インスタンスの紹介文'
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -71,6 +85,14 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
|
|||
set.bannerUrl = ps.bannerUrl;
|
||||
}
|
||||
|
||||
if (ps.name !== undefined) {
|
||||
set.name = ps.name;
|
||||
}
|
||||
|
||||
if (ps.description !== undefined) {
|
||||
set.description = ps.description;
|
||||
}
|
||||
|
||||
await Meta.update({}, {
|
||||
$set: set
|
||||
}, { upsert: true });
|
||||
|
|
|
@ -41,8 +41,8 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
|
|||
version: pkg.version,
|
||||
clientVersion: client.version,
|
||||
|
||||
name: config.name || 'Misskey',
|
||||
description: config.description,
|
||||
name: met.name || 'Misskey',
|
||||
description: met.description,
|
||||
|
||||
secure: config.https != null,
|
||||
machine: os.hostname(),
|
||||
|
|
|
@ -37,8 +37,8 @@ router.get('/v1/instance', async ctx => { // TODO: This is a temporary implement
|
|||
|
||||
ctx.body = {
|
||||
uri: config.hostname,
|
||||
title: config.name || 'Misskey',
|
||||
description: config.description || '',
|
||||
title: meta.name || 'Misskey',
|
||||
description: meta.description || '',
|
||||
email: config.maintainer.email || config.maintainer.url.startsWith('mailto:') ? config.maintainer.url.slice(7) : '',
|
||||
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