mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Added sentry config to frontend site settings for Portal (#13086)
no refs - adds sentry config for portal when available to integrate error handling
This commit is contained in:
parent
484387ba51
commit
acb0bd47af
@ -6,6 +6,7 @@ const ghostVersion = require('@tryghost/version');
|
||||
const settingsCache = require('../settings/cache');
|
||||
const {formattedMemberResponse} = require('./utils');
|
||||
const labsService = require('../labs');
|
||||
const config = require('../../../shared/config');
|
||||
|
||||
// @TODO: This piece of middleware actually belongs to the frontend, not to the member app
|
||||
// Need to figure a way to separate these things (e.g. frontend actually talks to members API)
|
||||
@ -124,6 +125,8 @@ const getMemberSiteData = async function (req, res) {
|
||||
supportAddress = `${supportAddress}@${blogDomain}`;
|
||||
}
|
||||
const {products = [], prices = []} = await getPortalProductPrices() || {};
|
||||
const portalVersion = config.get('portal:version');
|
||||
|
||||
const response = {
|
||||
title: settingsCache.get('title'),
|
||||
description: settingsCache.get('description'),
|
||||
@ -132,6 +135,7 @@ const getMemberSiteData = async function (req, res) {
|
||||
accent_color: settingsCache.get('accent_color'),
|
||||
url: urlUtils.urlFor('home', true),
|
||||
version: ghostVersion.safe,
|
||||
portal_version: portalVersion,
|
||||
free_price_name: settingsCache.get('members_free_price_name'),
|
||||
free_price_description: settingsCache.get('members_free_price_description'),
|
||||
allow_self_signup: membersService.config.getAllowSelfSignup(),
|
||||
@ -151,6 +155,12 @@ const getMemberSiteData = async function (req, res) {
|
||||
if (labsService.isSet('multipleProducts')) {
|
||||
response.portal_products = settingsCache.get('portal_products');
|
||||
}
|
||||
if (config.get('portal_sentry') && !config.get('portal_sentry').disabled) {
|
||||
response.portal_sentry = {
|
||||
sentry_dsn: config.get('portal_sentry').dsn,
|
||||
sentry_env: config.get('env')
|
||||
};
|
||||
}
|
||||
res.json({site: response});
|
||||
};
|
||||
|
||||
|
@ -122,6 +122,6 @@
|
||||
},
|
||||
"portal": {
|
||||
"url": "https://unpkg.com/@tryghost/portal@~1.6.0/umd/portal.min.js",
|
||||
"version": "~1.6.0"
|
||||
"version": "1.6"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user