ghost 5.96.0 → 5.96.2
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.96.2.tgz +0 -0
- package/components/{tryghost-adapter-cache-redis-5.96.0.tgz → tryghost-adapter-cache-redis-5.96.2.tgz} +0 -0
- package/components/{tryghost-adapter-manager-5.96.0.tgz → tryghost-adapter-manager-5.96.2.tgz} +0 -0
- package/components/tryghost-announcement-bar-settings-5.96.2.tgz +0 -0
- package/components/{tryghost-api-framework-5.96.0.tgz → tryghost-api-framework-5.96.2.tgz} +0 -0
- package/components/{tryghost-api-version-compatibility-service-5.96.0.tgz → tryghost-api-version-compatibility-service-5.96.2.tgz} +0 -0
- package/components/{tryghost-audience-feedback-5.96.0.tgz → tryghost-audience-feedback-5.96.2.tgz} +0 -0
- package/components/tryghost-bookshelf-repository-5.96.2.tgz +0 -0
- package/components/{tryghost-bootstrap-socket-5.96.0.tgz → tryghost-bootstrap-socket-5.96.2.tgz} +0 -0
- package/components/tryghost-collections-5.96.2.tgz +0 -0
- package/components/tryghost-constants-5.96.2.tgz +0 -0
- package/components/{tryghost-custom-theme-settings-service-5.96.0.tgz → tryghost-custom-theme-settings-service-5.96.2.tgz} +0 -0
- package/components/{tryghost-data-generator-5.96.0.tgz → tryghost-data-generator-5.96.2.tgz} +0 -0
- package/components/tryghost-domain-events-5.96.2.tgz +0 -0
- package/components/{tryghost-donations-5.96.0.tgz → tryghost-donations-5.96.2.tgz} +0 -0
- package/components/tryghost-dynamic-routing-events-5.96.2.tgz +0 -0
- package/components/tryghost-email-addresses-5.96.2.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.96.2.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.96.2.tgz +0 -0
- package/components/{tryghost-email-content-generator-5.96.0.tgz → tryghost-email-content-generator-5.96.2.tgz} +0 -0
- package/components/tryghost-email-events-5.96.2.tgz +0 -0
- package/components/tryghost-email-service-5.96.2.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.96.2.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.96.2.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.96.2.tgz +0 -0
- package/components/tryghost-extract-api-key-5.96.2.tgz +0 -0
- package/components/tryghost-ghost-5.96.2.tgz +0 -0
- package/components/{tryghost-html-to-plaintext-5.96.0.tgz → tryghost-html-to-plaintext-5.96.2.tgz} +0 -0
- package/components/tryghost-i18n-5.96.2.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.96.2.tgz +0 -0
- package/components/tryghost-importer-revue-5.96.2.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.96.2.tgz +0 -0
- package/components/{tryghost-job-manager-5.96.0.tgz → tryghost-job-manager-5.96.2.tgz} +0 -0
- package/components/tryghost-link-redirects-5.96.2.tgz +0 -0
- package/components/{tryghost-link-replacer-5.96.0.tgz → tryghost-link-replacer-5.96.2.tgz} +0 -0
- package/components/{tryghost-link-tracking-5.96.0.tgz → tryghost-link-tracking-5.96.2.tgz} +0 -0
- package/components/{tryghost-magic-link-5.96.0.tgz → tryghost-magic-link-5.96.2.tgz} +0 -0
- package/components/{tryghost-mail-events-5.96.0.tgz → tryghost-mail-events-5.96.2.tgz} +0 -0
- package/components/{tryghost-mailgun-client-5.96.0.tgz → tryghost-mailgun-client-5.96.2.tgz} +0 -0
- package/components/{tryghost-member-attribution-5.96.0.tgz → tryghost-member-attribution-5.96.2.tgz} +0 -0
- package/components/{tryghost-member-events-5.96.0.tgz → tryghost-member-events-5.96.2.tgz} +0 -0
- package/components/{tryghost-members-api-5.96.0.tgz → tryghost-members-api-5.96.2.tgz} +0 -0
- package/components/{tryghost-members-csv-5.96.0.tgz → tryghost-members-csv-5.96.2.tgz} +0 -0
- package/components/{tryghost-members-events-service-5.96.0.tgz → tryghost-members-events-service-5.96.2.tgz} +0 -0
- package/components/{tryghost-members-importer-5.96.0.tgz → tryghost-members-importer-5.96.2.tgz} +0 -0
- package/components/tryghost-members-offers-5.96.2.tgz +0 -0
- package/components/tryghost-members-payments-5.96.2.tgz +0 -0
- package/components/tryghost-members-ssr-5.96.2.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.96.2.tgz +0 -0
- package/components/{tryghost-mentions-email-report-5.96.0.tgz → tryghost-mentions-email-report-5.96.2.tgz} +0 -0
- package/components/tryghost-metrics-server-5.96.2.tgz +0 -0
- package/components/{tryghost-milestones-5.96.0.tgz → tryghost-milestones-5.96.2.tgz} +0 -0
- package/components/tryghost-minifier-5.96.2.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.96.2.tgz +0 -0
- package/components/{tryghost-mw-api-version-mismatch-5.96.0.tgz → tryghost-mw-api-version-mismatch-5.96.2.tgz} +0 -0
- package/components/tryghost-mw-cache-control-5.96.2.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.96.2.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.96.2.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.96.2.tgz +0 -0
- package/components/tryghost-mw-version-match-5.96.2.tgz +0 -0
- package/components/tryghost-mw-vhost-5.96.2.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.96.2.tgz +0 -0
- package/components/tryghost-oembed-service-5.96.2.tgz +0 -0
- package/components/{tryghost-package-json-5.96.0.tgz → tryghost-package-json-5.96.2.tgz} +0 -0
- package/components/tryghost-post-events-5.96.2.tgz +0 -0
- package/components/tryghost-post-revisions-5.96.2.tgz +0 -0
- package/components/{tryghost-posts-service-5.96.0.tgz → tryghost-posts-service-5.96.2.tgz} +0 -0
- package/components/tryghost-recommendations-5.96.2.tgz +0 -0
- package/components/tryghost-referrers-5.96.2.tgz +0 -0
- package/components/{tryghost-security-5.96.0.tgz → tryghost-security-5.96.2.tgz} +0 -0
- package/components/{tryghost-session-service-5.96.0.tgz → tryghost-session-service-5.96.2.tgz} +0 -0
- package/components/tryghost-settings-path-manager-5.96.2.tgz +0 -0
- package/components/tryghost-slack-notifications-5.96.2.tgz +0 -0
- package/components/{tryghost-staff-service-5.96.0.tgz → tryghost-staff-service-5.96.2.tgz} +0 -0
- package/components/{tryghost-stats-service-5.96.0.tgz → tryghost-stats-service-5.96.2.tgz} +0 -0
- package/components/{tryghost-tiers-5.96.0.tgz → tryghost-tiers-5.96.2.tgz} +0 -0
- package/components/tryghost-update-check-service-5.96.2.tgz +0 -0
- package/components/{tryghost-verification-trigger-5.96.0.tgz → tryghost-verification-trigger-5.96.2.tgz} +0 -0
- package/components/tryghost-version-notifications-data-service-5.96.2.tgz +0 -0
- package/components/tryghost-webmentions-5.96.2.tgz +0 -0
- package/core/bridge.js +11 -8
- package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +2 -2
- package/core/built/admin/assets/admin-x-activitypub/{index-043cbe5c.mjs → index-def21e23.mjs} +1606 -1608
- package/core/built/admin/assets/admin-x-activitypub/{modals-39d50cfc.mjs → modals-09282c4e.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{CodeEditorView-ef508830.mjs → CodeEditorView-85a3642c.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
- package/core/built/admin/assets/admin-x-settings/{index-fb425884.mjs → index-ebbd8de9.mjs} +83 -90
- package/core/built/admin/assets/admin-x-settings/{index-9a5b6317.mjs → index-eeeca6f6.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{modals-12992e35.mjs → modals-8a98634b.mjs} +11206 -16095
- package/core/built/admin/assets/{chunk.524.c8d208efb3cca58fb564.js → chunk.524.e61cf6deaaec6bf6f9d2.js} +5 -5
- package/core/built/admin/assets/{chunk.582.e1e1c593838cdd38970d.js → chunk.582.6fb536052fa03fba4adb.js} +6 -6
- package/core/built/admin/assets/{chunk.874.2b603e6adcf3c2e9788c.js → chunk.874.e1d421507701daac30fb.js} +4529 -5591
- package/core/built/admin/assets/{ghost-6720b11b60bbdb3abbd6b3b5dd314d5d.js → ghost-286f9a114755e8c3c7e9c37550f624a9.js} +21 -21
- package/core/built/admin/assets/{ghost-0c7839fc6bdbca9bf08a2c1291159903.css → ghost-c75b9d653495f9cfce528f6e10900b3f.css} +1 -1
- package/core/built/admin/assets/{ghost-dark-40f095a0e0507e24e12b4bd7dd6bb5d5.css → ghost-dark-6ea629e177f77314f5d75c0ca97190ab.css} +1 -1
- package/core/built/admin/index.html +5 -5
- package/core/frontend/helpers/get.js +24 -41
- package/core/frontend/helpers/ghost_head.js +3 -3
- package/core/frontend/meta/generate-excerpt.js +1 -2
- package/core/frontend/services/{admin-auth-assets/AdminAuthAssetsService.js → assets-minification/AdminAuthAssets.js} +22 -62
- package/core/frontend/services/assets-minification/AssetsMinificationBase.js +79 -0
- package/core/frontend/services/{card-assets/CardAssetService.js → assets-minification/CardAssets.js} +20 -37
- package/core/frontend/services/assets-minification/CommentCountsAssets.js +34 -0
- package/core/frontend/services/assets-minification/MemberAttributionAssets.js +46 -0
- package/core/frontend/services/assets-minification/index.js +16 -0
- package/core/frontend/services/sitemap/BaseSiteMapGenerator.js +4 -1
- package/core/frontend/web/site.js +5 -4
- package/core/server/api/endpoints/utils/serializers/output/mappers/index.js +0 -1
- package/core/server/api/endpoints/utils/serializers/output/oembed.js +0 -7
- package/core/server/data/importer/importers/data/PostsImporter.js +2 -2
- package/core/server/data/migrations/versions/4.0/23-regenerate-posts-html.js +1 -1
- package/core/server/data/migrations/versions/4.9/05-fix-missed-mobiledoc-url-transforms.js +1 -1
- package/core/server/data/migrations/versions/5.0/2022-05-21-00-00-regenerate-posts-html.js +1 -1
- package/core/server/lib/mobiledoc.js +4 -0
- package/core/server/models/member.js +1 -1
- package/core/server/models/mention.js +1 -1
- package/core/server/models/post.js +1 -1
- package/core/server/services/email-service/EmailServiceWrapper.js +1 -1
- package/core/server/services/oembed/service.js +1 -2
- package/core/server/services/themes/activate.js +2 -2
- package/core/server/services/themes/index.js +4 -1
- package/core/server/services/themes/validate.js +7 -5
- package/core/server/views/maintenance.html +3 -3
- package/core/server/web/admin/app.js +2 -1
- package/core/shared/config/defaults.json +3 -0
- package/core/shared/config/helpers.js +4 -1
- package/core/shared/config/utils.js +5 -6
- package/package.json +153 -153
- package/yarn.lock +129 -119
- package/components/tryghost-adapter-cache-memory-ttl-5.96.0.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.96.0.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.96.0.tgz +0 -0
- package/components/tryghost-collections-5.96.0.tgz +0 -0
- package/components/tryghost-constants-5.96.0.tgz +0 -0
- package/components/tryghost-domain-events-5.96.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.96.0.tgz +0 -0
- package/components/tryghost-email-addresses-5.96.0.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.96.0.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.96.0.tgz +0 -0
- package/components/tryghost-email-events-5.96.0.tgz +0 -0
- package/components/tryghost-email-service-5.96.0.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.96.0.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.96.0.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.96.0.tgz +0 -0
- package/components/tryghost-extract-api-key-5.96.0.tgz +0 -0
- package/components/tryghost-ghost-5.96.0.tgz +0 -0
- package/components/tryghost-i18n-5.96.0.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.96.0.tgz +0 -0
- package/components/tryghost-importer-revue-5.96.0.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.96.0.tgz +0 -0
- package/components/tryghost-link-redirects-5.96.0.tgz +0 -0
- package/components/tryghost-members-offers-5.96.0.tgz +0 -0
- package/components/tryghost-members-payments-5.96.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.96.0.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.96.0.tgz +0 -0
- package/components/tryghost-metrics-server-5.96.0.tgz +0 -0
- package/components/tryghost-minifier-5.96.0.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.96.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.96.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.96.0.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.96.0.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.96.0.tgz +0 -0
- package/components/tryghost-mw-version-match-5.96.0.tgz +0 -0
- package/components/tryghost-mw-vhost-5.96.0.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.96.0.tgz +0 -0
- package/components/tryghost-oembed-service-5.96.0.tgz +0 -0
- package/components/tryghost-post-events-5.96.0.tgz +0 -0
- package/components/tryghost-post-revisions-5.96.0.tgz +0 -0
- package/components/tryghost-recommendations-5.96.0.tgz +0 -0
- package/components/tryghost-referrers-5.96.0.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.96.0.tgz +0 -0
- package/components/tryghost-slack-notifications-5.96.0.tgz +0 -0
- package/components/tryghost-update-check-service-5.96.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.96.0.tgz +0 -0
- package/components/tryghost-webmentions-5.96.0.tgz +0 -0
- package/core/frontend/services/admin-auth-assets/index.js +0 -4
- package/core/frontend/services/card-assets/index.js +0 -4
- package/core/frontend/services/comment-counts-assets/CommentCountsAssetsService.js +0 -59
- package/core/frontend/services/comment-counts-assets/index.js +0 -4
- package/core/frontend/services/member-attribution-assets/MemberAttributionAssetsService.js +0 -83
- package/core/frontend/services/member-attribution-assets/index.js +0 -4
- package/core/server/api/endpoints/utils/serializers/output/mappers/oembed.js +0 -5
- /package/core/built/admin/assets/{chunk.874.2b603e6adcf3c2e9788c.js.LICENSE.txt → chunk.874.e1d421507701daac30fb.js.LICENSE.txt} +0 -0
|
@@ -2,7 +2,6 @@ const ghostBookshelf = require('./base');
|
|
|
2
2
|
const crypto = require('crypto');
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
const config = require('../../shared/config');
|
|
5
|
-
const {gravatar} = require('../lib/image');
|
|
6
5
|
|
|
7
6
|
const Member = ghostBookshelf.Model.extend({
|
|
8
7
|
tableName: 'members',
|
|
@@ -397,6 +396,7 @@ const Member = ghostBookshelf.Model.extend({
|
|
|
397
396
|
// Will not use gravatar if privacy.useGravatar is false in config
|
|
398
397
|
attrs.avatar_image = null;
|
|
399
398
|
if (attrs.email && !config.isPrivacyDisabled('useGravatar')) {
|
|
399
|
+
const {gravatar} = require('../lib/image');
|
|
400
400
|
attrs.avatar_image = gravatar.url(attrs.email, {size: 250, default: 'blank'});
|
|
401
401
|
}
|
|
402
402
|
|
|
@@ -742,7 +742,7 @@ Post = ghostBookshelf.Model.extend({
|
|
|
742
742
|
)
|
|
743
743
|
) {
|
|
744
744
|
try {
|
|
745
|
-
this.set('html', mobiledocLib.
|
|
745
|
+
this.set('html', mobiledocLib.render(JSON.parse(this.get('mobiledoc'))));
|
|
746
746
|
} catch (err) {
|
|
747
747
|
throw new errors.ValidationError({
|
|
748
748
|
message: tpl(messages.invalidMobiledocStructure),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const config = require('../../../shared/config');
|
|
2
|
-
const storage = require('../../adapters/storage');
|
|
3
2
|
const externalRequest = require('../../lib/request-external');
|
|
4
3
|
|
|
5
4
|
const OEmbed = require('@tryghost/oembed-service');
|
|
6
|
-
const oembed = new OEmbed({config, externalRequest
|
|
5
|
+
const oembed = new OEmbed({config, externalRequest});
|
|
7
6
|
|
|
8
7
|
const NFT = require('./NFTOEmbedProvider');
|
|
9
8
|
const nft = new NFT({
|
|
@@ -14,14 +14,14 @@ const messages = {
|
|
|
14
14
|
themeCannotBeActivated: '{themeName} cannot be activated because it was not found in the theme directory.'
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
module.exports.loadAndActivate = async (themeName) => {
|
|
17
|
+
module.exports.loadAndActivate = async (themeName, options = {}) => {
|
|
18
18
|
debug('loadAndActivate', themeName);
|
|
19
19
|
try {
|
|
20
20
|
// Just read the active theme for now
|
|
21
21
|
const loadedTheme = await themeLoader.loadOneTheme(themeName);
|
|
22
22
|
// Validate
|
|
23
23
|
// @NOTE: this is now the only usage of check, rather than checkSafe...
|
|
24
|
-
const checkedTheme = await validate.check(themeName, loadedTheme);
|
|
24
|
+
const checkedTheme = await validate.check(themeName, loadedTheme, {skipChecks: options.skipChecks});
|
|
25
25
|
|
|
26
26
|
if (!validate.canActivate(checkedTheme)) {
|
|
27
27
|
logging.error(validate.getThemeValidationError('activeThemeHasFatalErrors', themeName, checkedTheme));
|
|
@@ -5,6 +5,7 @@ const getJSON = require('./to-json');
|
|
|
5
5
|
const installer = require('./installer');
|
|
6
6
|
const validate = require('./validate');
|
|
7
7
|
const settingsCache = require('../../../shared/settings-cache');
|
|
8
|
+
const config = require('../../../shared/config');
|
|
8
9
|
|
|
9
10
|
module.exports = {
|
|
10
11
|
/*
|
|
@@ -13,8 +14,10 @@ module.exports = {
|
|
|
13
14
|
init: async () => {
|
|
14
15
|
validate.init();
|
|
15
16
|
|
|
17
|
+
const skipChecks = config.get('optimization:themes:skipBootChecks') || false;
|
|
18
|
+
|
|
16
19
|
const themeName = settingsCache.get('active_theme');
|
|
17
|
-
return activate.loadAndActivate(themeName);
|
|
20
|
+
return activate.loadAndActivate(themeName, {skipChecks});
|
|
18
21
|
},
|
|
19
22
|
/**
|
|
20
23
|
* Load all inactive themes
|
|
@@ -44,25 +44,27 @@ const getErrorsFromCheckedTheme = function getErrorsFromCheckedTheme(checkedThem
|
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const check = async function check(themeName, theme,
|
|
47
|
+
const check = async function check(themeName, theme, options = {}) {
|
|
48
48
|
debug('Begin: Check');
|
|
49
49
|
// gscan can slow down boot time if we require on boot, for now nest the require.
|
|
50
50
|
const gscan = require('gscan');
|
|
51
51
|
const checkedVersion = 'v5';
|
|
52
52
|
let checkedTheme;
|
|
53
53
|
|
|
54
|
-
if (isZip) {
|
|
54
|
+
if (options.isZip === true) {
|
|
55
55
|
debug('zip mode');
|
|
56
56
|
checkedTheme = await gscan.checkZip(theme, {
|
|
57
57
|
keepExtractedDir: true,
|
|
58
58
|
checkVersion: checkedVersion,
|
|
59
|
-
labs: labs.getAll()
|
|
59
|
+
labs: labs.getAll(),
|
|
60
|
+
skipChecks: options.skipChecks || false
|
|
60
61
|
});
|
|
61
62
|
} else {
|
|
62
63
|
debug('non-zip mode');
|
|
63
64
|
checkedTheme = await gscan.check(theme.path, {
|
|
64
65
|
checkVersion: checkedVersion,
|
|
65
|
-
labs: labs.getAll()
|
|
66
|
+
labs: labs.getAll(),
|
|
67
|
+
skipChecks: options.skipChecks || false
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -119,7 +121,7 @@ const getThemeErrors = async function getThemeErrors(themeName) {
|
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
const checkSafe = async function checkSafe(themeName, theme, isZip) {
|
|
122
|
-
const checkedTheme = await check(themeName, theme, isZip);
|
|
124
|
+
const checkedTheme = await check(themeName, theme, {isZip});
|
|
123
125
|
|
|
124
126
|
if (canActivate(checkedTheme)) {
|
|
125
127
|
return checkedTheme;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>We
|
|
7
|
+
<title>We’ll be right back</title>
|
|
8
8
|
<style type="text/css">
|
|
9
9
|
* {
|
|
10
10
|
box-sizing: border-box;
|
|
@@ -80,8 +80,8 @@ img {
|
|
|
80
80
|
</head>
|
|
81
81
|
<body>
|
|
82
82
|
<div class="content">
|
|
83
|
-
<h1>We
|
|
84
|
-
<p>We
|
|
83
|
+
<h1>We’ll be right back.</h1>
|
|
84
|
+
<p>We’re busy updating our site to give you the best experience, and will be back soon.</p>
|
|
85
85
|
</div>
|
|
86
86
|
</body>
|
|
87
87
|
</html>
|
|
@@ -9,6 +9,7 @@ const shared = require('../shared');
|
|
|
9
9
|
const errorHandler = require('@tryghost/mw-error-handler');
|
|
10
10
|
const sentry = require('../../../shared/sentry');
|
|
11
11
|
const redirectAdminUrls = require('./middleware/redirect-admin-urls');
|
|
12
|
+
const bridge = require('../../../bridge');
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
@@ -38,7 +39,7 @@ module.exports = function setupAdminApp() {
|
|
|
38
39
|
// request to the Admin API /users/me/ endpoint to check if the user is logged in.
|
|
39
40
|
//
|
|
40
41
|
// Used by comments-ui to add moderation options to front-end comments when logged in.
|
|
41
|
-
adminApp.use('/auth-frame', function authFrameMw(req, res, next) {
|
|
42
|
+
adminApp.use('/auth-frame', bridge.ensureAdminAuthAssetsMiddleware(), function authFrameMw(req, res, next) {
|
|
42
43
|
// only render content when we have an Admin session cookie,
|
|
43
44
|
// otherwise return a 204 to avoid JS and API requests being made unnecessarily
|
|
44
45
|
try {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const escapeRegExp = require('lodash/escapeRegExp');
|
|
3
2
|
const {URL} = require('url');
|
|
4
3
|
|
|
4
|
+
function escapeRegExp(string) {
|
|
5
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
6
|
+
}
|
|
7
|
+
|
|
5
8
|
const DEFAULT_HOST_ARG = /.*/;
|
|
6
9
|
|
|
7
10
|
const getHostInfo = (config) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const fs = require('fs
|
|
3
|
-
const _ = require('lodash');
|
|
2
|
+
const fs = require('fs');
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* transform all relative paths to absolute paths
|
|
@@ -11,11 +10,11 @@ const _ = require('lodash');
|
|
|
11
10
|
* Path can be a "." to re-present current folder
|
|
12
11
|
*/
|
|
13
12
|
const makePathsAbsolute = function makePathsAbsolute(nconf, obj, parent) {
|
|
14
|
-
|
|
15
|
-
if (
|
|
13
|
+
Object.entries(obj).forEach(([pathsKey, configValue]) => {
|
|
14
|
+
if (configValue && typeof configValue === 'object') {
|
|
16
15
|
makePathsAbsolute(nconf, configValue, parent + ':' + pathsKey);
|
|
17
16
|
} else if (
|
|
18
|
-
|
|
17
|
+
typeof configValue === 'string' &&
|
|
19
18
|
(configValue.match(/\/+|\\+/) || configValue === '.') &&
|
|
20
19
|
!path.isAbsolute(configValue)
|
|
21
20
|
) {
|
|
@@ -25,7 +24,7 @@ const makePathsAbsolute = function makePathsAbsolute(nconf, obj, parent) {
|
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
const doesContentPathExist = function doesContentPathExist(contentPath) {
|
|
28
|
-
if (!fs.
|
|
27
|
+
if (!fs.existsSync(contentPath)) {
|
|
29
28
|
// new Error is allowed here, as we do not want config to depend on @tryghost/error
|
|
30
29
|
// @TODO: revisit this decision when @tryghost/error is no longer dependent on all of ghost-ignition
|
|
31
30
|
// eslint-disable-next-line ghost/ghost-custom/no-native-error
|