mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
26f56626ce
refs https://github.com/TryGhost/Team/issues/510 - When the host config was introduced it was incorrectly introduced as host_settings instead of hostSettings - All other Ghost config uses camelCase, so changing this now before it becomes a problem - Note: Also removed some rogue return awaits that don't make sense. It's not possible to hit that case, but cleaning up anyway
33 lines
1.3 KiB
JavaScript
33 lines
1.3 KiB
JavaScript
const {isPlainObject} = require('lodash');
|
|
const config = require('../../../shared/config');
|
|
const labs = require('../../services/labs');
|
|
const ghostVersion = require('../../lib/ghost-version');
|
|
|
|
module.exports = {
|
|
docName: 'config',
|
|
|
|
read: {
|
|
permissions: false,
|
|
query() {
|
|
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';
|
|
const response = {
|
|
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') || {},
|
|
enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false,
|
|
stripeDirect: config.get('stripeDirect'),
|
|
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
|
|
emailAnalytics: config.get('emailAnalytics')
|
|
};
|
|
if (billingUrl) {
|
|
response.billingUrl = billingUrl;
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
};
|