実行時にpackage.jsonを参照しないように (#5418)
* 実行時にpackage.jsonを参照しないように * nodeinfo * move meta.json * add dummy * lowercase
This commit is contained in:
@ -3,7 +3,6 @@ import * as os from 'os';
|
||||
import config from '../../../config';
|
||||
import define from '../define';
|
||||
import { fetchMeta } from '../../../misc/fetch-meta';
|
||||
import * as pkg from '../../../../package.json';
|
||||
import { Emojis } from '../../../models';
|
||||
import { getConnection } from 'typeorm';
|
||||
import redis from '../../../db/redis';
|
||||
@ -36,7 +35,7 @@ export const meta = {
|
||||
type: 'string' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
description: 'The version of Misskey of this instance.',
|
||||
example: pkg.version
|
||||
example: config.version
|
||||
},
|
||||
name: {
|
||||
type: 'string' as const,
|
||||
@ -114,7 +113,7 @@ export default define(meta, async (ps, me) => {
|
||||
maintainerName: instance.maintainerName,
|
||||
maintainerEmail: instance.maintainerEmail,
|
||||
|
||||
version: pkg.version,
|
||||
version: config.version,
|
||||
|
||||
name: instance.name,
|
||||
uri: config.url,
|
||||
|
@ -2,7 +2,6 @@ import * as Router from '@koa/router';
|
||||
import config from '../config';
|
||||
import { fetchMeta } from '../misc/fetch-meta';
|
||||
// import User from '../models/user';
|
||||
import { name as softwareName, version, repository } from '../../package.json';
|
||||
// import Note from '../models/note';
|
||||
|
||||
const router = new Router();
|
||||
@ -20,27 +19,7 @@ export const links = [/* (awaiting release) {
|
||||
|
||||
const nodeinfo2 = async () => {
|
||||
const [
|
||||
{
|
||||
name,
|
||||
description,
|
||||
maintainerName,
|
||||
maintainerEmail,
|
||||
langs,
|
||||
ToSUrl,
|
||||
repositoryUrl,
|
||||
feedbackUrl,
|
||||
announcements,
|
||||
disableRegistration,
|
||||
disableLocalTimeline,
|
||||
disableGlobalTimeline,
|
||||
enableRecaptcha,
|
||||
maxNoteTextLength,
|
||||
enableTwitterIntegration,
|
||||
enableGithubIntegration,
|
||||
enableDiscordIntegration,
|
||||
enableEmail,
|
||||
enableServiceWorker
|
||||
},
|
||||
meta,
|
||||
// total,
|
||||
// activeHalfyear,
|
||||
// activeMonth,
|
||||
@ -57,43 +36,43 @@ const nodeinfo2 = async () => {
|
||||
|
||||
return {
|
||||
software: {
|
||||
name: softwareName,
|
||||
version,
|
||||
repository: repository.url
|
||||
name: 'misskey',
|
||||
version: config.version,
|
||||
repository: meta.repositoryUrl,
|
||||
},
|
||||
protocols: ['activitypub'],
|
||||
services: {
|
||||
inbound: [] as string[],
|
||||
outbound: ['atom1.0', 'rss2.0']
|
||||
},
|
||||
openRegistrations: !disableRegistration,
|
||||
openRegistrations: !meta.disableRegistration,
|
||||
usage: {
|
||||
users: {} // { total, activeHalfyear, activeMonth },
|
||||
// localPosts,
|
||||
// localComments
|
||||
},
|
||||
metadata: {
|
||||
name,
|
||||
description,
|
||||
name: meta.name,
|
||||
description: meta.description,
|
||||
maintainer: {
|
||||
name: maintainerName,
|
||||
email: maintainerEmail
|
||||
name: meta.maintainerName,
|
||||
email: meta.maintainerEmail
|
||||
},
|
||||
langs,
|
||||
ToSUrl,
|
||||
repositoryUrl,
|
||||
feedbackUrl,
|
||||
announcements,
|
||||
disableRegistration,
|
||||
disableLocalTimeline,
|
||||
disableGlobalTimeline,
|
||||
enableRecaptcha,
|
||||
maxNoteTextLength,
|
||||
enableTwitterIntegration,
|
||||
enableGithubIntegration,
|
||||
enableDiscordIntegration,
|
||||
enableEmail,
|
||||
enableServiceWorker
|
||||
langs: meta.langs,
|
||||
ToSUrl: meta.ToSUrl,
|
||||
repositoryUrl: meta.repositoryUrl,
|
||||
feedbackUrl: meta.feedbackUrl,
|
||||
announcements: meta.announcements,
|
||||
disableRegistration: meta.disableRegistration,
|
||||
disableLocalTimeline: meta.disableLocalTimeline,
|
||||
disableGlobalTimeline: meta.disableGlobalTimeline,
|
||||
enableRecaptcha: meta.enableRecaptcha,
|
||||
maxNoteTextLength: meta.maxNoteTextLength,
|
||||
enableTwitterIntegration: meta.enableTwitterIntegration,
|
||||
enableGithubIntegration: meta.enableGithubIntegration,
|
||||
enableDiscordIntegration: meta.enableDiscordIntegration,
|
||||
enableEmail: meta.enableEmail,
|
||||
enableServiceWorker: meta.enableServiceWorker
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -13,7 +13,6 @@ import * as views from 'koa-views';
|
||||
import docs from './docs';
|
||||
import packFeed from './feed';
|
||||
import { fetchMeta } from '../../misc/fetch-meta';
|
||||
import * as pkg from '../../../package.json';
|
||||
import { genOpenapiSpec } from '../api/openapi/gen-spec';
|
||||
import config from '../../config';
|
||||
import { Users, Notes, Emojis, UserProfiles, Pages } from '../../models';
|
||||
@ -257,7 +256,7 @@ router.get('/info', async ctx => {
|
||||
where: { host: null }
|
||||
});
|
||||
await ctx.render('info', {
|
||||
version: pkg.version,
|
||||
version: config.version,
|
||||
machine: os.hostname(),
|
||||
os: os.platform(),
|
||||
node: process.version,
|
||||
|
Reference in New Issue
Block a user