mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-15 07:53:08 +02:00
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
/**
|
|
* Module dependencies
|
|
*/
|
|
import * as os from 'os';
|
|
import config from '../../../config';
|
|
import Meta from '../../../models/meta';
|
|
import { ILocalUser } from '../../../models/user';
|
|
|
|
const pkg = require('../../../../package.json');
|
|
const client = require('../../../../built/client/meta.json');
|
|
|
|
/**
|
|
* Show core info
|
|
*/
|
|
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
|
const meta: any = (await Meta.findOne()) || {};
|
|
|
|
res({
|
|
maintainer: config.maintainer,
|
|
|
|
version: pkg.version,
|
|
clientVersion: client.version,
|
|
|
|
name: config.name || 'Misskey',
|
|
description: config.description,
|
|
|
|
secure: config.https != null,
|
|
machine: os.hostname(),
|
|
os: os.platform(),
|
|
node: process.version,
|
|
cpu: {
|
|
model: os.cpus()[0].model,
|
|
cores: os.cpus().length
|
|
},
|
|
broadcasts: meta.broadcasts,
|
|
disableRegistration: meta.disableRegistration,
|
|
disableLocalTimeline: meta.disableLocalTimeline,
|
|
driveCapacityPerLocalUserMb: config.localDriveCapacityMb,
|
|
recaptchaSitekey: config.recaptcha ? config.recaptcha.site_key : null,
|
|
swPublickey: config.sw ? config.sw.public_key : null,
|
|
hidedTags: (me && me.isAdmin) ? meta.hidedTags : undefined
|
|
});
|
|
});
|