2021-06-16 11:36:58 +03:00
|
|
|
const ghostVersion = require('@tryghost/version');
|
2021-06-30 16:56:57 +03:00
|
|
|
const settingsCache = require('../../../shared/settings-cache');
|
2021-05-26 18:53:52 +03:00
|
|
|
const config = require('../../../shared/config');
|
2021-05-26 14:10:19 +03:00
|
|
|
const urlUtils = require('../../../shared/url-utils');
|
2021-07-21 00:16:49 +03:00
|
|
|
const labs = require('../../../shared/labs');
|
2021-05-26 14:10:19 +03:00
|
|
|
|
|
|
|
module.exports = function getSiteProperties() {
|
|
|
|
const siteProperties = {
|
|
|
|
title: settingsCache.get('title'),
|
|
|
|
description: settingsCache.get('description'),
|
|
|
|
logo: settingsCache.get('logo'),
|
|
|
|
icon: settingsCache.get('icon'),
|
|
|
|
accent_color: settingsCache.get('accent_color'),
|
|
|
|
url: urlUtils.urlFor('home', true),
|
|
|
|
version: ghostVersion.safe
|
|
|
|
};
|
|
|
|
|
2021-07-21 00:16:49 +03:00
|
|
|
if (labs.isSet('oauthLogin') && settingsCache.get('oauth_client_id') && settingsCache.get('oauth_client_secret')) {
|
2021-05-26 14:10:19 +03:00
|
|
|
// Only set the oauth flag if oauth is enabled to avoid API changes
|
|
|
|
siteProperties.oauth = true;
|
|
|
|
}
|
|
|
|
|
2021-05-26 18:53:52 +03:00
|
|
|
if (config.get('client_sentry') && !config.get('client_sentry').disabled) {
|
|
|
|
siteProperties.sentry_dsn = config.get('client_sentry').dsn;
|
|
|
|
siteProperties.sentry_env = config.get('env');
|
|
|
|
}
|
|
|
|
|
2021-05-26 14:10:19 +03:00
|
|
|
return siteProperties;
|
|
|
|
};
|