ghost 4.28.0 → 4.31.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 +70 -41
- package/content/themes/casper/package.json +1 -1
- package/core/boot.js +3 -5
- package/core/built/assets/ghost-dark-60b50b44689a4c79fd9e72356f94a844.css +1 -0
- package/core/built/assets/{ghost.min-0d8c819c49453b69b8fcf64d15f7e8b8.js → ghost.min-7690e7e32d3e53ec5480a234962341a6.js} +66 -66
- package/core/built/assets/ghost.min-e628c133ed6b5ec32a1cc3511c2b2978.css +1 -0
- package/core/built/assets/icons/file-upload.svg +1 -1
- package/core/built/assets/{vendor.min-530b041ef90eed6eaabd7c24e1e8a266.js → vendor.min-f4bc3ac0c7d33722341d0da4291aa888.js} +144 -90
- package/core/frontend/apps/amp/lib/views/amp.hbs +136 -7
- 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 +13 -9
- package/core/frontend/src/cards/css/before-after.css +45 -11
- package/core/frontend/src/cards/css/bookmark.css +6 -5
- package/core/frontend/src/cards/css/button.css +4 -3
- package/core/frontend/src/cards/css/callout.css +10 -5
- package/core/frontend/src/cards/css/file.css +107 -48
- package/core/frontend/src/cards/css/header.css +167 -0
- package/core/frontend/src/cards/css/nft.css +1 -7
- package/core/frontend/src/cards/css/product.css +24 -26
- package/core/frontend/src/cards/css/toggle.css +32 -22
- package/core/frontend/src/cards/css/video.css +103 -44
- package/core/frontend/src/cards/js/before-after.js +10 -15
- package/core/frontend/src/cards/js/video.js +81 -13
- 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/template.js +110 -0
- 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/config/overrides.json +11 -1
- package/core/shared/labs.js +7 -7
- package/package.json +20 -19
- package/yarn.lock +118 -102
- package/core/built/assets/ghost-dark-cd630208f909760b8e6e4ec13579b323.css +0 -1
- package/core/built/assets/ghost.min-4a510859440fff66c8c7b8cbdc157237.css +0 -1
- package/core/server/web/shared/middleware/error-handler.js +0 -224
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const config = require('../../../shared/config');
|
|
2
|
-
const logging = require('@tryghost/logging');
|
|
3
2
|
const db = require('../../data/db');
|
|
4
3
|
const settings = require('../../../shared/settings-cache');
|
|
5
4
|
const {EmailAnalyticsService} = require('@tryghost/email-analytics-service');
|
|
@@ -9,11 +8,10 @@ const queries = require('./lib/queries');
|
|
|
9
8
|
|
|
10
9
|
module.exports = new EmailAnalyticsService({
|
|
11
10
|
config,
|
|
12
|
-
logging,
|
|
13
11
|
settings,
|
|
14
|
-
eventProcessor: new EventProcessor({db
|
|
12
|
+
eventProcessor: new EventProcessor({db}),
|
|
15
13
|
providers: [
|
|
16
|
-
new MailgunProvider({config, settings
|
|
14
|
+
new MailgunProvider({config, settings})
|
|
17
15
|
],
|
|
18
16
|
queries
|
|
19
17
|
});
|
|
@@ -28,24 +28,6 @@ if (parentPort) {
|
|
|
28
28
|
const config = require('../../../../shared/config');
|
|
29
29
|
const db = require('../../../data/db');
|
|
30
30
|
|
|
31
|
-
const logging = {
|
|
32
|
-
info(message) {
|
|
33
|
-
if (parentPort) {
|
|
34
|
-
parentPort.postMessage(message);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
warn(message) {
|
|
38
|
-
if (parentPort) {
|
|
39
|
-
parentPort.postMessage(message);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
error(message) {
|
|
43
|
-
if (parentPort) {
|
|
44
|
-
parentPort.postMessage(message);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
31
|
const settingsRows = await db.knex('settings')
|
|
50
32
|
.whereIn('key', ['mailgun_api_key', 'mailgun_domain', 'mailgun_base_url']);
|
|
51
33
|
|
|
@@ -69,10 +51,9 @@ if (parentPort) {
|
|
|
69
51
|
const emailAnalyticsService = new EmailAnalyticsService({
|
|
70
52
|
config,
|
|
71
53
|
settings,
|
|
72
|
-
|
|
73
|
-
eventProcessor: new EventProcessor({db, logging}),
|
|
54
|
+
eventProcessor: new EventProcessor({db}),
|
|
74
55
|
providers: [
|
|
75
|
-
new MailgunProvider({config, settings
|
|
56
|
+
new MailgunProvider({config, settings})
|
|
76
57
|
],
|
|
77
58
|
queries
|
|
78
59
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {NotFoundError,
|
|
1
|
+
const {NotFoundError, InternalServerError} = require('@tryghost/errors');
|
|
2
2
|
const tpl = require('@tryghost/tpl');
|
|
3
3
|
|
|
4
4
|
const messages = {
|
|
@@ -29,7 +29,7 @@ class IntegrationsService {
|
|
|
29
29
|
withRelated: ['api_keys', 'webhooks']
|
|
30
30
|
});
|
|
31
31
|
} catch (err) {
|
|
32
|
-
throw new
|
|
32
|
+
throw new InternalServerError({
|
|
33
33
|
err: err
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
const settingsCache = require('../../../shared/settings-cache');
|
|
2
2
|
const mailService = require('../../services/mail');
|
|
3
|
-
const logging = require('@tryghost/logging');
|
|
4
3
|
const urlUtils = require('../../../shared/url-utils');
|
|
5
4
|
const Invites = require('./invites');
|
|
6
5
|
|
|
7
6
|
module.exports = new Invites({
|
|
8
7
|
settingsCache,
|
|
9
|
-
logging,
|
|
10
8
|
mailService,
|
|
11
9
|
urlUtils
|
|
12
10
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const security = require('@tryghost/security');
|
|
2
2
|
const tpl = require('@tryghost/tpl');
|
|
3
|
+
const logging = require('@tryghost/logging');
|
|
3
4
|
|
|
4
5
|
const messages = {
|
|
5
6
|
invitedByName: '{invitedByName} has invited you to join {blogName}',
|
|
@@ -10,9 +11,8 @@ const messages = {
|
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
class Invites {
|
|
13
|
-
constructor({settingsCache,
|
|
14
|
+
constructor({settingsCache, mailService, urlUtils}) {
|
|
14
15
|
this.settingsCache = settingsCache;
|
|
15
|
-
this.logging = logging;
|
|
16
16
|
this.mailService = mailService;
|
|
17
17
|
this.urlUtils = urlUtils;
|
|
18
18
|
}
|
|
@@ -80,7 +80,7 @@ class Invites {
|
|
|
80
80
|
});
|
|
81
81
|
const helpText = tpl(messages.errorSendingEmail.help);
|
|
82
82
|
err.message = `${errorMessage} ${helpText}`;
|
|
83
|
-
|
|
83
|
+
logging.warn(err.message);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
return Promise.reject(err);
|
|
@@ -17,6 +17,6 @@ const workerMessageHandler = ({name, message}) => {
|
|
|
17
17
|
logging.info(`Worker for job ${name} sent a message: ${message}`);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const jobManager = new JobManager({
|
|
20
|
+
const jobManager = new JobManager({errorHandler, workerMessageHandler});
|
|
21
21
|
|
|
22
22
|
module.exports = jobManager;
|
|
@@ -638,6 +638,116 @@ figure blockquote p {
|
|
|
638
638
|
font-size: 20px;
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
+
.kg-header-card {
|
|
642
|
+
margin: 0 0 1.5em 0;
|
|
643
|
+
padding: 110px 35px 110px 35px;
|
|
644
|
+
text-align: center;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.kg-header-card.kg-size-small {
|
|
648
|
+
padding-top: 75px;
|
|
649
|
+
padding-bottom: 75px;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.kg-header-card.kg-size-large {
|
|
653
|
+
padding-top: 140px;
|
|
654
|
+
padding-bottom: 140px;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.kg-header-card.kg-align-left {
|
|
658
|
+
text-align: left;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
.kg-header-card.kg-style-invert {
|
|
662
|
+
background: #15171a;
|
|
663
|
+
color: #ffffff;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.kg-header-card.kg-style-clear {
|
|
667
|
+
border-top: 1px solid #e5eff6;
|
|
668
|
+
border-bottom: 1px solid #e5eff6;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.kg-header-card.kg-style-accent {
|
|
672
|
+
background: ${templateSettings.accentColor || '#15171a'};
|
|
673
|
+
color: #ffffff;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.kg-header-card.kg-style-image {
|
|
677
|
+
background-color: #e7e7eb;
|
|
678
|
+
background-size: cover;
|
|
679
|
+
background-position: center center;
|
|
680
|
+
color: #ffffff;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.kg-header-card h2 {
|
|
684
|
+
font-size: 3em;
|
|
685
|
+
font-weight: 700;
|
|
686
|
+
line-height: 1.1em;
|
|
687
|
+
margin: 0 0 0.125em;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.kg-header-card h2 strong {
|
|
691
|
+
font-weight: 800;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.kg-header-card.kg-size-small h2 {
|
|
695
|
+
font-size: 2.5em;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.kg-header-card.kg-size-large h2 {
|
|
699
|
+
font-size: 3.5em;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.kg-header-card h3 {
|
|
703
|
+
font-size: 1.125em;
|
|
704
|
+
font-weight: 500;
|
|
705
|
+
line-height: 1.3em;
|
|
706
|
+
margin: 0;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.kg-header-card h3 strong {
|
|
710
|
+
font-weight: 600;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.kg-header-card.kg-size-large h3 {
|
|
714
|
+
font-size: 1.25em;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.kg-header-card.kg-size-small h3 {
|
|
718
|
+
font-size: 1em;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.kg-header-card-button {
|
|
722
|
+
margin-top: 1.75em;
|
|
723
|
+
background: ${templateSettings.accentColor || '#15212A'};
|
|
724
|
+
border: solid 1px ${templateSettings.accentColor || '#15212A'};
|
|
725
|
+
border-radius: 5px;
|
|
726
|
+
box-sizing: border-box;
|
|
727
|
+
cursor: pointer;
|
|
728
|
+
display: inline-block;
|
|
729
|
+
font-size: 14px;
|
|
730
|
+
font-weight: bold;
|
|
731
|
+
margin: 0;
|
|
732
|
+
padding: 8px 16px;
|
|
733
|
+
text-decoration: none !important;
|
|
734
|
+
color: #FFFFFF !important;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.kg-size-large .kg-header-card-button {
|
|
738
|
+
margin-top: 2em;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.kg-size-small .kg-header-card-button {
|
|
742
|
+
margin-top: 1.5em;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.kg-style-accent .kg-header-card-button {
|
|
746
|
+
background: #ffffff;
|
|
747
|
+
color: ${templateSettings.accentColor || '#15212A'} !important;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
|
|
641
751
|
/* -------------------------------------
|
|
642
752
|
HEADER, FOOTER, MAIN
|
|
643
753
|
------------------------------------- */
|
|
@@ -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.31%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-e628c133ed6b5ec32a1cc3511c2b2978.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-f4bc3ac0c7d33722341d0da4291aa888.js"></script>
|
|
63
|
+
<script src="assets/ghost.min-7690e7e32d3e53ec5480a234962341a6.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.31%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-e628c133ed6b5ec32a1cc3511c2b2978.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-f4bc3ac0c7d33722341d0da4291aa888.js"></script>
|
|
63
|
+
<script src="assets/ghost.min-7690e7e32d3e53ec5480a234962341a6.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
|
|