ghost 4.20.0 → 4.20.4
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/core/built/assets/{ghost.min-26e427944e719b616b8dc7fbb3bbd2f9.js → ghost.min-07b6a50c54b3e2e190332c28c7255d2f.js} +2 -2
- package/core/frontend/services/routing/router-manager.js +5 -3
- package/core/server/api/canary/utils/serializers/output/settings.js +2 -3
- package/core/server/api/v3/utils/serializers/output/settings.js +2 -3
- package/core/server/services/settings/index.js +3 -1
- package/core/server/services/settings/settings-bread-service.js +42 -20
- package/core/server/web/admin/views/default-prod.html +1 -1
- package/core/server/web/admin/views/default.html +1 -1
- package/package.json +4 -4
- package/yarn.lock +18 -28
|
@@ -3094,7 +3094,7 @@ var t=Ember.Service.extend(Ember.Evented,{publish(){return this.trigger(...argum
|
|
|
3094
3094
|
e.default=t})),define("ghost-admin/services/feature",["exports","jquery"],(function(e,t){function n(e,t={}){let{user:n,onChange:r}=t,i=n?[`accessibility.${e}`]:[`config.${e}`,`labs.${e}`]
|
|
3095
3095
|
return Ember.computed.apply(Ember,i.concat({get(){let r=!1
|
|
3096
3096
|
return r=n?this.get(`accessibility.${e}`):this.get(`config.${e}`)?this.get(`config.${e}`):this.get(`labs.${e}`)||!1,t.developer&&(r=r&&this.get("config.enableDeveloperExperiments")),r},set(e,n){return this.update(e,n,t),r&&this.get(r).bind(this)(n),n}}))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.feature=n
|
|
3097
|
-
var r=Ember.Service.extend({store:Ember.inject.service(),config:Ember.inject.service(),session:Ember.inject.service(),settings:Ember.inject.service(),notifications:Ember.inject.service(),lazyLoader:Ember.inject.service(),emailAnalytics:n("emailAnalytics"),nightShift:n("nightShift",{user:!0,onChange:"_setAdminTheme"}),launchComplete:n("launchComplete",{user:!0}),multipleProducts:n("multipleProducts"),offers:n("offers"
|
|
3097
|
+
var r=Ember.Service.extend({store:Ember.inject.service(),config:Ember.inject.service(),session:Ember.inject.service(),settings:Ember.inject.service(),notifications:Ember.inject.service(),lazyLoader:Ember.inject.service(),emailAnalytics:n("emailAnalytics"),nightShift:n("nightShift",{user:!0,onChange:"_setAdminTheme"}),launchComplete:n("launchComplete",{user:!0}),multipleProducts:n("multipleProducts"),offers:n("offers"),oauthLogin:n("oauthLogin",{developer:!0}),customThemeSettings:n("customThemeSettings"),membersActivity:n("membersActivity",{developer:!0}),_user:null,labs:Ember.computed("settings.labs",(function(){let e=this.get("settings.labs")
|
|
3098
3098
|
try{return JSON.parse(e)||{}}catch(t){return{}}})),accessibility:Ember.computed("_user.accessibility",(function(){let e=this.get("_user.accessibility")
|
|
3099
3099
|
try{return JSON.parse(e)||{}}catch(t){return{}}})),fetch(){return this.settings.fetch().then((()=>(this.set("_user",this.session.user),this._setAdminTheme().then((()=>!0)))))},update(e,t,n={}){let r=n.user?"accessibility":"labs",i=this.get(n.user?"_user":"settings"),a=this.get(r)
|
|
3100
3100
|
return Ember.set(a,e,t),n.requires&&!0===t&&n.requires.forEach((e=>{Ember.set(a,e,!0)})),i.set(r,JSON.stringify(a)),i.save().then((()=>(this.notifyPropertyChange(r),this.get(`${r}.${e}`)))).catch((t=>{if(i.rollbackAttributes(),this.notifyPropertyChange(r),!t)throw new Ember.Error(`Validation of the feature service ${n.user?"user":"settings"} model failed when updating ${r}.`)
|
|
@@ -3679,4 +3679,4 @@ var t=Ember.Component.extend({})
|
|
|
3679
3679
|
e.default=t})),define("ghost-admin/config/environment",[],(function(){try{var e="ghost-admin/config/environment",t=document.querySelector('meta[name="'+e+'"]').getAttribute("content"),n={default:JSON.parse(decodeURIComponent(t))}
|
|
3680
3680
|
return Object.defineProperty(n,"__esModule",{value:!0}),n}catch(r){throw new Error('Could not read config from meta tag with name "'+e+'".')}})),runningTests||require("ghost-admin/app").default.create({version:"4.20",name:"ghost-admin"})
|
|
3681
3681
|
|
|
3682
|
-
//# sourceMappingURL=ghost.min-
|
|
3682
|
+
//# sourceMappingURL=ghost.min-07b6a50c54b3e2e190332c28c7255d2f.map
|
|
@@ -108,9 +108,11 @@ class RouterManager {
|
|
|
108
108
|
this.siteRouter.mountRouter(unsubscribeRouter.router());
|
|
109
109
|
this.registry.setRouter('unsubscribeRouter', unsubscribeRouter);
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
if (RESOURCE_CONFIG.QUERY.email) {
|
|
112
|
+
const emailRouter = new EmailRouter(RESOURCE_CONFIG);
|
|
113
|
+
this.siteRouter.mountRouter(emailRouter.router());
|
|
114
|
+
this.registry.setRouter('emailRouter', emailRouter);
|
|
115
|
+
}
|
|
114
116
|
|
|
115
117
|
const previewRouter = new PreviewRouter(RESOURCE_CONFIG);
|
|
116
118
|
this.siteRouter.mountRouter(previewRouter.router());
|
|
@@ -55,9 +55,8 @@ module.exports = {
|
|
|
55
55
|
this.browse(...arguments);
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
-
edit(
|
|
59
|
-
|
|
60
|
-
this.browse(settingsKeyedJSON, apiConfig, frame);
|
|
58
|
+
edit() {
|
|
59
|
+
this.browse(...arguments);
|
|
61
60
|
},
|
|
62
61
|
|
|
63
62
|
download(bytes, apiConfig, frame) {
|
|
@@ -55,9 +55,8 @@ module.exports = {
|
|
|
55
55
|
this.browse(...arguments);
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
-
edit(
|
|
59
|
-
|
|
60
|
-
this.browse(settingsKeyedJSON, apiConfig, frame);
|
|
58
|
+
edit() {
|
|
59
|
+
this.browse(...arguments);
|
|
61
60
|
},
|
|
62
61
|
|
|
63
62
|
download(bytes, apiConfig, frame) {
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
const events = require('../../lib/common/events');
|
|
6
6
|
const models = require('../../models');
|
|
7
|
+
const labs = require('../../../shared/labs');
|
|
7
8
|
const SettingsCache = require('../../../shared/settings-cache');
|
|
8
9
|
const SettingsBREADService = require('./settings-bread-service');
|
|
9
10
|
const {obfuscatedSetting, isSecretSetting, hideValueIfSecret} = require('./settings-utils');
|
|
@@ -14,7 +15,8 @@ const {obfuscatedSetting, isSecretSetting, hideValueIfSecret} = require('./setti
|
|
|
14
15
|
const getSettingsBREADServiceInstance = () => {
|
|
15
16
|
return new SettingsBREADService({
|
|
16
17
|
SettingsModel: models.Settings,
|
|
17
|
-
settingsCache: SettingsCache
|
|
18
|
+
settingsCache: SettingsCache,
|
|
19
|
+
labsService: labs
|
|
18
20
|
});
|
|
19
21
|
};
|
|
20
22
|
|
|
@@ -14,10 +14,12 @@ class SettingsBREADService {
|
|
|
14
14
|
* @param {Object} options
|
|
15
15
|
* @param {Object} options.SettingsModel
|
|
16
16
|
* @param {Object} options.settingsCache - SettingsCache instance
|
|
17
|
+
* @param {Object} options.labsService - labs service instance
|
|
17
18
|
*/
|
|
18
|
-
constructor({SettingsModel, settingsCache}) {
|
|
19
|
+
constructor({SettingsModel, settingsCache, labsService}) {
|
|
19
20
|
this.SettingsModel = SettingsModel;
|
|
20
21
|
this.settingsCache = settingsCache;
|
|
22
|
+
this.labs = labsService;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
@@ -28,24 +30,7 @@ class SettingsBREADService {
|
|
|
28
30
|
browse(context) {
|
|
29
31
|
let settings = this.settingsCache.getAll();
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
if (!context) {
|
|
33
|
-
return Promise.resolve(settings.filter((setting) => {
|
|
34
|
-
return setting.group === 'site';
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!context.internal) {
|
|
39
|
-
// CASE: omit core settings unless internal request
|
|
40
|
-
settings = _.filter(settings, (setting) => {
|
|
41
|
-
const isCore = setting.group === 'core';
|
|
42
|
-
return !isCore;
|
|
43
|
-
});
|
|
44
|
-
// CASE: omit secret settings unless internal request
|
|
45
|
-
settings = settings.map(hideValueIfSecret);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return settings;
|
|
33
|
+
return this._formatBrowse(settings, context);
|
|
49
34
|
}
|
|
50
35
|
|
|
51
36
|
/**
|
|
@@ -86,6 +71,12 @@ class SettingsBREADService {
|
|
|
86
71
|
}));
|
|
87
72
|
}
|
|
88
73
|
|
|
74
|
+
// NOTE: Labs flags can exist outside of the DB when they are forced on/off
|
|
75
|
+
// so we grab them from the labs service instead as that's source-of-truth
|
|
76
|
+
if (setting.key === 'labs') {
|
|
77
|
+
setting.value = JSON.stringify(this.labs.getAll());
|
|
78
|
+
}
|
|
79
|
+
|
|
89
80
|
setting = hideValueIfSecret(setting);
|
|
90
81
|
|
|
91
82
|
return {
|
|
@@ -161,7 +152,9 @@ class SettingsBREADService {
|
|
|
161
152
|
});
|
|
162
153
|
}
|
|
163
154
|
|
|
164
|
-
return this.SettingsModel.edit(filteredSettings, options)
|
|
155
|
+
return this.SettingsModel.edit(filteredSettings, options).then((result) => {
|
|
156
|
+
return this._formatBrowse(_.keyBy(_.invokeMap(result, 'toJSON'), 'key'), options.context);
|
|
157
|
+
});
|
|
165
158
|
}
|
|
166
159
|
|
|
167
160
|
/**
|
|
@@ -183,6 +176,35 @@ class SettingsBREADService {
|
|
|
183
176
|
}
|
|
184
177
|
}
|
|
185
178
|
}
|
|
179
|
+
|
|
180
|
+
_formatBrowse(inputSettings, context) {
|
|
181
|
+
let settings = _.values(inputSettings);
|
|
182
|
+
// CASE: no context passed (functional call)
|
|
183
|
+
if (!context) {
|
|
184
|
+
return Promise.resolve(settings.filter((setting) => {
|
|
185
|
+
return setting.group === 'site';
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (!context.internal) {
|
|
190
|
+
// CASE: omit core settings unless internal request
|
|
191
|
+
settings = _.filter(settings, (setting) => {
|
|
192
|
+
const isCore = setting.group === 'core';
|
|
193
|
+
return !isCore;
|
|
194
|
+
});
|
|
195
|
+
// CASE: omit secret settings unless internal request
|
|
196
|
+
settings = settings.map(hideValueIfSecret);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// NOTE: Labs flags can exist outside of the DB when they are forced on/off
|
|
200
|
+
// so we grab them from the labs service instead as that's source-of-truth
|
|
201
|
+
const labsSetting = settings.find(setting => setting.key === 'labs');
|
|
202
|
+
if (labsSetting) {
|
|
203
|
+
labsSetting.value = JSON.stringify(this.labs.getAll());
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return settings;
|
|
207
|
+
}
|
|
186
208
|
}
|
|
187
209
|
|
|
188
210
|
module.exports = SettingsBREADService;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
<script src="assets/vendor.min-af502ac4142871500fc424f6a5a254ec.js"></script>
|
|
63
|
-
<script src="assets/ghost.min-
|
|
63
|
+
<script src="assets/ghost.min-07b6a50c54b3e2e190332c28c7255d2f.js"></script>
|
|
64
64
|
|
|
65
65
|
</body>
|
|
66
66
|
</html>
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
<script src="assets/vendor.min-af502ac4142871500fc424f6a5a254ec.js"></script>
|
|
63
|
-
<script src="assets/ghost.min-
|
|
63
|
+
<script src="assets/ghost.min-07b6a50c54b3e2e190332c28c7255d2f.js"></script>
|
|
64
64
|
|
|
65
65
|
</body>
|
|
66
66
|
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ghost",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.4",
|
|
4
4
|
"description": "The professional publishing platform",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"homepage": "https://ghost.org",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@tryghost/color-utils": "0.1.2",
|
|
63
63
|
"@tryghost/config-url-helpers": "0.1.3",
|
|
64
64
|
"@tryghost/constants": "0.1.12",
|
|
65
|
-
"@tryghost/custom-theme-settings-service": "0.3.
|
|
65
|
+
"@tryghost/custom-theme-settings-service": "0.3.1",
|
|
66
66
|
"@tryghost/debug": "0.1.9",
|
|
67
67
|
"@tryghost/email-analytics-provider-mailgun": "1.0.4",
|
|
68
68
|
"@tryghost/email-analytics-service": "1.0.3",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"ghost-storage-base": "0.0.6",
|
|
129
129
|
"glob": "7.2.0",
|
|
130
130
|
"got": "9.6.0",
|
|
131
|
-
"gscan": "4.9.
|
|
131
|
+
"gscan": "4.9.3",
|
|
132
132
|
"html-to-text": "5.1.1",
|
|
133
133
|
"image-size": "1.0.0",
|
|
134
134
|
"intl": "1.2.5",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"mysql": "2.18.1",
|
|
159
159
|
"nconf": "0.11.3",
|
|
160
160
|
"node-jose": "2.0.0",
|
|
161
|
-
"oembed-parser": "1.4.
|
|
161
|
+
"oembed-parser": "1.4.9",
|
|
162
162
|
"passport": "0.5.0",
|
|
163
163
|
"passport-google-oauth": "2.0.0",
|
|
164
164
|
"path-match": "1.2.4",
|
package/yarn.lock
CHANGED
|
@@ -1270,10 +1270,10 @@
|
|
|
1270
1270
|
resolved "https://registry.yarnpkg.com/@tryghost/constants/-/constants-0.1.12.tgz#17efd5dbb5d0bfbf11de1ceaaed347d165e63b1f"
|
|
1271
1271
|
integrity sha512-nQPov2XnfnWxMf330JVLRGUJUqupgvBGWrUU31GJYQRTheKS0N6DSBCKJaO0euGEsWfvJ+BsWVbAJp0vxsUDzg==
|
|
1272
1272
|
|
|
1273
|
-
"@tryghost/custom-theme-settings-service@0.3.
|
|
1274
|
-
version "0.3.
|
|
1275
|
-
resolved "https://registry.yarnpkg.com/@tryghost/custom-theme-settings-service/-/custom-theme-settings-service-0.3.
|
|
1276
|
-
integrity sha512-
|
|
1273
|
+
"@tryghost/custom-theme-settings-service@0.3.1":
|
|
1274
|
+
version "0.3.1"
|
|
1275
|
+
resolved "https://registry.yarnpkg.com/@tryghost/custom-theme-settings-service/-/custom-theme-settings-service-0.3.1.tgz#46de63a136775a4124e8593d295bc61f3d852674"
|
|
1276
|
+
integrity sha512-2Qum40bKQGV2Lt8kcRtVDjacZsNtkQf+iAqohZ8e7RHWsjuYSlOTsH/lF5epBDusDkTSqd+21Npfef5VT1IfyA==
|
|
1277
1277
|
dependencies:
|
|
1278
1278
|
"@tryghost/debug" "^0.1.5"
|
|
1279
1279
|
"@tryghost/errors" "^0.2.14"
|
|
@@ -1671,10 +1671,10 @@
|
|
|
1671
1671
|
fs-extra "^10.0.0"
|
|
1672
1672
|
lodash "^4.17.21"
|
|
1673
1673
|
|
|
1674
|
-
"@tryghost/pretty-cli@1.2.
|
|
1675
|
-
version "1.2.
|
|
1676
|
-
resolved "https://registry.yarnpkg.com/@tryghost/pretty-cli/-/pretty-cli-1.2.
|
|
1677
|
-
integrity sha512-
|
|
1674
|
+
"@tryghost/pretty-cli@1.2.22":
|
|
1675
|
+
version "1.2.22"
|
|
1676
|
+
resolved "https://registry.yarnpkg.com/@tryghost/pretty-cli/-/pretty-cli-1.2.22.tgz#dfc3356c842569003f5e0cd6114b3811c2a4911b"
|
|
1677
|
+
integrity sha512-y5k/bT3zhuYGDbPUNcgAPt9OSk4rZjtEjIjrqbo1nES14kp66uq+aLldqPyMAR/1a17AFnwMEiEZwkRL3KSAhQ==
|
|
1678
1678
|
dependencies:
|
|
1679
1679
|
chalk "^4.1.0"
|
|
1680
1680
|
sywac "^1.3.0"
|
|
@@ -1839,16 +1839,6 @@
|
|
|
1839
1839
|
resolved "https://registry.yarnpkg.com/@tryghost/vhost-middleware/-/vhost-middleware-1.0.19.tgz#8988196fee745353aa4ca4393874bc0b236429d4"
|
|
1840
1840
|
integrity sha512-wZU1mmPlomSQK2Z0Y0GT8oGm8XsOQZhn39J1cr/ULBWf/JmQTTMRkAxeeARFvvN3u6b+/RlJAaO6OdLkk0dROQ==
|
|
1841
1841
|
|
|
1842
|
-
"@tryghost/zip@1.1.17":
|
|
1843
|
-
version "1.1.17"
|
|
1844
|
-
resolved "https://registry.yarnpkg.com/@tryghost/zip/-/zip-1.1.17.tgz#8665655fbbde0f421180d012ca7769bd133a7482"
|
|
1845
|
-
integrity sha512-ZyjJsQaVSBUqsJ3iBU9hV6G1P7kTSfi83u+g26ZcSjfx4y3FvpYiDbCc2WTKj5xDS0p3NbQ7ZVOi6E73oXVlDg==
|
|
1846
|
-
dependencies:
|
|
1847
|
-
archiver "^4.0.2"
|
|
1848
|
-
bluebird "^3.7.2"
|
|
1849
|
-
extract-zip "2.0.1"
|
|
1850
|
-
fs-extra "^9.1.0"
|
|
1851
|
-
|
|
1852
1842
|
"@tryghost/zip@1.1.18":
|
|
1853
1843
|
version "1.1.18"
|
|
1854
1844
|
resolved "https://registry.yarnpkg.com/@tryghost/zip/-/zip-1.1.18.tgz#1afcf07d1c5404ab38bc42ef9b400eafc4052edc"
|
|
@@ -5533,14 +5523,14 @@ grunt@1.4.1:
|
|
|
5533
5523
|
nopt "~3.0.6"
|
|
5534
5524
|
rimraf "~3.0.2"
|
|
5535
5525
|
|
|
5536
|
-
gscan@4.9.
|
|
5537
|
-
version "4.9.
|
|
5538
|
-
resolved "https://registry.yarnpkg.com/gscan/-/gscan-4.9.
|
|
5539
|
-
integrity sha512
|
|
5526
|
+
gscan@4.9.3:
|
|
5527
|
+
version "4.9.3"
|
|
5528
|
+
resolved "https://registry.yarnpkg.com/gscan/-/gscan-4.9.3.tgz#2f7674f11ee2bf8a4805210c24b72264df480d32"
|
|
5529
|
+
integrity sha512-+iMshoaR7RJB/+IRJ984BCtkyerQ8Lgf7OoJzM0xdYsXM8jgVUN5Zrrn0SD/XQsNycDLABtG4A2cxBhkFRKPiQ==
|
|
5540
5530
|
dependencies:
|
|
5541
5531
|
"@sentry/node" "6.13.3"
|
|
5542
|
-
"@tryghost/pretty-cli" "1.2.
|
|
5543
|
-
"@tryghost/zip" "1.1.
|
|
5532
|
+
"@tryghost/pretty-cli" "1.2.22"
|
|
5533
|
+
"@tryghost/zip" "1.1.18"
|
|
5544
5534
|
bluebird "3.7.2"
|
|
5545
5535
|
chalk "4.1.2"
|
|
5546
5536
|
common-tags "1.8.0"
|
|
@@ -8446,10 +8436,10 @@ object.pick@^1.2.0, object.pick@^1.3.0:
|
|
|
8446
8436
|
dependencies:
|
|
8447
8437
|
isobject "^3.0.1"
|
|
8448
8438
|
|
|
8449
|
-
oembed-parser@1.4.
|
|
8450
|
-
version "1.4.
|
|
8451
|
-
resolved "https://registry.yarnpkg.com/oembed-parser/-/oembed-parser-1.4.
|
|
8452
|
-
integrity sha512-
|
|
8439
|
+
oembed-parser@1.4.9:
|
|
8440
|
+
version "1.4.9"
|
|
8441
|
+
resolved "https://registry.yarnpkg.com/oembed-parser/-/oembed-parser-1.4.9.tgz#d23127c96185dfa2d998b8567e6c7df164f3d824"
|
|
8442
|
+
integrity sha512-RCOjuv20IMm9XekZB1ZefdYPc+x5qe8IyCeY/xcN71I2z70vQl+L420eI5Mjyy/NQFLv+QPEgj/aYh1vptO83w==
|
|
8453
8443
|
dependencies:
|
|
8454
8444
|
cross-fetch "^3.1.4"
|
|
8455
8445
|
|