Ghost/core/server/services/public-config/site.js
Hannah Wolfe bd597db829
Moved settings/cache to shared/settings-cache
- This is part of the quest to separate the frontend and server & get rid of all the places where there are cross-requires
- At the moment the settings cache is one big shared cache used by the frontend and server liberally
- This change doesn't really solve the fundamental problems, as we still depend on events, and requires from inside frontend
- However it allows us to control the misuse slightly better by getting rid of restricted requires and turning on that eslint ruleset
2021-06-30 15:49:10 +01:00

29 lines
1.1 KiB
JavaScript

const ghostVersion = require('@tryghost/version');
const settingsCache = require('../../../shared/settings-cache');
const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
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
};
if (settingsCache.get('oauth_client_id') && settingsCache.get('oauth_client_secret')) {
// Only set the oauth flag if oauth is enabled to avoid API changes
siteProperties.oauth = true;
}
if (config.get('client_sentry') && !config.get('client_sentry').disabled) {
siteProperties.sentry_dsn = config.get('client_sentry').dsn;
siteProperties.sentry_env = config.get('env');
}
return siteProperties;
};