ghost 4.22.1 → 4.22.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.
Files changed (51) hide show
  1. package/.eslintrc.js +6 -0
  2. package/Gruntfile.js +1 -0
  3. package/core/boot.js +3 -0
  4. package/core/built/assets/{chunk.3.1148677ff3b78e5aeaee.js → chunk.3.324fd0cc598c73650219.js} +10 -10
  5. package/core/built/assets/{ghost-dark-684ad238e1a858c7cb5be6988de7c6f5.css → ghost-dark-39fb496d051565531062d7e047d1c0b1.css} +1 -1
  6. package/core/built/assets/{ghost.min-66e08535f8bb797a8c40e0a2b31f1e9e.css → ghost.min-4207edfc1ae0a3f9f6505ca00d20b0c0.css} +1 -1
  7. package/core/built/assets/{ghost.min-f7037eca328f4d4eb99f0309c19c9bae.js → ghost.min-7da921f6c6cac3fe10da1ba104575440.js} +134 -121
  8. package/core/built/assets/{vendor.min-7c8fdd90f7ecd2e94328a07ea3b64608.js → vendor.min-413f887176a041e6dbf88214ca9a7481.js} +6932 -6801
  9. package/core/frontend/src/cards/css/button.css +30 -0
  10. package/core/frontend/src/cards/css/callout.css +12 -0
  11. package/core/frontend/src/cards/css/nft.css +85 -0
  12. package/core/frontend/web/routes.js +0 -1
  13. package/core/frontend/web/site.js +3 -0
  14. package/core/server/adapters/storage/LocalFilesStorage.js +17 -0
  15. package/core/server/adapters/storage/LocalImagesStorage.js +1 -0
  16. package/core/server/adapters/storage/LocalMediaStorage.js +2 -1
  17. package/core/server/adapters/storage/LocalStorageBase.js +30 -5
  18. package/core/server/api/canary/files.js +19 -0
  19. package/core/server/api/canary/index.js +4 -0
  20. package/core/server/api/canary/media.js +25 -5
  21. package/core/server/api/canary/oembed.js +3 -0
  22. package/core/server/api/canary/utils/serializers/input/index.js +4 -0
  23. package/core/server/api/canary/utils/serializers/input/media.js +8 -0
  24. package/core/server/api/canary/utils/serializers/output/config.js +21 -14
  25. package/core/server/api/canary/utils/serializers/output/files.js +27 -0
  26. package/core/server/api/canary/utils/serializers/output/index.js +4 -0
  27. package/core/server/api/canary/utils/serializers/output/media.js +9 -0
  28. package/core/server/api/canary/utils/validators/input/files.js +7 -0
  29. package/core/server/api/canary/utils/validators/input/index.js +4 -0
  30. package/core/server/api/canary/utils/validators/input/media.js +4 -0
  31. package/core/server/services/mega/template.js +58 -1
  32. package/core/server/services/nft-oembed.js +71 -0
  33. package/core/server/services/oembed.js +145 -110
  34. package/core/server/services/public-config/config.js +2 -1
  35. package/core/server/services/stripe/index.js +4 -2
  36. package/core/server/services/url/Resource.js +1 -1
  37. package/core/server/services/url/Resources.js +28 -21
  38. package/core/server/services/url/UrlService.js +66 -8
  39. package/core/server/services/url/Urls.js +7 -2
  40. package/core/server/services/url/index.js +8 -1
  41. package/core/server/web/admin/views/default-prod.html +3 -3
  42. package/core/server/web/admin/views/default.html +3 -3
  43. package/core/server/web/api/canary/admin/routes.js +15 -0
  44. package/core/server/web/api/middleware/cors.js +7 -7
  45. package/core/shared/config/defaults.json +3 -1
  46. package/core/shared/config/helpers.js +2 -0
  47. package/core/shared/config/overrides.json +2 -2
  48. package/core/shared/labs.js +8 -1
  49. package/package.json +17 -17
  50. package/urls.json +597 -0
  51. package/yarn.lock +139 -140
@@ -3,7 +3,7 @@ const url = require('url');
3
3
  const os = require('os');
4
4
  const urlUtils = require('../../../../shared/url-utils');
5
5
 
6
- let whitelist = [];
6
+ let allowlist = [];
7
7
  const ENABLE_CORS = {origin: true, maxAge: 86400};
8
8
  const DISABLE_CORS = {origin: false};
9
9
 
@@ -46,16 +46,16 @@ function getUrls() {
46
46
  return urls;
47
47
  }
48
48
 
49
- function getWhitelist() {
49
+ function getAllowlist() {
50
50
  // This needs doing just one time after init
51
- if (whitelist.length === 0) {
51
+ if (allowlist.length === 0) {
52
52
  // origins that always match: localhost, local IPs, etc.
53
- whitelist = whitelist.concat(getIPs());
53
+ allowlist = allowlist.concat(getIPs());
54
54
  // Trusted urls from config.js
55
- whitelist = whitelist.concat(getUrls());
55
+ allowlist = allowlist.concat(getUrls());
56
56
  }
57
57
 
58
- return whitelist;
58
+ return allowlist;
59
59
  }
60
60
 
61
61
  /**
@@ -73,7 +73,7 @@ function handleCORS(req, cb) {
73
73
  }
74
74
 
75
75
  // Origin matches whitelist
76
- if (getWhitelist().indexOf(url.parse(origin).hostname) > -1) {
76
+ if (getAllowlist().indexOf(url.parse(origin).hostname) > -1) {
77
77
  return cb(null, ENABLE_CORS);
78
78
  }
79
79
 
@@ -25,7 +25,9 @@
25
25
  "storage": {
26
26
  "active": "LocalImagesStorage",
27
27
  "media": "LocalMediaStorage",
28
- "LocalMediaStorage": {}
28
+ "files": "LocalFilesStorage",
29
+ "LocalMediaStorage": {},
30
+ "LocalFilesStorage": {}
29
31
  },
30
32
  "scheduling": {
31
33
  "active": "SchedulingDefault"
@@ -34,6 +34,8 @@ const getContentPath = function getContentPath(type) {
34
34
  return path.join(this.get('paths:contentPath'), 'images/');
35
35
  case 'media':
36
36
  return path.join(this.get('paths:contentPath'), 'media/');
37
+ case 'files':
38
+ return path.join(this.get('paths:contentPath'), 'files/');
37
39
  case 'themes':
38
40
  return path.join(this.get('paths:contentPath'), 'themes/');
39
41
  case 'adapters':
@@ -31,8 +31,8 @@
31
31
  "contentTypes": ["image/jpeg", "image/png", "image/gif", "image/svg+xml", "image/x-icon", "image/vnd.microsoft.icon", "image/webp"]
32
32
  },
33
33
  "media": {
34
- "extensions": [".mp4",".webm", ".ogv"],
35
- "contentTypes": ["video/mp4", "video/webm", "video/ogg"]
34
+ "extensions": [".mp4",".webm", ".ogv", ".mp3", ".wav", ".ogg"],
35
+ "contentTypes": ["video/mp4", "video/webm", "video/ogg", "audio/mpeg", "audio/vnd.wav", "audio/ogg"]
36
36
  },
37
37
  "thumbnails": {
38
38
  "extensions": [".jpg", ".jpeg", ".gif", ".png", ".svg", ".svgz", ".ico", ".webp"],
@@ -29,8 +29,15 @@ const ALPHA_FEATURES = [
29
29
  'oauthLogin',
30
30
  'membersActivity',
31
31
  'cardSettingsPanel',
32
+ 'urlCache',
32
33
  'mediaAPI',
33
- 'membersAutoLogin'
34
+ 'filesAPI',
35
+ 'membersAutoLogin',
36
+ 'buttonCard',
37
+ 'calloutCard',
38
+ 'nftCard',
39
+ 'accordionCard',
40
+ 'gifsCard'
34
41
  ];
35
42
 
36
43
  module.exports.GA_KEYS = [...GA_FEATURES];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghost",
3
- "version": "4.22.1",
3
+ "version": "4.22.2",
4
4
  "description": "The professional publishing platform",
5
5
  "author": "Ghost Foundation",
6
6
  "homepage": "https://ghost.org",
@@ -54,26 +54,26 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@nexes/nql": "0.6.0",
57
- "@sentry/node": "6.14.0",
57
+ "@sentry/node": "6.14.3",
58
58
  "@tryghost/adapter-manager": "0.2.18",
59
- "@tryghost/admin-api-schema": "2.6.0",
59
+ "@tryghost/admin-api-schema": "2.6.1",
60
60
  "@tryghost/bookshelf-plugins": "0.3.4",
61
61
  "@tryghost/bootstrap-socket": "0.2.13",
62
- "@tryghost/color-utils": "0.1.2",
62
+ "@tryghost/color-utils": "0.1.4",
63
63
  "@tryghost/config-url-helpers": "0.1.3",
64
- "@tryghost/constants": "0.1.12",
64
+ "@tryghost/constants": "1.0.0",
65
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.5",
68
68
  "@tryghost/email-analytics-service": "1.0.4",
69
69
  "@tryghost/errors": "0.2.17",
70
70
  "@tryghost/express-dynamic-redirects": "0.2.1",
71
- "@tryghost/helpers": "1.1.52",
71
+ "@tryghost/helpers": "1.1.53",
72
72
  "@tryghost/image-transform": "1.0.18",
73
73
  "@tryghost/job-manager": "0.8.12",
74
74
  "@tryghost/kg-card-factory": "3.1.0",
75
75
  "@tryghost/kg-default-atoms": "3.1.0",
76
- "@tryghost/kg-default-cards": "5.1.0",
76
+ "@tryghost/kg-default-cards": "5.5.1",
77
77
  "@tryghost/kg-markdown-html-renderer": "5.1.0",
78
78
  "@tryghost/kg-mobiledoc-html-renderer": "5.2.0",
79
79
  "@tryghost/limit-service": "1.0.0",
@@ -82,7 +82,7 @@
82
82
  "@tryghost/members-api": "2.7.4",
83
83
  "@tryghost/members-csv": "1.1.8",
84
84
  "@tryghost/members-importer": "0.3.4",
85
- "@tryghost/members-offers": "0.10.1",
85
+ "@tryghost/members-offers": "0.10.2",
86
86
  "@tryghost/members-ssr": "1.0.15",
87
87
  "@tryghost/metrics": "1.0.0",
88
88
  "@tryghost/minifier": "0.1.0",
@@ -94,11 +94,11 @@
94
94
  "@tryghost/root-utils": "0.3.7",
95
95
  "@tryghost/security": "0.2.13",
96
96
  "@tryghost/session-service": "0.1.28",
97
- "@tryghost/social-urls": "0.1.26",
98
- "@tryghost/string": "0.1.20",
97
+ "@tryghost/social-urls": "0.1.27",
98
+ "@tryghost/string": "0.1.21",
99
99
  "@tryghost/tpl": "0.1.8",
100
100
  "@tryghost/update-check-service": "0.2.5",
101
- "@tryghost/url-utils": "2.0.2",
101
+ "@tryghost/url-utils": "2.0.3",
102
102
  "@tryghost/validator": "0.1.8",
103
103
  "@tryghost/version": "0.1.7",
104
104
  "@tryghost/vhost-middleware": "1.0.19",
@@ -126,7 +126,7 @@
126
126
  "express-query-boolean": "2.0.0",
127
127
  "express-session": "1.17.2",
128
128
  "fs-extra": "10.0.0",
129
- "ghost-storage-base": "0.0.6",
129
+ "ghost-storage-base": "1.0.0",
130
130
  "glob": "7.2.0",
131
131
  "got": "9.6.0",
132
132
  "gscan": "4.10.1",
@@ -142,7 +142,7 @@
142
142
  "knex": "0.21.21",
143
143
  "knex-migrator": "4.1.1",
144
144
  "lodash": "4.17.21",
145
- "luxon": "2.0.2",
145
+ "luxon": "2.1.1",
146
146
  "mailgun-js": "0.22.0",
147
147
  "metascraper": "5.25.0",
148
148
  "metascraper-author": "5.25.0",
@@ -159,7 +159,7 @@
159
159
  "mysql": "2.18.1",
160
160
  "nconf": "0.11.3",
161
161
  "node-jose": "2.0.0",
162
- "oembed-parser": "1.4.9",
162
+ "oembed-parser": "1.5.2",
163
163
  "passport": "0.5.0",
164
164
  "passport-google-oauth": "2.0.0",
165
165
  "path-match": "1.2.4",
@@ -173,14 +173,14 @@
173
173
  "xml": "1.0.1"
174
174
  },
175
175
  "optionalDependencies": {
176
- "@tryghost/html-to-mobiledoc": "0.7.17",
176
+ "@tryghost/html-to-mobiledoc": "1.2.2",
177
177
  "sqlite3": "5.0.2"
178
178
  },
179
179
  "devDependencies": {
180
180
  "@lodder/grunt-postcss": "3.1.1",
181
181
  "c8": "7.10.0",
182
182
  "coffeescript": "2.6.1",
183
- "cssnano": "5.0.9",
183
+ "cssnano": "5.0.10",
184
184
  "eslint": "7.32.0",
185
185
  "eslint-plugin-ghost": "2.7.0",
186
186
  "grunt": "1.4.1",
@@ -198,7 +198,7 @@
198
198
  "mocha": "9.1.3",
199
199
  "mocha-slow-test-reporter": "0.1.2",
200
200
  "mock-knex": "0.4.10",
201
- "nock": "13.1.4",
201
+ "nock": "13.2.1",
202
202
  "papaparse": "5.3.1",
203
203
  "postcss": "8.3.11",
204
204
  "rewire": "5.0.0",