diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-11-01 22:34:26 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-11-01 22:34:26 +0900 |
| commit | 92af4401e22749e726bce69c3bd02c627e7af7e6 (patch) | |
| tree | 4b56c10a3a3a1d0d1ae5c6733a2d6d2b172446d5 /src/config | |
| parent | 11.35.0 (diff) | |
| download | misskey-92af4401e22749e726bce69c3bd02c627e7af7e6.tar.gz misskey-92af4401e22749e726bce69c3bd02c627e7af7e6.tar.bz2 misskey-92af4401e22749e726bce69c3bd02c627e7af7e6.zip | |
実行時にpackage.jsonを参照しないように (#5418)
* 実行時にpackage.jsonを参照しないように
* nodeinfo
* move meta.json
* add dummy
* lowercase
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/load.ts | 5 | ||||
| -rw-r--r-- | src/config/types.ts | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/config/load.ts b/src/config/load.ts index aeed54d74e..efebb8bd03 100644 --- a/src/config/load.ts +++ b/src/config/load.ts @@ -5,7 +5,7 @@ import * as fs from 'fs'; import * as yaml from 'js-yaml'; import { Source, Mixin } from './types'; -import * as pkg from '../../package.json'; +import * as meta from '../meta.json'; /** * Path of configuration directory @@ -30,6 +30,7 @@ export default function load() { config.port = config.port || parseInt(process.env.PORT || '', 10); + mixin.version = meta.version; mixin.host = url.host; mixin.hostname = url.hostname; mixin.scheme = url.protocol.replace(/:$/, ''); @@ -38,7 +39,7 @@ export default function load() { mixin.apiUrl = `${mixin.scheme}://${mixin.host}/api`; mixin.authUrl = `${mixin.scheme}://${mixin.host}/auth`; mixin.driveUrl = `${mixin.scheme}://${mixin.host}/files`; - mixin.userAgent = `Misskey/${pkg.version} (${config.url})`; + mixin.userAgent = `Misskey/${meta.version} (${config.url})`; if (config.autoAdmin == null) config.autoAdmin = false; diff --git a/src/config/types.ts b/src/config/types.ts index b96e727506..e766d1f14a 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -58,6 +58,7 @@ export type Source = { * Misskeyが自動的に(ユーザーが設定した情報から推論して)設定する情報 */ export type Mixin = { + version: string; host: string; hostname: string; scheme: string; |