Ghost/core/server/services/public-config/site.js
Kevin Ansfield 5fe9036ecf Added sentry_dsn and sentry_env properties to /canary/site/
refs https://github.com/TryGhost/Team/issues/723

- enables Admin to report unhandled exceptions and API errors when configured
2021-05-26 16:54:04 +01:00

29 lines
1.0 KiB
JavaScript

const ghostVersion = require('../../lib/ghost-version');
const settingsCache = require('../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;
};