ghost 5.85.1 → 5.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tryghost-adapter-cache-memory-ttl-5.86.0.tgz +0 -0
- package/components/{tryghost-adapter-cache-redis-5.85.1.tgz → tryghost-adapter-cache-redis-5.86.0.tgz} +0 -0
- package/components/{tryghost-adapter-manager-5.85.1.tgz → tryghost-adapter-manager-5.86.0.tgz} +0 -0
- package/components/tryghost-announcement-bar-settings-5.86.0.tgz +0 -0
- package/components/{tryghost-api-framework-5.85.1.tgz → tryghost-api-framework-5.86.0.tgz} +0 -0
- package/components/tryghost-api-version-compatibility-service-5.86.0.tgz +0 -0
- package/components/tryghost-audience-feedback-5.86.0.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.86.0.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.86.0.tgz +0 -0
- package/components/tryghost-collections-5.86.0.tgz +0 -0
- package/components/tryghost-constants-5.86.0.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.86.0.tgz +0 -0
- package/components/tryghost-data-generator-5.86.0.tgz +0 -0
- package/components/tryghost-domain-events-5.86.0.tgz +0 -0
- package/components/tryghost-donations-5.86.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.86.0.tgz +0 -0
- package/components/tryghost-email-addresses-5.86.0.tgz +0 -0
- package/components/{tryghost-email-analytics-provider-mailgun-5.85.1.tgz → tryghost-email-analytics-provider-mailgun-5.86.0.tgz} +0 -0
- package/components/tryghost-email-analytics-service-5.86.0.tgz +0 -0
- package/components/tryghost-email-content-generator-5.86.0.tgz +0 -0
- package/components/{tryghost-email-events-5.85.1.tgz → tryghost-email-events-5.86.0.tgz} +0 -0
- package/components/tryghost-email-service-5.86.0.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.86.0.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.86.0.tgz +0 -0
- package/components/{tryghost-external-media-inliner-5.85.1.tgz → tryghost-external-media-inliner-5.86.0.tgz} +0 -0
- package/components/tryghost-extract-api-key-5.86.0.tgz +0 -0
- package/components/tryghost-ghost-5.86.0.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.86.0.tgz +0 -0
- package/components/tryghost-i18n-5.86.0.tgz +0 -0
- package/components/{tryghost-importer-handler-content-files-5.85.1.tgz → tryghost-importer-handler-content-files-5.86.0.tgz} +0 -0
- package/components/tryghost-importer-revue-5.86.0.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.86.0.tgz +0 -0
- package/components/{tryghost-job-manager-5.85.1.tgz → tryghost-job-manager-5.86.0.tgz} +0 -0
- package/components/tryghost-link-redirects-5.86.0.tgz +0 -0
- package/components/tryghost-link-replacer-5.86.0.tgz +0 -0
- package/components/tryghost-link-tracking-5.86.0.tgz +0 -0
- package/components/{tryghost-magic-link-5.85.1.tgz → tryghost-magic-link-5.86.0.tgz} +0 -0
- package/components/tryghost-mail-events-5.86.0.tgz +0 -0
- package/components/{tryghost-mailgun-client-5.85.1.tgz → tryghost-mailgun-client-5.86.0.tgz} +0 -0
- package/components/{tryghost-member-attribution-5.85.1.tgz → tryghost-member-attribution-5.86.0.tgz} +0 -0
- package/components/{tryghost-member-events-5.85.1.tgz → tryghost-member-events-5.86.0.tgz} +0 -0
- package/components/{tryghost-members-api-5.85.1.tgz → tryghost-members-api-5.86.0.tgz} +0 -0
- package/components/tryghost-members-csv-5.86.0.tgz +0 -0
- package/components/tryghost-members-events-service-5.86.0.tgz +0 -0
- package/components/tryghost-members-importer-5.86.0.tgz +0 -0
- package/components/{tryghost-members-offers-5.85.1.tgz → tryghost-members-offers-5.86.0.tgz} +0 -0
- package/components/tryghost-members-payments-5.86.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.86.0.tgz +0 -0
- package/components/{tryghost-members-stripe-service-5.85.1.tgz → tryghost-members-stripe-service-5.86.0.tgz} +0 -0
- package/components/tryghost-mentions-email-report-5.86.0.tgz +0 -0
- package/components/tryghost-milestones-5.86.0.tgz +0 -0
- package/components/{tryghost-minifier-5.85.1.tgz → tryghost-minifier-5.86.0.tgz} +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.86.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.86.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.86.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.86.0.tgz +0 -0
- package/components/{tryghost-mw-session-from-token-5.85.1.tgz → tryghost-mw-session-from-token-5.86.0.tgz} +0 -0
- package/components/{tryghost-mw-update-user-last-seen-5.85.1.tgz → tryghost-mw-update-user-last-seen-5.86.0.tgz} +0 -0
- package/components/{tryghost-mw-version-match-5.85.1.tgz → tryghost-mw-version-match-5.86.0.tgz} +0 -0
- package/components/{tryghost-mw-vhost-5.85.1.tgz → tryghost-mw-vhost-5.86.0.tgz} +0 -0
- package/components/{tryghost-nql-filter-expansions-5.85.1.tgz → tryghost-nql-filter-expansions-5.86.0.tgz} +0 -0
- package/components/tryghost-oembed-service-5.86.0.tgz +0 -0
- package/components/tryghost-package-json-5.86.0.tgz +0 -0
- package/components/tryghost-post-events-5.86.0.tgz +0 -0
- package/components/{tryghost-post-revisions-5.85.1.tgz → tryghost-post-revisions-5.86.0.tgz} +0 -0
- package/components/tryghost-posts-service-5.86.0.tgz +0 -0
- package/components/tryghost-recommendations-5.86.0.tgz +0 -0
- package/components/tryghost-referrers-5.86.0.tgz +0 -0
- package/components/{tryghost-security-5.85.1.tgz → tryghost-security-5.86.0.tgz} +0 -0
- package/components/{tryghost-session-service-5.85.1.tgz → tryghost-session-service-5.86.0.tgz} +0 -0
- package/components/tryghost-settings-path-manager-5.86.0.tgz +0 -0
- package/components/tryghost-slack-notifications-5.86.0.tgz +0 -0
- package/components/{tryghost-staff-service-5.85.1.tgz → tryghost-staff-service-5.86.0.tgz} +0 -0
- package/components/tryghost-stats-service-5.86.0.tgz +0 -0
- package/components/{tryghost-tiers-5.85.1.tgz → tryghost-tiers-5.86.0.tgz} +0 -0
- package/components/{tryghost-update-check-service-5.85.1.tgz → tryghost-update-check-service-5.86.0.tgz} +0 -0
- package/components/tryghost-verification-trigger-5.86.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.86.0.tgz +0 -0
- package/components/{tryghost-webmentions-5.85.1.tgz → tryghost-webmentions-5.86.0.tgz} +0 -0
- package/core/boot.js +7 -6
- package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +3 -6989
- package/core/built/admin/assets/admin-x-activitypub/index-8aaa062c.mjs +14980 -0
- package/core/built/admin/assets/admin-x-activitypub/modals-124e649f.mjs +521 -0
- package/core/built/admin/assets/admin-x-activitypub/styles/reader.css +1928 -0
- package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +1 -1
- package/core/built/admin/assets/admin-x-demo/{index-76afb59a.mjs → index-ea257d67.mjs} +4 -4
- package/core/built/admin/assets/admin-x-demo/{modals-e22a0556.mjs → modals-0790023d.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{CodeEditorView-bc39a650.mjs → CodeEditorView-7dd72fff.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-ab51beed.mjs → index-3b15dfb3.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-f1611931.mjs → index-8b8bf7d6.mjs} +2254 -2270
- package/core/built/admin/assets/admin-x-settings/{modals-7d0e7ce5.mjs → modals-71f5a60d.mjs} +10 -6
- package/core/built/admin/assets/{chunk.216.700faeec5043322dc8d5.js → chunk.216.1641331b33471771559d.js} +3 -3
- package/core/built/admin/assets/{chunk.524.8523297d6be9ed0dcd59.js → chunk.524.c7b0bf99001aaf59b891.js} +5 -5
- package/core/built/admin/assets/{chunk.582.b4570ab008eec8b0b437.js → chunk.582.727d60402bc9ff454dfa.js} +6 -6
- package/core/built/admin/assets/{ghost-da719d2c50388e7f72e596e1a8b99e80.css → ghost-117facae643a21dde076079b84fce471.css} +1 -1
- package/core/built/admin/assets/{ghost-648739878fcdb7a22ab135757c8e3fab.js → ghost-cc7512accd98e0fa3cc0906c52204a55.js} +120 -129
- package/core/built/admin/assets/{ghost-dark-3cbc750010886456986b77ff03283139.css → ghost-dark-031957661056b00048f03aac0618c480.css} +1 -1
- package/core/built/admin/assets/koenig-lexical/index.css +1 -1
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +8740 -8715
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +110 -108
- package/core/built/admin/index.html +5 -5
- package/core/frontend/helpers/ghost_head.js +12 -13
- package/core/frontend/web/site.js +0 -33
- package/core/server/GhostServer.js +2 -2
- package/core/server/data/db/index.js +0 -9
- package/core/server/services/members-events/index.js +3 -1
- package/core/server/web/api/endpoints/admin/app.js +1 -1
- package/core/server/web/api/middleware/upload.js +9 -5
- package/core/shared/instrumentation.js +33 -0
- package/core/shared/labs.js +2 -4
- package/package.json +165 -156
- package/yarn.lock +1354 -300
- package/components/tryghost-adapter-cache-memory-ttl-5.85.1.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.85.1.tgz +0 -0
- package/components/tryghost-api-version-compatibility-service-5.85.1.tgz +0 -0
- package/components/tryghost-audience-feedback-5.85.1.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.85.1.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.85.1.tgz +0 -0
- package/components/tryghost-collections-5.85.1.tgz +0 -0
- package/components/tryghost-constants-5.85.1.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.85.1.tgz +0 -0
- package/components/tryghost-data-generator-5.85.1.tgz +0 -0
- package/components/tryghost-domain-events-5.85.1.tgz +0 -0
- package/components/tryghost-donations-5.85.1.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.85.1.tgz +0 -0
- package/components/tryghost-email-addresses-5.85.1.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.85.1.tgz +0 -0
- package/components/tryghost-email-content-generator-5.85.1.tgz +0 -0
- package/components/tryghost-email-service-5.85.1.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.85.1.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.85.1.tgz +0 -0
- package/components/tryghost-extract-api-key-5.85.1.tgz +0 -0
- package/components/tryghost-ghost-5.85.1.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.85.1.tgz +0 -0
- package/components/tryghost-i18n-5.85.1.tgz +0 -0
- package/components/tryghost-importer-revue-5.85.1.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.85.1.tgz +0 -0
- package/components/tryghost-link-redirects-5.85.1.tgz +0 -0
- package/components/tryghost-link-replacer-5.85.1.tgz +0 -0
- package/components/tryghost-link-tracking-5.85.1.tgz +0 -0
- package/components/tryghost-mail-events-5.85.1.tgz +0 -0
- package/components/tryghost-members-csv-5.85.1.tgz +0 -0
- package/components/tryghost-members-events-service-5.85.1.tgz +0 -0
- package/components/tryghost-members-importer-5.85.1.tgz +0 -0
- package/components/tryghost-members-payments-5.85.1.tgz +0 -0
- package/components/tryghost-members-ssr-5.85.1.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.85.1.tgz +0 -0
- package/components/tryghost-milestones-5.85.1.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.85.1.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.85.1.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.85.1.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.85.1.tgz +0 -0
- package/components/tryghost-oembed-service-5.85.1.tgz +0 -0
- package/components/tryghost-package-json-5.85.1.tgz +0 -0
- package/components/tryghost-post-events-5.85.1.tgz +0 -0
- package/components/tryghost-posts-service-5.85.1.tgz +0 -0
- package/components/tryghost-recommendations-5.85.1.tgz +0 -0
- package/components/tryghost-referrers-5.85.1.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.85.1.tgz +0 -0
- package/components/tryghost-slack-notifications-5.85.1.tgz +0 -0
- package/components/tryghost-stats-service-5.85.1.tgz +0 -0
- package/components/tryghost-verification-trigger-5.85.1.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.85.1.tgz +0 -0
- /package/core/built/admin/assets/{chunk.216.700faeec5043322dc8d5.js.LICENSE.txt → chunk.216.1641331b33471771559d.js.LICENSE.txt} +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<title>Ghost Admin</title>
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
<meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22cdnUrl%22%3A%22%22%2C%22editorUrl%22%3A%22%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.
|
|
11
|
+
<meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22cdnUrl%22%3A%22%22%2C%22editorUrl%22%3A%22%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.86%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22ember-websockets%22%3A%7B%22socketIO%22%3Atrue%7D%2C%22%40sentry%2Fember%22%3A%7B%22disablePerformance%22%3Atrue%2C%22sentry%22%3A%7B%7D%7D%2C%22ember-cli-mirage%22%3A%7B%22usingProxy%22%3Afalse%2C%22useDefaultPassthroughs%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22ember-load%22%3A%7B%22loadingIndicatorClass%22%3A%22ember-load-indicator%22%7D%2C%22editorFilename%22%3A%22koenig-lexical.umd.js%22%2C%22editorHash%22%3A%2262f98e1b33%22%2C%22adminXDemoFilename%22%3A%22admin-x-demo.js%22%2C%22adminXDemoHash%22%3A%224245030234%22%2C%22adminXSettingsFilename%22%3A%22admin-x-settings.js%22%2C%22adminXSettingsHash%22%3A%226b8583f4e9%22%2C%22adminXActivitypubFilename%22%3A%22admin-x-activitypub.js%22%2C%22adminXActivitypubHash%22%3A%22f6cd11e49b%22%7D" />
|
|
12
12
|
|
|
13
13
|
<meta name="HandheldFriendly" content="True" />
|
|
14
14
|
<meta name="MobileOptimized" content="320" />
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</style>
|
|
38
38
|
|
|
39
39
|
<link integrity="" rel="stylesheet" href="assets/vendor-0ede59da8efb5e28fa929557f7ff7154.css">
|
|
40
|
-
<link integrity="" rel="stylesheet" href="assets/ghost-
|
|
40
|
+
<link integrity="" rel="stylesheet" href="assets/ghost-117facae643a21dde076079b84fce471.css" title="light">
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
</head>
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
<div id="ember-basic-dropdown-wormhole"></div>
|
|
58
58
|
|
|
59
59
|
<script src="assets/vendor-232fd88c6ffbd896b34c449112793e93.js"></script>
|
|
60
|
-
<script src="assets/chunk.216.
|
|
61
|
-
<script src="assets/chunk.524.
|
|
62
|
-
<script src="assets/ghost-
|
|
60
|
+
<script src="assets/chunk.216.1641331b33471771559d.js"></script>
|
|
61
|
+
<script src="assets/chunk.524.c7b0bf99001aaf59b891.js"></script>
|
|
62
|
+
<script src="assets/ghost-cc7512accd98e0fa3cc0906c52204a55.js"></script>
|
|
63
63
|
</body>
|
|
64
64
|
</html>
|
|
@@ -296,6 +296,18 @@ module.exports = async function ghost_head(options) { // eslint-disable-line cam
|
|
|
296
296
|
head.push(`<script defer src="${getAssetUrl('public/member-attribution.min.js')}"></script>`);
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
+
if (options.data.site.accent_color) {
|
|
300
|
+
const accentColor = escapeExpression(options.data.site.accent_color);
|
|
301
|
+
const styleTag = `<style>:root {--ghost-accent-color: ${accentColor};}</style>`;
|
|
302
|
+
const existingScriptIndex = _.findLastIndex(head, str => str.match(/<\/(style|script)>/));
|
|
303
|
+
|
|
304
|
+
if (existingScriptIndex !== -1) {
|
|
305
|
+
head[existingScriptIndex] = head[existingScriptIndex] + styleTag;
|
|
306
|
+
} else {
|
|
307
|
+
head.push(styleTag);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
299
311
|
if (!_.isEmpty(globalCodeinjection)) {
|
|
300
312
|
head.push(globalCodeinjection);
|
|
301
313
|
}
|
|
@@ -309,19 +321,6 @@ module.exports = async function ghost_head(options) { // eslint-disable-line cam
|
|
|
309
321
|
}
|
|
310
322
|
}
|
|
311
323
|
|
|
312
|
-
// AMP template has style injected directly because there can only be one <style amp-custom> tag
|
|
313
|
-
if (options.data.site.accent_color && !_.includes(context, 'amp')) {
|
|
314
|
-
const accentColor = escapeExpression(options.data.site.accent_color);
|
|
315
|
-
const styleTag = `<style>:root {--ghost-accent-color: ${accentColor};}</style>`;
|
|
316
|
-
const existingScriptIndex = _.findLastIndex(head, str => str.match(/<\/(style|script)>/));
|
|
317
|
-
|
|
318
|
-
if (existingScriptIndex !== -1) {
|
|
319
|
-
head[existingScriptIndex] = head[existingScriptIndex] + styleTag;
|
|
320
|
-
} else {
|
|
321
|
-
head.push(styleTag);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
324
|
debug('end');
|
|
326
325
|
return new SafeString(head.join('\n ').trim());
|
|
327
326
|
} catch (error) {
|
|
@@ -3,7 +3,6 @@ const path = require('path');
|
|
|
3
3
|
const express = require('../../shared/express');
|
|
4
4
|
const DomainEvents = require('@tryghost/domain-events');
|
|
5
5
|
const {MemberPageViewEvent} = require('@tryghost/member-events');
|
|
6
|
-
const GhostNestApp = require('@tryghost/ghost');
|
|
7
6
|
|
|
8
7
|
// App requires
|
|
9
8
|
const config = require('../../shared/config');
|
|
@@ -21,8 +20,6 @@ const siteRoutes = require('./routes');
|
|
|
21
20
|
const shared = require('../../server/web/shared');
|
|
22
21
|
const errorHandler = require('@tryghost/mw-error-handler');
|
|
23
22
|
const mw = require('./middleware');
|
|
24
|
-
const labs = require('../../shared/labs');
|
|
25
|
-
const bodyParser = require('body-parser');
|
|
26
23
|
|
|
27
24
|
const STATIC_IMAGE_URL_PREFIX = `/${urlUtils.STATIC_IMAGE_URL_PREFIX}`;
|
|
28
25
|
const STATIC_MEDIA_URL_PREFIX = `/${constants.STATIC_MEDIA_URL_PREFIX}`;
|
|
@@ -51,36 +48,6 @@ module.exports = function setupSiteApp(routerConfig) {
|
|
|
51
48
|
// enable CORS headers (allows admin client to hit front-end when configured on separate URLs)
|
|
52
49
|
siteApp.use(mw.cors);
|
|
53
50
|
|
|
54
|
-
const jsonParser = bodyParser.json({
|
|
55
|
-
type: ['application/activity+json', 'application/ld+json', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'],
|
|
56
|
-
// TODO: The @RawBody decorator in nest isn't working without this atm...
|
|
57
|
-
verify: function (req, res, buf) {
|
|
58
|
-
req.rawBody = buf;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
siteApp.use(async function nestBodyParser(req, res, next) {
|
|
62
|
-
if (labs.isSet('NestPlayground') || labs.isSet('ActivityPub')) {
|
|
63
|
-
jsonParser(req, res, next);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
return next();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
siteApp.use(async function nestApp(req, res, next) {
|
|
70
|
-
if (labs.isSet('NestPlayground') || labs.isSet('ActivityPub')) {
|
|
71
|
-
const originalExpressApp = req.app;
|
|
72
|
-
const app = await GhostNestApp.getApp();
|
|
73
|
-
|
|
74
|
-
const instance = app.getHttpAdapter().getInstance();
|
|
75
|
-
instance(req, res, function (err) {
|
|
76
|
-
req.app = originalExpressApp;
|
|
77
|
-
next(err);
|
|
78
|
-
});
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
return next();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
51
|
siteApp.use(offersService.middleware);
|
|
85
52
|
|
|
86
53
|
siteApp.use(linkRedirects.service.handleRequest);
|
|
@@ -127,8 +127,8 @@ class GhostServer {
|
|
|
127
127
|
|
|
128
128
|
// ensure that Ghost exits correctly on Ctrl+C and SIGTERM
|
|
129
129
|
process
|
|
130
|
-
.removeAllListeners('SIGINT').on('SIGINT', self.shutdown
|
|
131
|
-
.removeAllListeners('SIGTERM').on('SIGTERM', self.shutdown
|
|
130
|
+
.removeAllListeners('SIGINT').on('SIGINT', () => self.shutdown())
|
|
131
|
+
.removeAllListeners('SIGTERM').on('SIGTERM', () => self.shutdown());
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
const logging = require('@tryghost/logging');
|
|
2
|
-
const metrics = require('@tryghost/metrics');
|
|
3
|
-
const config = require('../../../shared/config');
|
|
4
|
-
const ConnectionPoolInstrumentation = require('./ConnectionPoolInstrumentation');
|
|
5
|
-
|
|
6
1
|
let connection;
|
|
7
2
|
|
|
8
3
|
Object.defineProperty(exports, 'knex', {
|
|
@@ -10,10 +5,6 @@ Object.defineProperty(exports, 'knex', {
|
|
|
10
5
|
configurable: true,
|
|
11
6
|
get: function get() {
|
|
12
7
|
connection = connection || require('./connection');
|
|
13
|
-
if (config.get('telemetry:connectionPool')) {
|
|
14
|
-
const instrumentation = new ConnectionPoolInstrumentation({knex: connection, logging, metrics, config});
|
|
15
|
-
instrumentation.instrument();
|
|
16
|
-
}
|
|
17
8
|
return connection;
|
|
18
9
|
}
|
|
19
10
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const labsService = require('../../../shared/labs');
|
|
2
2
|
const DomainEvents = require('@tryghost/domain-events');
|
|
3
|
+
const events = require('../../lib/common/events');
|
|
3
4
|
const settingsCache = require('../../../shared/settings-cache');
|
|
4
5
|
const members = require('../members');
|
|
5
6
|
|
|
@@ -32,7 +33,8 @@ class MembersEventsServiceWrapper {
|
|
|
32
33
|
getMembersApi() {
|
|
33
34
|
return members.api;
|
|
34
35
|
},
|
|
35
|
-
db
|
|
36
|
+
db,
|
|
37
|
+
events
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
this.eventStorage.subscribe(DomainEvents);
|
|
@@ -39,7 +39,7 @@ module.exports = function setupApiApp() {
|
|
|
39
39
|
apiApp.use(routes());
|
|
40
40
|
|
|
41
41
|
apiApp.use(async function nestApp(req, res, next) {
|
|
42
|
-
if (labs.isSet('NestPlayground')
|
|
42
|
+
if (labs.isSet('NestPlayground')) {
|
|
43
43
|
const originalExpressApp = req.app;
|
|
44
44
|
const app = await GhostNestApp.getApp();
|
|
45
45
|
|
|
@@ -152,19 +152,23 @@ const checkFileIsValid = (fileData, types, extensions) => {
|
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
156
|
-
* @param {String} filepath
|
|
155
|
+
*
|
|
156
|
+
* @param {String} filepath
|
|
157
157
|
* @returns {Boolean}
|
|
158
|
-
*
|
|
158
|
+
*
|
|
159
159
|
* Checks for the presence of <script> tags or 'on' attributes in an SVG file
|
|
160
|
-
*
|
|
160
|
+
*
|
|
161
161
|
*/
|
|
162
162
|
const isSvgSafe = (filepath) => {
|
|
163
163
|
const fileContent = fs.readFileSync(filepath, 'utf8');
|
|
164
164
|
const document = new JSDOM(fileContent).window.document;
|
|
165
165
|
document.body.innerHTML = fileContent;
|
|
166
166
|
const svgEl = document.body.firstElementChild;
|
|
167
|
-
|
|
167
|
+
|
|
168
|
+
if (!svgEl) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
|
|
168
172
|
const attributes = Array.from(svgEl.attributes).map(({name}) => name);
|
|
169
173
|
const hasScriptAttr = !!attributes.find(attr => attr.startsWith('on'));
|
|
170
174
|
const scripts = svgEl.getElementsByTagName('script');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
async function initOpenTelemetry({config}) {
|
|
2
|
+
// Always enable in development environment
|
|
3
|
+
// In production, only enable if explicitly enabled via config `opentelemetry:enabled`
|
|
4
|
+
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
5
|
+
const isConfigured = config.get('opentelemetry:enabled');
|
|
6
|
+
const enabled = isDevelopment || isConfigured;
|
|
7
|
+
if (!enabled) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const collectorOptions = {
|
|
11
|
+
url: config.get('opentelemetry:exporter:endpoint') || 'http://localhost:4318/v1/traces',
|
|
12
|
+
headers: {},
|
|
13
|
+
concurrencyLimit: 10
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Lazyloaded to avoid boot time overhead when not enabled
|
|
17
|
+
const {NodeSDK} = require('@opentelemetry/sdk-node');
|
|
18
|
+
const {OTLPTraceExporter} = require('@opentelemetry/exporter-trace-otlp-http');
|
|
19
|
+
const {getNodeAutoInstrumentations} = require('@opentelemetry/auto-instrumentations-node');
|
|
20
|
+
|
|
21
|
+
const sdk = new NodeSDK({
|
|
22
|
+
serviceName: 'ghost',
|
|
23
|
+
traceExporter: new OTLPTraceExporter(collectorOptions),
|
|
24
|
+
instrumentations: [
|
|
25
|
+
getNodeAutoInstrumentations()
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
sdk.start();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
initOpenTelemetry
|
|
33
|
+
};
|
package/core/shared/labs.js
CHANGED
|
@@ -25,8 +25,8 @@ const GA_FEATURES = [
|
|
|
25
25
|
'filterEmailDisabled',
|
|
26
26
|
'newEmailAddresses',
|
|
27
27
|
'portalImprovements',
|
|
28
|
-
'
|
|
29
|
-
'
|
|
28
|
+
'newsletterExcerpt',
|
|
29
|
+
'internalLinking'
|
|
30
30
|
];
|
|
31
31
|
|
|
32
32
|
// NOTE: this allowlist is meant to be used to filter out any unexpected
|
|
@@ -35,7 +35,6 @@ const BETA_FEATURES = [
|
|
|
35
35
|
'additionalPaymentMethods',
|
|
36
36
|
'i18n',
|
|
37
37
|
'activitypub',
|
|
38
|
-
'internalLinking',
|
|
39
38
|
'stripeAutomaticTax',
|
|
40
39
|
'webmentions',
|
|
41
40
|
'editorExcerpt'
|
|
@@ -54,7 +53,6 @@ const ALPHA_FEATURES = [
|
|
|
54
53
|
'importMemberTier',
|
|
55
54
|
'lexicalIndicators',
|
|
56
55
|
'adminXDemo',
|
|
57
|
-
'internalLinkingAtLinks',
|
|
58
56
|
'contentVisibility'
|
|
59
57
|
];
|
|
60
58
|
|