2019-08-09 17:11:24 +03:00
|
|
|
const {isPlainObject} = require('lodash');
|
2020-05-27 20:47:53 +03:00
|
|
|
const config = require('../../../shared/config');
|
2019-08-09 17:11:24 +03:00
|
|
|
const labs = require('../../services/labs');
|
|
|
|
const ghostVersion = require('../../lib/ghost-version');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
docName: 'config',
|
|
|
|
|
|
|
|
read: {
|
|
|
|
permissions: false,
|
|
|
|
query() {
|
2020-02-26 13:22:55 +03:00
|
|
|
const billingUrl = config.get('host_settings:billing:enabled') ? config.get('host_settings:billing:url') : '';
|
|
|
|
const response = {
|
2019-08-09 17:11:24 +03:00
|
|
|
version: ghostVersion.full,
|
|
|
|
environment: config.get('env'),
|
|
|
|
database: config.get('database').client,
|
|
|
|
mail: isPlainObject(config.get('mail')) ? config.get('mail').transport : '',
|
|
|
|
useGravatar: !config.isPrivacyDisabled('useGravatar'),
|
|
|
|
labs: labs.getAll(),
|
|
|
|
clientExtensions: config.get('clientExtensions') || {},
|
2020-05-20 17:14:28 +03:00
|
|
|
enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false,
|
2020-07-02 19:11:22 +03:00
|
|
|
stripeDirect: config.get('stripeDirect'),
|
2020-12-02 16:22:12 +03:00
|
|
|
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
|
|
|
|
emailAnalytics: config.get('emailAnalytics')
|
2019-08-09 17:11:24 +03:00
|
|
|
};
|
2020-02-26 13:22:55 +03:00
|
|
|
if (billingUrl) {
|
|
|
|
response.billingUrl = billingUrl;
|
|
|
|
}
|
|
|
|
return response;
|
2019-08-09 17:11:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|