mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
7a3839fb14
no issue - The new Portal config flag allows switching on Portal conditionally with config - The dev experiment flag still works for enabling Portal - The flag currently defaults to `false` as Portal is still a beta feature and switched off by default - We expose it on the admin api config endpoint so that the Ghost-Admin client can use it to conditionally render Portal settings
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('host_settings:billing:enabled') ? config.get('host_settings: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,
|
|
portal: config.get('portal')
|
|
};
|
|
if (billingUrl) {
|
|
response.billingUrl = billingUrl;
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
};
|