mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
3b366dc55d
no issue - moved `config` and `site` API output generation to a `public-config` service allowing all API versions to use `publicConfig.config` or `publicConfig.site` in their query methods - updated `config` and `site` API output serializers to use an allow-list that limits the data returned for each API version
29 lines
1.2 KiB
JavaScript
29 lines
1.2 KiB
JavaScript
const {isPlainObject} = require('lodash');
|
|
const config = require('../../../shared/config');
|
|
const labs = require('../labs');
|
|
const ghostVersion = require('../../lib/ghost-version');
|
|
|
|
module.exports = function getConfigProperties() {
|
|
const configProperties = {
|
|
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'),
|
|
hostSettings: config.get('hostSettings')
|
|
};
|
|
|
|
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';
|
|
if (billingUrl) {
|
|
configProperties.billingUrl = billingUrl;
|
|
}
|
|
|
|
return configProperties;
|
|
};
|