mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
eb68e8d339
refs https://github.com/TryGhost/Toolbox/issues/175 - we're going to be making some changes in v5 wrt supported databases - we needed a way of detecting the difference between MySQL 5 + 8, MariaDB etc - I've created `@tryghost/database-info`, which is a small wrapper around `knex`, which returns this information - this commit: - adds the library to Ghost - initializes the DB info library upon boot - updates the Admin API /config/ endpoint and UpdateCheck to return the new string - `mysql5`, `mysql8` etc
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
const {isPlainObject} = require('lodash');
|
|
const config = require('../../../shared/config');
|
|
const labs = require('../../../shared/labs');
|
|
const databaseInfo = require('../../data/db/info');
|
|
const ghostVersion = require('@tryghost/version');
|
|
|
|
module.exports = function getConfigProperties() {
|
|
const configProperties = {
|
|
version: ghostVersion.full,
|
|
environment: config.get('env'),
|
|
database: databaseInfo.getEngine(),
|
|
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'),
|
|
tenor: config.get('tenor')
|
|
};
|
|
|
|
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';
|
|
if (billingUrl) {
|
|
configProperties.billingUrl = billingUrl;
|
|
}
|
|
|
|
return configProperties;
|
|
};
|