2021-05-26 14:10:19 +03:00
|
|
|
const {isPlainObject} = require('lodash');
|
|
|
|
const config = require('../../../shared/config');
|
2021-07-07 23:41:34 +03:00
|
|
|
const labs = require('../../../shared/labs');
|
2022-01-18 12:10:31 +03:00
|
|
|
const databaseInfo = require('../../data/db/info');
|
2021-06-16 11:36:58 +03:00
|
|
|
const ghostVersion = require('@tryghost/version');
|
2021-05-26 14:10:19 +03:00
|
|
|
|
|
|
|
module.exports = function getConfigProperties() {
|
|
|
|
const configProperties = {
|
|
|
|
version: ghostVersion.full,
|
|
|
|
environment: config.get('env'),
|
2022-01-18 12:10:31 +03:00
|
|
|
database: databaseInfo.getEngine(),
|
2021-05-26 14:10:19 +03:00
|
|
|
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'),
|
2022-01-17 21:06:52 +03:00
|
|
|
mailgunIsConfigured: !!(config.get('bulkEmail') && config.get('bulkEmail').mailgun),
|
2021-05-26 14:10:19 +03:00
|
|
|
emailAnalytics: config.get('emailAnalytics'),
|
2021-11-11 21:07:19 +03:00
|
|
|
hostSettings: config.get('hostSettings'),
|
2021-11-16 20:42:19 +03:00
|
|
|
tenor: config.get('tenor')
|
2021-05-26 14:10:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';
|
|
|
|
if (billingUrl) {
|
|
|
|
configProperties.billingUrl = billingUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
return configProperties;
|
|
|
|
};
|