ghost 4.27.1 → 4.30.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/content/themes/casper/assets/built/screen.css +1 -1
- package/content/themes/casper/assets/built/screen.css.map +1 -1
- package/content/themes/casper/assets/css/screen.css +1 -17
- package/content/themes/casper/package.json +1 -1
- package/content/themes/casper/partials/post-card.hbs +1 -1
- package/core/boot.js +3 -5
- package/core/built/assets/{ghost-dark-ae67fe157509b6e82c607ba560fc52e9.css → ghost-dark-1594d07a0716e0253a78234c8e42d765.css} +1 -1
- package/core/built/assets/{ghost.min-2d534cce15c43c646814b26f4beefb78.js → ghost.min-884660873d56fcc3d2a3b9fe94c9f022.js} +79 -79
- package/core/built/assets/{ghost.min-b1e58e098721e467388682a85a7c187d.css → ghost.min-c21fea11c3f431994a8ee7c47a8ed145.css} +1 -1
- package/core/built/assets/icons/audio-file.svg +5 -0
- package/core/built/assets/icons/file-download.svg +1 -0
- package/core/built/assets/icons/file-upload.svg +1 -0
- package/core/built/assets/icons/film-camera.svg +4 -0
- package/core/built/assets/icons/mute.svg +3 -0
- package/core/built/assets/icons/pause.svg +4 -0
- package/core/built/assets/icons/play.svg +3 -0
- package/core/built/assets/icons/unmute.svg +3 -0
- package/core/built/assets/{vendor.min-e433aa7d5620e7837f30e170cd43f84e.js → vendor.min-a2fd1e62ce6da8911fee8e812d8c6ceb.js} +240 -128
- package/core/frontend/apps/amp/lib/views/amp.hbs +94 -2
- package/core/frontend/services/theme-engine/i18n/i18n.js +11 -12
- package/core/frontend/services/theme-engine/i18n/index.js +1 -2
- package/core/frontend/services/theme-engine/i18n/theme-i18n.js +5 -4
- package/core/frontend/src/cards/css/audio.css +95 -30
- package/core/frontend/src/cards/css/before-after.css +47 -0
- package/core/frontend/src/cards/css/bookmark.css +6 -5
- package/core/frontend/src/cards/css/button.css +8 -7
- package/core/frontend/src/cards/css/callout.css +4 -4
- package/core/frontend/src/cards/css/file.css +126 -0
- package/core/frontend/src/cards/css/nft.css +9 -13
- package/core/frontend/src/cards/css/product.css +81 -52
- package/core/frontend/src/cards/css/toggle.css +31 -22
- package/core/frontend/src/cards/css/video.css +340 -0
- package/core/frontend/src/cards/js/audio.js +127 -128
- package/core/frontend/src/cards/js/before-after.js +41 -0
- package/core/frontend/src/cards/js/gallery.js +10 -8
- package/core/frontend/src/cards/js/toggle.js +16 -14
- package/core/frontend/src/cards/js/video.js +232 -0
- package/core/frontend/web/middleware/error-handler.js +2 -2
- package/core/frontend/web/site.js +2 -1
- package/core/server/api/canary/oembed.js +1 -2
- package/core/server/data/db/state-manager.js +5 -8
- package/core/server/lib/image/cached-image-size-from-url.js +3 -4
- package/core/server/lib/image/image-utils.js +2 -2
- package/core/server/lib/image/index.js +1 -2
- package/core/server/run-update-check.js +1 -13
- package/core/server/services/email-analytics/index.js +2 -4
- package/core/server/services/email-analytics/jobs/fetch-latest.js +2 -21
- package/core/server/services/integrations/integrations-service.js +2 -2
- package/core/server/services/invites/index.js +0 -2
- package/core/server/services/invites/invites.js +3 -3
- package/core/server/services/jobs/job-service.js +1 -1
- package/core/server/services/mega/post-email-serializer.js +3 -1
- package/core/server/services/mega/template.js +15 -11
- package/core/server/services/members/api.js +0 -1
- package/core/server/services/members/config.js +4 -7
- package/core/server/services/members/service.js +1 -4
- package/core/server/services/notifications/index.js +0 -2
- package/core/server/services/notifications/notifications.js +4 -5
- package/core/server/services/stripe/index.js +0 -2
- package/core/server/services/twitter-embed.js +2 -1
- package/core/server/web/admin/app.js +4 -2
- package/core/server/web/admin/views/default-prod.html +4 -4
- package/core/server/web/admin/views/default.html +4 -4
- package/core/server/web/api/app.js +3 -2
- package/core/server/web/api/canary/admin/app.js +4 -2
- package/core/server/web/api/canary/content/app.js +4 -2
- package/core/server/web/api/v2/admin/app.js +4 -2
- package/core/server/web/api/v2/content/app.js +4 -2
- package/core/server/web/api/v3/admin/app.js +4 -2
- package/core/server/web/api/v3/content/app.js +4 -2
- package/core/server/web/members/app.js +6 -4
- package/core/server/web/shared/middleware/index.js +0 -4
- package/core/shared/labs.js +9 -8
- package/package.json +28 -23
- package/yarn.lock +2589 -1988
- package/core/server/web/shared/middleware/error-handler.js +0 -224
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const errors = require('@tryghost/errors');
|
|
2
|
+
const logging = require('@tryghost/logging');
|
|
2
3
|
const tpl = require('@tryghost/tpl');
|
|
3
4
|
const {URL} = require('url');
|
|
4
5
|
const crypto = require('crypto');
|
|
@@ -15,15 +16,11 @@ class MembersConfigProvider {
|
|
|
15
16
|
* @param {{get: (key: string) => any}} options.settingsCache
|
|
16
17
|
* @param {{get: (key: string) => any}} options.config
|
|
17
18
|
* @param {any} options.urlUtils
|
|
18
|
-
* @param {any} options.logging
|
|
19
|
-
* @param {{original: string}} options.ghostVersion
|
|
20
19
|
*/
|
|
21
20
|
constructor(options) {
|
|
22
21
|
this._settingsCache = options.settingsCache;
|
|
23
22
|
this._config = options.config;
|
|
24
23
|
this._urlUtils = options.urlUtils;
|
|
25
|
-
this._logging = options.logging;
|
|
26
|
-
this._ghostVersion = options.ghostVersion;
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
/**
|
|
@@ -193,12 +190,12 @@ class MembersConfigProvider {
|
|
|
193
190
|
getAuthSecret() {
|
|
194
191
|
const hexSecret = this._settingsCache.get('members_email_auth_secret');
|
|
195
192
|
if (!hexSecret) {
|
|
196
|
-
|
|
193
|
+
logging.warn('Could not find members_email_auth_secret, using dynamically generated secret');
|
|
197
194
|
return crypto.randomBytes(64);
|
|
198
195
|
}
|
|
199
196
|
const secret = Buffer.from(hexSecret, 'hex');
|
|
200
197
|
if (secret.length < 64) {
|
|
201
|
-
|
|
198
|
+
logging.warn('members_email_auth_secret not large enough (64 bytes), using dynamically generated secret');
|
|
202
199
|
return crypto.randomBytes(64);
|
|
203
200
|
}
|
|
204
201
|
return secret;
|
|
@@ -236,7 +233,7 @@ class MembersConfigProvider {
|
|
|
236
233
|
let publicKey = this._settingsCache.get('members_public_key');
|
|
237
234
|
|
|
238
235
|
if (!privateKey || !publicKey) {
|
|
239
|
-
|
|
236
|
+
logging.warn('Could not find members_private_key, using dynamically generated keypair');
|
|
240
237
|
const keypair = createKeypair({bits: 1024});
|
|
241
238
|
privateKey = keypair.private;
|
|
242
239
|
publicKey = keypair.public;
|
|
@@ -13,7 +13,6 @@ const labsService = require('../../../shared/labs');
|
|
|
13
13
|
const settingsCache = require('../../../shared/settings-cache');
|
|
14
14
|
const config = require('../../../shared/config');
|
|
15
15
|
const models = require('../../models');
|
|
16
|
-
const ghostVersion = require('@tryghost/version');
|
|
17
16
|
const _ = require('lodash');
|
|
18
17
|
const {GhostMailer} = require('../mail');
|
|
19
18
|
const jobsService = require('../jobs');
|
|
@@ -35,9 +34,7 @@ const ghostMailer = new GhostMailer();
|
|
|
35
34
|
const membersConfig = new MembersConfigProvider({
|
|
36
35
|
config,
|
|
37
36
|
settingsCache,
|
|
38
|
-
urlUtils
|
|
39
|
-
logging,
|
|
40
|
-
ghostVersion
|
|
37
|
+
urlUtils
|
|
41
38
|
});
|
|
42
39
|
|
|
43
40
|
let membersApi;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
const settingsCache = require('../../../shared/settings-cache');
|
|
2
|
-
const ghostVersion = require('@tryghost/version');
|
|
3
2
|
const Notifications = require('./notifications');
|
|
4
3
|
const models = require('../../models');
|
|
5
4
|
|
|
6
5
|
module.exports.notifications = new Notifications({
|
|
7
6
|
settingsCache,
|
|
8
|
-
ghostVersion: ghostVersion.full,
|
|
9
7
|
SettingsModel: models.Settings
|
|
10
8
|
});
|
|
@@ -3,6 +3,7 @@ const semver = require('semver');
|
|
|
3
3
|
const Promise = require('bluebird');
|
|
4
4
|
const _ = require('lodash');
|
|
5
5
|
const errors = require('@tryghost/errors');
|
|
6
|
+
const ghostVersion = require('@tryghost/version');
|
|
6
7
|
const tpl = require('@tryghost/tpl');
|
|
7
8
|
const ObjectId = require('bson-objectid');
|
|
8
9
|
|
|
@@ -16,12 +17,10 @@ class Notifications {
|
|
|
16
17
|
*
|
|
17
18
|
* @param {Object} options
|
|
18
19
|
* @param {Object} options.settingsCache - settings cache instance
|
|
19
|
-
* @param {String} options.ghostVersion - Ghost instance version in "full" format - major.minor.patch
|
|
20
20
|
* @param {Object} options.SettingsModel - Ghost's Setting model instance
|
|
21
21
|
*/
|
|
22
|
-
constructor({settingsCache,
|
|
22
|
+
constructor({settingsCache, SettingsModel}) {
|
|
23
23
|
this.settingsCache = settingsCache;
|
|
24
|
-
this.ghostVersion = ghostVersion;
|
|
25
24
|
this.SettingsModel = SettingsModel;
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -74,7 +73,7 @@ class Notifications {
|
|
|
74
73
|
browse({user}) {
|
|
75
74
|
let allNotifications = this.fetchAllNotifications();
|
|
76
75
|
allNotifications = _.orderBy(allNotifications, 'addedAt', 'desc');
|
|
77
|
-
const blogVersion =
|
|
76
|
+
const blogVersion = ghostVersion.full.match(/^(\d+\.)(\d+\.)(\d+)/);
|
|
78
77
|
|
|
79
78
|
allNotifications = allNotifications.filter((notification) => {
|
|
80
79
|
if (notification.createdAtVersion && !this.wasSeen(notification, user)) {
|
|
@@ -128,7 +127,7 @@ class Notifications {
|
|
|
128
127
|
location: 'bottom',
|
|
129
128
|
status: 'alert',
|
|
130
129
|
id: ObjectId().toHexString(),
|
|
131
|
-
createdAtVersion:
|
|
130
|
+
createdAtVersion: ghostVersion.full
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
const overrides = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const _ = require('lodash');
|
|
2
|
-
const logging = require('@tryghost/logging');
|
|
3
2
|
const StripeAPIService = require('@tryghost/members-stripe-service');
|
|
4
3
|
|
|
5
4
|
const config = require('../../../shared/config');
|
|
@@ -9,7 +8,6 @@ const events = require('../../lib/common/events');
|
|
|
9
8
|
const {getConfig} = require('./config');
|
|
10
9
|
|
|
11
10
|
const api = new StripeAPIService({
|
|
12
|
-
logger: logging,
|
|
13
11
|
config: {}
|
|
14
12
|
});
|
|
15
13
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const {extract} = require('oembed-parser');
|
|
2
|
+
const logging = require('@tryghost/logging');
|
|
2
3
|
const labs = require('../../shared/labs');
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -69,7 +70,7 @@ class TwitterOEmbedProvider {
|
|
|
69
70
|
oembedData.tweet_data = body.data;
|
|
70
71
|
oembedData.tweet_data.includes = body.includes;
|
|
71
72
|
} catch (err) {
|
|
72
|
-
|
|
73
|
+
logging.error(err);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -5,6 +5,8 @@ const config = require('../../../shared/config');
|
|
|
5
5
|
const constants = require('@tryghost/constants');
|
|
6
6
|
const urlUtils = require('../../../shared/url-utils');
|
|
7
7
|
const shared = require('../shared');
|
|
8
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
9
|
+
const sentry = require('../../../shared/sentry');
|
|
8
10
|
const redirectAdminUrls = require('./middleware/redirect-admin-urls');
|
|
9
11
|
|
|
10
12
|
module.exports = function setupAdminApp() {
|
|
@@ -44,8 +46,8 @@ module.exports = function setupAdminApp() {
|
|
|
44
46
|
// Finally, routing
|
|
45
47
|
adminApp.get('*', require('./controller'));
|
|
46
48
|
|
|
47
|
-
adminApp.use(
|
|
48
|
-
adminApp.use(
|
|
49
|
+
adminApp.use(errorHandler.pageNotFound);
|
|
50
|
+
adminApp.use(errorHandler.handleHTMLResponse(sentry));
|
|
49
51
|
|
|
50
52
|
debug('Admin setup end');
|
|
51
53
|
|
|
@@ -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%22rootURL%22%3A%22%2F%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%224.
|
|
11
|
+
<meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%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%224.30%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22moment%22%3A%7B%22includeTimezone%22%3A%22all%22%7D%2C%22emberKeyboard%22%3A%7B%22disableInputsInitializer%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%7D" />
|
|
12
12
|
|
|
13
13
|
<meta name="HandheldFriendly" content="True" />
|
|
14
14
|
<meta name="MobileOptimized" content="320" />
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
<link rel="stylesheet" href="assets/vendor.min-987af30228885bce50f05c4723fe6f53.css">
|
|
44
|
-
<link rel="stylesheet" href="assets/ghost.min-
|
|
44
|
+
<link rel="stylesheet" href="assets/ghost.min-c21fea11c3f431994a8ee7c47a8ed145.css" title="light">
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
<div id="ember-basic-dropdown-wormhole"></div>
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
<script src="assets/vendor.min-
|
|
63
|
-
<script src="assets/ghost.min-
|
|
62
|
+
<script src="assets/vendor.min-a2fd1e62ce6da8911fee8e812d8c6ceb.js"></script>
|
|
63
|
+
<script src="assets/ghost.min-884660873d56fcc3d2a3b9fe94c9f022.js"></script>
|
|
64
64
|
|
|
65
65
|
</body>
|
|
66
66
|
</html>
|
|
@@ -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%22rootURL%22%3A%22%2F%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%224.
|
|
11
|
+
<meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%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%224.30%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22moment%22%3A%7B%22includeTimezone%22%3A%22all%22%7D%2C%22emberKeyboard%22%3A%7B%22disableInputsInitializer%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%7D" />
|
|
12
12
|
|
|
13
13
|
<meta name="HandheldFriendly" content="True" />
|
|
14
14
|
<meta name="MobileOptimized" content="320" />
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
<link rel="stylesheet" href="assets/vendor.min-987af30228885bce50f05c4723fe6f53.css">
|
|
44
|
-
<link rel="stylesheet" href="assets/ghost.min-
|
|
44
|
+
<link rel="stylesheet" href="assets/ghost.min-c21fea11c3f431994a8ee7c47a8ed145.css" title="light">
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
<div id="ember-basic-dropdown-wormhole"></div>
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
<script src="assets/vendor.min-
|
|
63
|
-
<script src="assets/ghost.min-
|
|
62
|
+
<script src="assets/vendor.min-a2fd1e62ce6da8911fee8e812d8c6ceb.js"></script>
|
|
63
|
+
<script src="assets/ghost.min-884660873d56fcc3d2a3b9fe94c9f022.js"></script>
|
|
64
64
|
|
|
65
65
|
</body>
|
|
66
66
|
</html>
|
|
@@ -2,7 +2,8 @@ const debug = require('@tryghost/debug')('web:api:default:app');
|
|
|
2
2
|
const config = require('../../../shared/config');
|
|
3
3
|
const express = require('../../../shared/express');
|
|
4
4
|
const urlUtils = require('../../../shared/url-utils');
|
|
5
|
-
const
|
|
5
|
+
const sentry = require('../../../shared/sentry');
|
|
6
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
6
7
|
|
|
7
8
|
module.exports = function setupApiApp() {
|
|
8
9
|
debug('Parent API setup start');
|
|
@@ -26,7 +27,7 @@ module.exports = function setupApiApp() {
|
|
|
26
27
|
|
|
27
28
|
// Error handling for requests to non-existent API versions
|
|
28
29
|
apiApp.use(errorHandler.resourceNotFound);
|
|
29
|
-
apiApp.use(errorHandler.handleJSONResponse);
|
|
30
|
+
apiApp.use(errorHandler.handleJSONResponse(sentry));
|
|
30
31
|
|
|
31
32
|
debug('Parent API setup end');
|
|
32
33
|
return apiApp;
|
|
@@ -4,6 +4,8 @@ const express = require('../../../../../shared/express');
|
|
|
4
4
|
const bodyParser = require('body-parser');
|
|
5
5
|
const shared = require('../../../shared');
|
|
6
6
|
const apiMw = require('../../middleware');
|
|
7
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
8
|
+
const sentry = require('../../../../../shared/sentry');
|
|
7
9
|
const routes = require('./routes');
|
|
8
10
|
|
|
9
11
|
module.exports = function setupApiApp() {
|
|
@@ -30,8 +32,8 @@ module.exports = function setupApiApp() {
|
|
|
30
32
|
apiApp.use(routes());
|
|
31
33
|
|
|
32
34
|
// API error handling
|
|
33
|
-
apiApp.use(
|
|
34
|
-
apiApp.use(
|
|
35
|
+
apiApp.use(errorHandler.resourceNotFound);
|
|
36
|
+
apiApp.use(errorHandler.handleJSONResponseV2(sentry));
|
|
35
37
|
|
|
36
38
|
debug('Admin API canary setup end');
|
|
37
39
|
|
|
@@ -2,8 +2,10 @@ const debug = require('@tryghost/debug')('web:api:canary:content:app');
|
|
|
2
2
|
const boolParser = require('express-query-boolean');
|
|
3
3
|
const bodyParser = require('body-parser');
|
|
4
4
|
const express = require('../../../../../shared/express');
|
|
5
|
+
const sentry = require('../../../../../shared/sentry');
|
|
5
6
|
const shared = require('../../../shared');
|
|
6
7
|
const routes = require('./routes');
|
|
8
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
7
9
|
|
|
8
10
|
module.exports = function setupApiApp() {
|
|
9
11
|
debug('Content API canary setup start');
|
|
@@ -24,8 +26,8 @@ module.exports = function setupApiApp() {
|
|
|
24
26
|
apiApp.use(routes());
|
|
25
27
|
|
|
26
28
|
// API error handling
|
|
27
|
-
apiApp.use(
|
|
28
|
-
apiApp.use(
|
|
29
|
+
apiApp.use(errorHandler.resourceNotFound);
|
|
30
|
+
apiApp.use(errorHandler.handleJSONResponse(sentry));
|
|
29
31
|
|
|
30
32
|
debug('Content API canary setup end');
|
|
31
33
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
const debug = require('@tryghost/debug')('web:v2:admin:app');
|
|
2
2
|
const boolParser = require('express-query-boolean');
|
|
3
3
|
const express = require('../../../../../shared/express');
|
|
4
|
+
const sentry = require('../../../../../shared/sentry');
|
|
4
5
|
const bodyParser = require('body-parser');
|
|
5
6
|
const shared = require('../../../shared');
|
|
6
7
|
const apiMw = require('../../middleware');
|
|
7
8
|
const routes = require('./routes');
|
|
9
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
8
10
|
|
|
9
11
|
module.exports = function setupApiApp() {
|
|
10
12
|
debug('Admin API v2 setup start');
|
|
@@ -30,8 +32,8 @@ module.exports = function setupApiApp() {
|
|
|
30
32
|
apiApp.use(routes());
|
|
31
33
|
|
|
32
34
|
// API error handling
|
|
33
|
-
apiApp.use(
|
|
34
|
-
apiApp.use(
|
|
35
|
+
apiApp.use(errorHandler.resourceNotFound);
|
|
36
|
+
apiApp.use(errorHandler.handleJSONResponseV2(sentry));
|
|
35
37
|
|
|
36
38
|
debug('Admin API v2 setup end');
|
|
37
39
|
|
|
@@ -2,8 +2,10 @@ const debug = require('@tryghost/debug')('web:api:v2:content:app');
|
|
|
2
2
|
const boolParser = require('express-query-boolean');
|
|
3
3
|
const bodyParser = require('body-parser');
|
|
4
4
|
const express = require('../../../../../shared/express');
|
|
5
|
+
const sentry = require('../../../../../shared/sentry');
|
|
5
6
|
const shared = require('../../../shared');
|
|
6
7
|
const routes = require('./routes');
|
|
8
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
7
9
|
|
|
8
10
|
module.exports = function setupApiApp() {
|
|
9
11
|
debug('Content API v2 setup start');
|
|
@@ -24,8 +26,8 @@ module.exports = function setupApiApp() {
|
|
|
24
26
|
apiApp.use(routes());
|
|
25
27
|
|
|
26
28
|
// API error handling
|
|
27
|
-
apiApp.use(
|
|
28
|
-
apiApp.use(
|
|
29
|
+
apiApp.use(errorHandler.resourceNotFound);
|
|
30
|
+
apiApp.use(errorHandler.handleJSONResponse(sentry));
|
|
29
31
|
|
|
30
32
|
debug('Content API v2 setup end');
|
|
31
33
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
const debug = require('@tryghost/debug')('web:v3:admin:app');
|
|
2
2
|
const boolParser = require('express-query-boolean');
|
|
3
3
|
const express = require('../../../../../shared/express');
|
|
4
|
+
const sentry = require('../../../../../shared/sentry');
|
|
4
5
|
const bodyParser = require('body-parser');
|
|
5
6
|
const shared = require('../../../shared');
|
|
6
7
|
const apiMw = require('../../middleware');
|
|
7
8
|
const routes = require('./routes');
|
|
9
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
8
10
|
|
|
9
11
|
module.exports = function setupApiApp() {
|
|
10
12
|
debug('Admin API v3 setup start');
|
|
@@ -30,8 +32,8 @@ module.exports = function setupApiApp() {
|
|
|
30
32
|
apiApp.use(routes());
|
|
31
33
|
|
|
32
34
|
// API error handling
|
|
33
|
-
apiApp.use(
|
|
34
|
-
apiApp.use(
|
|
35
|
+
apiApp.use(errorHandler.resourceNotFound);
|
|
36
|
+
apiApp.use(errorHandler.handleJSONResponseV2(sentry));
|
|
35
37
|
|
|
36
38
|
debug('Admin API v3 setup end');
|
|
37
39
|
|
|
@@ -2,8 +2,10 @@ const debug = require('@tryghost/debug')('web:api:v3:content:app');
|
|
|
2
2
|
const boolParser = require('express-query-boolean');
|
|
3
3
|
const bodyParser = require('body-parser');
|
|
4
4
|
const express = require('../../../../../shared/express');
|
|
5
|
+
const sentry = require('../../../../../shared/sentry');
|
|
5
6
|
const shared = require('../../../shared');
|
|
6
7
|
const routes = require('./routes');
|
|
8
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
7
9
|
|
|
8
10
|
module.exports = function setupApiApp() {
|
|
9
11
|
debug('Content API v3 setup start');
|
|
@@ -24,8 +26,8 @@ module.exports = function setupApiApp() {
|
|
|
24
26
|
apiApp.use(routes());
|
|
25
27
|
|
|
26
28
|
// API error handling
|
|
27
|
-
apiApp.use(
|
|
28
|
-
apiApp.use(
|
|
29
|
+
apiApp.use(errorHandler.resourceNotFound);
|
|
30
|
+
apiApp.use(errorHandler.handleJSONResponse(sentry));
|
|
29
31
|
|
|
30
32
|
debug('Content API v3 setup end');
|
|
31
33
|
|
|
@@ -4,10 +4,12 @@ const cors = require('cors');
|
|
|
4
4
|
const bodyParser = require('body-parser');
|
|
5
5
|
const express = require('../../../shared/express');
|
|
6
6
|
const urlUtils = require('../../../shared/url-utils');
|
|
7
|
+
const sentry = require('../../../shared/sentry');
|
|
7
8
|
const membersService = require('../../services/members');
|
|
8
9
|
const middleware = membersService.middleware;
|
|
9
10
|
const shared = require('../shared');
|
|
10
11
|
const labs = require('../../../shared/labs');
|
|
12
|
+
const errorHandler = require('@tryghost/mw-error-handler');
|
|
11
13
|
|
|
12
14
|
module.exports = function setupMembersApp() {
|
|
13
15
|
debug('Members App setup start');
|
|
@@ -46,12 +48,12 @@ module.exports = function setupMembersApp() {
|
|
|
46
48
|
membersApp.post('/api/events', labs.enabledMiddleware('membersActivity'), middleware.loadMemberSession, (req, res, next) => membersService.api.middleware.createEvents(req, res, next));
|
|
47
49
|
|
|
48
50
|
// API error handling
|
|
49
|
-
membersApp.use('/api',
|
|
50
|
-
membersApp.use('/api',
|
|
51
|
+
membersApp.use('/api', errorHandler.resourceNotFound);
|
|
52
|
+
membersApp.use('/api', errorHandler.handleJSONResponseV2(sentry));
|
|
51
53
|
|
|
52
54
|
// Webhook error handling
|
|
53
|
-
membersApp.use('/webhooks',
|
|
54
|
-
membersApp.use('/webhooks',
|
|
55
|
+
membersApp.use('/webhooks', errorHandler.resourceNotFound);
|
|
56
|
+
membersApp.use('/webhooks', errorHandler.handleJSONResponseV2(sentry));
|
|
55
57
|
|
|
56
58
|
debug('Members App setup end');
|
|
57
59
|
|
package/core/shared/labs.js
CHANGED
|
@@ -18,8 +18,14 @@ const GA_FEATURES = [
|
|
|
18
18
|
'customThemeSettings',
|
|
19
19
|
'nftCard',
|
|
20
20
|
'calloutCard',
|
|
21
|
+
'videoCard',
|
|
21
22
|
'accordionCard',
|
|
22
|
-
'
|
|
23
|
+
'productCard',
|
|
24
|
+
'richTwitterNewsletters',
|
|
25
|
+
'audioCard',
|
|
26
|
+
'mediaAPI',
|
|
27
|
+
'membersAutoLogin',
|
|
28
|
+
'filesAPI'
|
|
23
29
|
];
|
|
24
30
|
|
|
25
31
|
// NOTE: this allowlist is meant to be used to filter out any unexpected
|
|
@@ -34,15 +40,10 @@ const ALPHA_FEATURES = [
|
|
|
34
40
|
'membersActivity',
|
|
35
41
|
'cardSettingsPanel',
|
|
36
42
|
'urlCache',
|
|
37
|
-
'mediaAPI',
|
|
38
|
-
'filesAPI',
|
|
39
|
-
'membersAutoLogin',
|
|
40
43
|
'fileCard',
|
|
41
|
-
'audioCard',
|
|
42
|
-
'videoCard',
|
|
43
|
-
'productCard',
|
|
44
44
|
'beforeAfterCard',
|
|
45
|
-
'tweetGridCard'
|
|
45
|
+
'tweetGridCard',
|
|
46
|
+
'headerCard'
|
|
46
47
|
];
|
|
47
48
|
|
|
48
49
|
module.exports.GA_KEYS = [...GA_FEATURES];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ghost",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.30.0",
|
|
4
4
|
"description": "The professional publishing platform",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"homepage": "https://ghost.org",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test:unit": "c8 --reporter text-summary --reporter cobertura mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/unit' --timeout=2000",
|
|
33
33
|
"test:integration": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/integration' --timeout=5000",
|
|
34
34
|
"test:e2e": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/e2e-api' './test/e2e-frontend' './test/e2e-server' --timeout=10000",
|
|
35
|
-
"test:regression": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000",
|
|
35
|
+
"test:regression": "mocha --require=./test/utils/overrides.js --require=./test/utils/snapshots.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000",
|
|
36
36
|
"test:unit:slow": "yarn test:unit --reporter=mocha-slow-test-reporter",
|
|
37
37
|
"test:int:slow": "yarn test:integration --reporter=mocha-slow-test-reporter",
|
|
38
38
|
"test:e2e:slow": "yarn test:e2e --reporter=mocha-slow-test-reporter",
|
|
@@ -54,51 +54,52 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@nexes/nql": "0.6.0",
|
|
57
|
-
"@sentry/node": "6.16.
|
|
58
|
-
"@tryghost/adapter-manager": "0.2.
|
|
57
|
+
"@sentry/node": "6.16.1",
|
|
58
|
+
"@tryghost/adapter-manager": "0.2.25",
|
|
59
59
|
"@tryghost/admin-api-schema": "2.6.1",
|
|
60
60
|
"@tryghost/bookshelf-plugins": "0.3.5",
|
|
61
|
-
"@tryghost/bootstrap-socket": "0.2.
|
|
61
|
+
"@tryghost/bootstrap-socket": "0.2.15",
|
|
62
62
|
"@tryghost/color-utils": "0.1.5",
|
|
63
63
|
"@tryghost/config-url-helpers": "0.1.3",
|
|
64
64
|
"@tryghost/constants": "1.0.0",
|
|
65
65
|
"@tryghost/custom-theme-settings-service": "0.3.1",
|
|
66
66
|
"@tryghost/debug": "0.1.9",
|
|
67
|
-
"@tryghost/email-analytics-provider-mailgun": "1.0.
|
|
67
|
+
"@tryghost/email-analytics-provider-mailgun": "1.0.7",
|
|
68
68
|
"@tryghost/email-analytics-service": "1.0.5",
|
|
69
|
-
"@tryghost/errors": "1.0
|
|
69
|
+
"@tryghost/errors": "1.2.0",
|
|
70
70
|
"@tryghost/express-dynamic-redirects": "0.2.2",
|
|
71
71
|
"@tryghost/helpers": "1.1.54",
|
|
72
|
-
"@tryghost/image-transform": "1.0.
|
|
73
|
-
"@tryghost/job-manager": "0.8.
|
|
72
|
+
"@tryghost/image-transform": "1.0.25",
|
|
73
|
+
"@tryghost/job-manager": "0.8.17",
|
|
74
74
|
"@tryghost/kg-card-factory": "3.1.0",
|
|
75
75
|
"@tryghost/kg-default-atoms": "3.1.0",
|
|
76
|
-
"@tryghost/kg-default-cards": "5.
|
|
76
|
+
"@tryghost/kg-default-cards": "5.14.7",
|
|
77
77
|
"@tryghost/kg-markdown-html-renderer": "5.1.0",
|
|
78
78
|
"@tryghost/kg-mobiledoc-html-renderer": "5.3.1",
|
|
79
|
-
"@tryghost/limit-service": "1.0.
|
|
80
|
-
"@tryghost/logging": "
|
|
79
|
+
"@tryghost/limit-service": "1.0.7",
|
|
80
|
+
"@tryghost/logging": "2.0.0",
|
|
81
81
|
"@tryghost/magic-link": "1.0.14",
|
|
82
|
-
"@tryghost/members-api": "2.8.
|
|
82
|
+
"@tryghost/members-api": "2.8.6",
|
|
83
83
|
"@tryghost/members-csv": "1.2.0",
|
|
84
84
|
"@tryghost/members-importer": "0.3.5",
|
|
85
85
|
"@tryghost/members-offers": "0.10.3",
|
|
86
86
|
"@tryghost/members-ssr": "1.0.16",
|
|
87
87
|
"@tryghost/metrics": "1.0.1",
|
|
88
|
-
"@tryghost/minifier": "0.1.
|
|
88
|
+
"@tryghost/minifier": "0.1.8",
|
|
89
|
+
"@tryghost/mw-error-handler": "0.1.1",
|
|
89
90
|
"@tryghost/mw-session-from-token": "0.1.26",
|
|
90
91
|
"@tryghost/nodemailer": "0.3.8",
|
|
91
|
-
"@tryghost/package-json": "1.0.
|
|
92
|
+
"@tryghost/package-json": "1.0.13",
|
|
92
93
|
"@tryghost/promise": "0.1.13",
|
|
93
94
|
"@tryghost/request": "0.1.10",
|
|
94
95
|
"@tryghost/root-utils": "0.3.7",
|
|
95
96
|
"@tryghost/security": "0.2.13",
|
|
96
|
-
"@tryghost/session-service": "0.1.
|
|
97
|
+
"@tryghost/session-service": "0.1.35",
|
|
97
98
|
"@tryghost/settings-path-manager": "0.1.2",
|
|
98
99
|
"@tryghost/social-urls": "0.1.27",
|
|
99
100
|
"@tryghost/string": "0.1.21",
|
|
100
101
|
"@tryghost/tpl": "0.1.8",
|
|
101
|
-
"@tryghost/update-check-service": "0.
|
|
102
|
+
"@tryghost/update-check-service": "0.3.0",
|
|
102
103
|
"@tryghost/url-utils": "2.0.4",
|
|
103
104
|
"@tryghost/validator": "0.1.9",
|
|
104
105
|
"@tryghost/version": "0.1.7",
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
"amperize": "0.6.1",
|
|
108
109
|
"analytics-node": "6.0.0",
|
|
109
110
|
"bluebird": "3.7.2",
|
|
110
|
-
"body-parser": "1.19.
|
|
111
|
+
"body-parser": "1.19.1",
|
|
111
112
|
"bookshelf": "1.2.0",
|
|
112
113
|
"bookshelf-relations": "2.3.0",
|
|
113
114
|
"brute-knex": "4.0.1",
|
|
@@ -130,7 +131,7 @@
|
|
|
130
131
|
"ghost-storage-base": "1.0.0",
|
|
131
132
|
"glob": "7.2.0",
|
|
132
133
|
"got": "9.6.0",
|
|
133
|
-
"gscan": "4.
|
|
134
|
+
"gscan": "4.19.0",
|
|
134
135
|
"html-to-text": "5.1.1",
|
|
135
136
|
"image-size": "1.0.0",
|
|
136
137
|
"intl": "1.2.5",
|
|
@@ -143,7 +144,7 @@
|
|
|
143
144
|
"knex": "0.21.21",
|
|
144
145
|
"knex-migrator": "4.1.3",
|
|
145
146
|
"lodash": "4.17.21",
|
|
146
|
-
"luxon": "2.
|
|
147
|
+
"luxon": "2.2.0",
|
|
147
148
|
"mailgun-js": "0.22.0",
|
|
148
149
|
"metascraper": "5.25.5",
|
|
149
150
|
"metascraper-author": "5.25.5",
|
|
@@ -166,7 +167,7 @@
|
|
|
166
167
|
"path-match": "1.2.4",
|
|
167
168
|
"probe-image-size": "5.0.0",
|
|
168
169
|
"rss": "1.2.2",
|
|
169
|
-
"sanitize-html": "2.6.
|
|
170
|
+
"sanitize-html": "2.6.1",
|
|
170
171
|
"semver": "7.3.5",
|
|
171
172
|
"stoppable": "1.1.0",
|
|
172
173
|
"tough-cookie": "4.0.0",
|
|
@@ -174,16 +175,19 @@
|
|
|
174
175
|
"xml": "1.0.1"
|
|
175
176
|
},
|
|
176
177
|
"optionalDependencies": {
|
|
177
|
-
"@tryghost/html-to-mobiledoc": "1.5.
|
|
178
|
+
"@tryghost/html-to-mobiledoc": "1.5.2",
|
|
178
179
|
"sqlite3": "5.0.2"
|
|
179
180
|
},
|
|
180
181
|
"devDependencies": {
|
|
182
|
+
"@ethanresnick/chai-jest-snapshot": "3.0.0",
|
|
181
183
|
"@lodder/grunt-postcss": "3.1.1",
|
|
182
184
|
"c8": "7.10.0",
|
|
185
|
+
"chai": "4.3.4",
|
|
183
186
|
"coffeescript": "2.6.1",
|
|
184
187
|
"cssnano": "5.0.12",
|
|
185
188
|
"eslint": "7.32.0",
|
|
186
189
|
"eslint-plugin-ghost": "2.11.0",
|
|
190
|
+
"expect": "27.4.2",
|
|
187
191
|
"grunt": "1.4.1",
|
|
188
192
|
"grunt-bg-shell": "2.3.3",
|
|
189
193
|
"grunt-contrib-clean": "2.0.0",
|
|
@@ -201,7 +205,7 @@
|
|
|
201
205
|
"mock-knex": "0.4.10",
|
|
202
206
|
"nock": "13.2.1",
|
|
203
207
|
"papaparse": "5.3.1",
|
|
204
|
-
"postcss": "8.4.
|
|
208
|
+
"postcss": "8.4.5",
|
|
205
209
|
"rewire": "5.0.0",
|
|
206
210
|
"should": "13.2.3",
|
|
207
211
|
"sinon": "11.1.2",
|
|
@@ -209,6 +213,7 @@
|
|
|
209
213
|
"tmp": "0.2.1"
|
|
210
214
|
},
|
|
211
215
|
"resolutions": {
|
|
216
|
+
"@tryghost/logging": "2.0.0",
|
|
212
217
|
"moment": "2.24.0",
|
|
213
218
|
"moment-timezone": "0.5.23"
|
|
214
219
|
}
|