ghost 5.80.5 → 5.81.1

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 (169) hide show
  1. package/components/tryghost-adapter-cache-memory-ttl-5.81.1.tgz +0 -0
  2. package/components/{tryghost-adapter-cache-redis-5.80.5.tgz → tryghost-adapter-cache-redis-5.81.1.tgz} +0 -0
  3. package/components/tryghost-adapter-manager-5.81.1.tgz +0 -0
  4. package/components/tryghost-announcement-bar-settings-5.81.1.tgz +0 -0
  5. package/components/{tryghost-api-framework-5.80.5.tgz → tryghost-api-framework-5.81.1.tgz} +0 -0
  6. package/components/tryghost-api-version-compatibility-service-5.81.1.tgz +0 -0
  7. package/components/{tryghost-audience-feedback-5.80.5.tgz → tryghost-audience-feedback-5.81.1.tgz} +0 -0
  8. package/components/tryghost-bookshelf-repository-5.81.1.tgz +0 -0
  9. package/components/tryghost-bootstrap-socket-5.81.1.tgz +0 -0
  10. package/components/tryghost-collections-5.81.1.tgz +0 -0
  11. package/components/{tryghost-constants-5.80.5.tgz → tryghost-constants-5.81.1.tgz} +0 -0
  12. package/components/tryghost-custom-theme-settings-service-5.81.1.tgz +0 -0
  13. package/components/tryghost-data-generator-5.81.1.tgz +0 -0
  14. package/components/tryghost-domain-events-5.81.1.tgz +0 -0
  15. package/components/tryghost-donations-5.81.1.tgz +0 -0
  16. package/components/tryghost-dynamic-routing-events-5.81.1.tgz +0 -0
  17. package/components/{tryghost-email-addresses-5.80.5.tgz → tryghost-email-addresses-5.81.1.tgz} +0 -0
  18. package/components/{tryghost-email-analytics-provider-mailgun-5.80.5.tgz → tryghost-email-analytics-provider-mailgun-5.81.1.tgz} +0 -0
  19. package/components/tryghost-email-analytics-service-5.81.1.tgz +0 -0
  20. package/components/tryghost-email-content-generator-5.81.1.tgz +0 -0
  21. package/components/{tryghost-email-events-5.80.5.tgz → tryghost-email-events-5.81.1.tgz} +0 -0
  22. package/components/tryghost-email-service-5.81.1.tgz +0 -0
  23. package/components/tryghost-email-suppression-list-5.81.1.tgz +0 -0
  24. package/components/tryghost-express-dynamic-redirects-5.81.1.tgz +0 -0
  25. package/components/tryghost-external-media-inliner-5.81.1.tgz +0 -0
  26. package/components/{tryghost-extract-api-key-5.80.5.tgz → tryghost-extract-api-key-5.81.1.tgz} +0 -0
  27. package/components/tryghost-ghost-5.81.1.tgz +0 -0
  28. package/components/tryghost-html-to-plaintext-5.81.1.tgz +0 -0
  29. package/components/tryghost-i18n-5.81.1.tgz +0 -0
  30. package/components/{tryghost-importer-handler-content-files-5.80.5.tgz → tryghost-importer-handler-content-files-5.81.1.tgz} +0 -0
  31. package/components/{tryghost-importer-revue-5.80.5.tgz → tryghost-importer-revue-5.81.1.tgz} +0 -0
  32. package/components/{tryghost-in-memory-repository-5.80.5.tgz → tryghost-in-memory-repository-5.81.1.tgz} +0 -0
  33. package/components/{tryghost-job-manager-5.80.5.tgz → tryghost-job-manager-5.81.1.tgz} +0 -0
  34. package/components/{tryghost-link-redirects-5.80.5.tgz → tryghost-link-redirects-5.81.1.tgz} +0 -0
  35. package/components/tryghost-link-replacer-5.81.1.tgz +0 -0
  36. package/components/{tryghost-link-tracking-5.80.5.tgz → tryghost-link-tracking-5.81.1.tgz} +0 -0
  37. package/components/{tryghost-magic-link-5.80.5.tgz → tryghost-magic-link-5.81.1.tgz} +0 -0
  38. package/components/tryghost-mail-events-5.81.1.tgz +0 -0
  39. package/components/tryghost-mailgun-client-5.81.1.tgz +0 -0
  40. package/components/{tryghost-member-attribution-5.80.5.tgz → tryghost-member-attribution-5.81.1.tgz} +0 -0
  41. package/components/{tryghost-member-events-5.80.5.tgz → tryghost-member-events-5.81.1.tgz} +0 -0
  42. package/components/tryghost-members-api-5.81.1.tgz +0 -0
  43. package/components/tryghost-members-csv-5.81.1.tgz +0 -0
  44. package/components/tryghost-members-events-service-5.81.1.tgz +0 -0
  45. package/components/tryghost-members-importer-5.81.1.tgz +0 -0
  46. package/components/{tryghost-members-offers-5.80.5.tgz → tryghost-members-offers-5.81.1.tgz} +0 -0
  47. package/components/tryghost-members-payments-5.81.1.tgz +0 -0
  48. package/components/tryghost-members-ssr-5.81.1.tgz +0 -0
  49. package/components/{tryghost-members-stripe-service-5.80.5.tgz → tryghost-members-stripe-service-5.81.1.tgz} +0 -0
  50. package/components/tryghost-mentions-email-report-5.81.1.tgz +0 -0
  51. package/components/tryghost-milestones-5.81.1.tgz +0 -0
  52. package/components/tryghost-minifier-5.81.1.tgz +0 -0
  53. package/components/{tryghost-model-to-domain-event-interceptor-5.80.5.tgz → tryghost-model-to-domain-event-interceptor-5.81.1.tgz} +0 -0
  54. package/components/tryghost-mw-api-version-mismatch-5.81.1.tgz +0 -0
  55. package/components/tryghost-mw-cache-control-5.81.1.tgz +0 -0
  56. package/components/{tryghost-mw-error-handler-5.80.5.tgz → tryghost-mw-error-handler-5.81.1.tgz} +0 -0
  57. package/components/tryghost-mw-session-from-token-5.81.1.tgz +0 -0
  58. package/components/tryghost-mw-update-user-last-seen-5.81.1.tgz +0 -0
  59. package/components/{tryghost-mw-version-match-5.80.5.tgz → tryghost-mw-version-match-5.81.1.tgz} +0 -0
  60. package/components/tryghost-mw-vhost-5.81.1.tgz +0 -0
  61. package/components/tryghost-nql-filter-expansions-5.81.1.tgz +0 -0
  62. package/components/tryghost-oembed-service-5.81.1.tgz +0 -0
  63. package/components/tryghost-package-json-5.81.1.tgz +0 -0
  64. package/components/tryghost-post-events-5.81.1.tgz +0 -0
  65. package/components/tryghost-post-revisions-5.81.1.tgz +0 -0
  66. package/components/{tryghost-posts-service-5.80.5.tgz → tryghost-posts-service-5.81.1.tgz} +0 -0
  67. package/components/tryghost-recommendations-5.81.1.tgz +0 -0
  68. package/components/tryghost-referrers-5.81.1.tgz +0 -0
  69. package/components/{tryghost-security-5.80.5.tgz → tryghost-security-5.81.1.tgz} +0 -0
  70. package/components/tryghost-session-service-5.81.1.tgz +0 -0
  71. package/components/tryghost-settings-path-manager-5.81.1.tgz +0 -0
  72. package/components/tryghost-slack-notifications-5.81.1.tgz +0 -0
  73. package/components/{tryghost-staff-service-5.80.5.tgz → tryghost-staff-service-5.81.1.tgz} +0 -0
  74. package/components/tryghost-stats-service-5.81.1.tgz +0 -0
  75. package/components/{tryghost-tiers-5.80.5.tgz → tryghost-tiers-5.81.1.tgz} +0 -0
  76. package/components/tryghost-update-check-service-5.81.1.tgz +0 -0
  77. package/components/tryghost-verification-trigger-5.81.1.tgz +0 -0
  78. package/components/{tryghost-version-notifications-data-service-5.80.5.tgz → tryghost-version-notifications-data-service-5.81.1.tgz} +0 -0
  79. package/components/tryghost-webmentions-5.81.1.tgz +0 -0
  80. package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +2 -2
  81. package/core/built/admin/assets/admin-x-demo/{index-771f4964.mjs → index-c81d9844.mjs} +3878 -3638
  82. package/core/built/admin/assets/admin-x-demo/{modals-4c390700.mjs → modals-b9180276.mjs} +2 -2
  83. package/core/built/admin/assets/admin-x-settings/{CodeEditorView-00610c2f.mjs → CodeEditorView-eef74c9c.mjs} +38 -38
  84. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
  85. package/core/built/admin/assets/admin-x-settings/{index-2deb7a1f.mjs → index-5f812a27.mjs} +2 -2
  86. package/core/built/admin/assets/admin-x-settings/{index-e308aac8.mjs → index-e986b71a.mjs} +6221 -5950
  87. package/core/built/admin/assets/admin-x-settings/{modals-e2ca767c.mjs → modals-24778772.mjs} +979 -958
  88. package/core/built/admin/assets/{chunk.524.3d8d7c3975612d38f35d.js → chunk.524.a8bf57854398790b354d.js} +5 -5
  89. package/core/built/admin/assets/{chunk.582.2a7a81f362f39eb003cd.js → chunk.582.6fc384a7dc0eb0bcdd3a.js} +4 -4
  90. package/core/built/admin/assets/{chunk.763.7849440ec6494d2449e9.js → chunk.682.597be201dde4abdd4e68.js} +2566 -2098
  91. package/core/built/admin/assets/{ghost-71cfcdf9410af9b3aec11a28f9a4130f.css → ghost-85d66247f3eb43a3d462b89c9280e805.css} +1 -1
  92. package/core/built/admin/assets/{ghost-1c39a8a5afc462b8b49fe2e99cdc4f2c.js → ghost-c3ba0161decd868a3a79d6f4264c3286.js} +240 -195
  93. package/core/built/admin/assets/{ghost-dark-1e5bec737be037b1b5cb2a423603271d.css → ghost-dark-6385e71bb2c2fe3231b529c0e4eabbe6.css} +1 -1
  94. package/core/built/admin/assets/img/gradient-bg-e65f49b28dc4e02f7b2f78513b4d8bb6.png +0 -0
  95. package/core/built/admin/assets/koenig-lexical/index.css +1 -1
  96. package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +26725 -24064
  97. package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +175 -159
  98. package/core/built/admin/assets/{vendor-43a631b7c834235c4ff0b2186b5ca27d.js → vendor-f9bad0b8c0149699f84c0bd9d325068e.js} +267 -255
  99. package/core/built/admin/assets/videos/logo-loader-dark-d15e56e2b5cbcb6a6ac158488c4c6048.mp4 +0 -0
  100. package/core/built/admin/index.html +6 -6
  101. package/core/frontend/public/robots.txt +1 -0
  102. package/core/frontend/web/middleware/handle-image-sizes.js +5 -0
  103. package/core/server/data/db/ConnectionPoolInstrumentation.js +8 -8
  104. package/core/server/data/migrations/versions/5.81/2024-03-18-16-20-add-missing-post-permissions.js +20 -0
  105. package/core/server/data/schema/fixtures/fixtures.json +2 -2
  106. package/core/server/models/invite.js +1 -2
  107. package/core/server/models/settings.js +0 -10
  108. package/core/server/services/permissions/can-this.js +1 -15
  109. package/core/server/web/parent/app.js +7 -0
  110. package/core/server/web/parent/middleware/index.js +1 -0
  111. package/core/server/web/parent/middleware/queue-request.js +60 -0
  112. package/core/shared/labs.js +2 -1
  113. package/index.js +0 -5
  114. package/package.json +156 -156
  115. package/yarn.lock +293 -745
  116. package/components/tryghost-adapter-cache-memory-ttl-5.80.5.tgz +0 -0
  117. package/components/tryghost-adapter-manager-5.80.5.tgz +0 -0
  118. package/components/tryghost-announcement-bar-settings-5.80.5.tgz +0 -0
  119. package/components/tryghost-api-version-compatibility-service-5.80.5.tgz +0 -0
  120. package/components/tryghost-bookshelf-repository-5.80.5.tgz +0 -0
  121. package/components/tryghost-bootstrap-socket-5.80.5.tgz +0 -0
  122. package/components/tryghost-collections-5.80.5.tgz +0 -0
  123. package/components/tryghost-custom-theme-settings-service-5.80.5.tgz +0 -0
  124. package/components/tryghost-data-generator-5.80.5.tgz +0 -0
  125. package/components/tryghost-domain-events-5.80.5.tgz +0 -0
  126. package/components/tryghost-donations-5.80.5.tgz +0 -0
  127. package/components/tryghost-dynamic-routing-events-5.80.5.tgz +0 -0
  128. package/components/tryghost-email-analytics-service-5.80.5.tgz +0 -0
  129. package/components/tryghost-email-content-generator-5.80.5.tgz +0 -0
  130. package/components/tryghost-email-service-5.80.5.tgz +0 -0
  131. package/components/tryghost-email-suppression-list-5.80.5.tgz +0 -0
  132. package/components/tryghost-express-dynamic-redirects-5.80.5.tgz +0 -0
  133. package/components/tryghost-external-media-inliner-5.80.5.tgz +0 -0
  134. package/components/tryghost-ghost-5.80.5.tgz +0 -0
  135. package/components/tryghost-html-to-plaintext-5.80.5.tgz +0 -0
  136. package/components/tryghost-i18n-5.80.5.tgz +0 -0
  137. package/components/tryghost-link-replacer-5.80.5.tgz +0 -0
  138. package/components/tryghost-mail-events-5.80.5.tgz +0 -0
  139. package/components/tryghost-mailgun-client-5.80.5.tgz +0 -0
  140. package/components/tryghost-members-api-5.80.5.tgz +0 -0
  141. package/components/tryghost-members-csv-5.80.5.tgz +0 -0
  142. package/components/tryghost-members-events-service-5.80.5.tgz +0 -0
  143. package/components/tryghost-members-importer-5.80.5.tgz +0 -0
  144. package/components/tryghost-members-payments-5.80.5.tgz +0 -0
  145. package/components/tryghost-members-ssr-5.80.5.tgz +0 -0
  146. package/components/tryghost-mentions-email-report-5.80.5.tgz +0 -0
  147. package/components/tryghost-milestones-5.80.5.tgz +0 -0
  148. package/components/tryghost-minifier-5.80.5.tgz +0 -0
  149. package/components/tryghost-mw-api-version-mismatch-5.80.5.tgz +0 -0
  150. package/components/tryghost-mw-cache-control-5.80.5.tgz +0 -0
  151. package/components/tryghost-mw-session-from-token-5.80.5.tgz +0 -0
  152. package/components/tryghost-mw-update-user-last-seen-5.80.5.tgz +0 -0
  153. package/components/tryghost-mw-vhost-5.80.5.tgz +0 -0
  154. package/components/tryghost-nql-filter-expansions-5.80.5.tgz +0 -0
  155. package/components/tryghost-oembed-service-5.80.5.tgz +0 -0
  156. package/components/tryghost-package-json-5.80.5.tgz +0 -0
  157. package/components/tryghost-post-events-5.80.5.tgz +0 -0
  158. package/components/tryghost-post-revisions-5.80.5.tgz +0 -0
  159. package/components/tryghost-recommendations-5.80.5.tgz +0 -0
  160. package/components/tryghost-referrers-5.80.5.tgz +0 -0
  161. package/components/tryghost-session-service-5.80.5.tgz +0 -0
  162. package/components/tryghost-settings-path-manager-5.80.5.tgz +0 -0
  163. package/components/tryghost-slack-notifications-5.80.5.tgz +0 -0
  164. package/components/tryghost-stats-service-5.80.5.tgz +0 -0
  165. package/components/tryghost-update-check-service-5.80.5.tgz +0 -0
  166. package/components/tryghost-verification-trigger-5.80.5.tgz +0 -0
  167. package/components/tryghost-webmentions-5.80.5.tgz +0 -0
  168. package/newrelic.js +0 -53
  169. /package/core/built/admin/assets/{chunk.763.7849440ec6494d2449e9.js.LICENSE.txt → chunk.682.597be201dde4abdd4e68.js.LICENSE.txt} +0 -0
@@ -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%22cdnUrl%22%3A%22%22%2C%22editorUrl%22%3A%22%22%2C%22rootURL%22%3A%22%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%225.80%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22ember-websockets%22%3A%7B%22socketIO%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%2C%22editorFilename%22%3A%22koenig-lexical.umd.js%22%2C%22editorHash%22%3A%22c1a8c8a94f%22%2C%22adminXDemoFilename%22%3A%22admin-x-demo.js%22%2C%22adminXDemoHash%22%3A%2224dcc6aee2%22%2C%22adminXSettingsFilename%22%3A%22admin-x-settings.js%22%2C%22adminXSettingsHash%22%3A%2233f4aa4a54%22%7D" />
11
+ <meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22cdnUrl%22%3A%22%22%2C%22editorUrl%22%3A%22%22%2C%22rootURL%22%3A%22%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%225.81%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22ember-websockets%22%3A%7B%22socketIO%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%2C%22editorFilename%22%3A%22koenig-lexical.umd.js%22%2C%22editorHash%22%3A%22a4b7e8c0f1%22%2C%22adminXDemoFilename%22%3A%22admin-x-demo.js%22%2C%22adminXDemoHash%22%3A%2276d88862ac%22%2C%22adminXSettingsFilename%22%3A%22admin-x-settings.js%22%2C%22adminXSettingsHash%22%3A%225793443e3b%22%7D" />
12
12
 
13
13
  <meta name="HandheldFriendly" content="True" />
14
14
  <meta name="MobileOptimized" content="320" />
@@ -37,7 +37,7 @@
37
37
  </style>
38
38
 
39
39
  <link integrity="" rel="stylesheet" href="assets/vendor-0ede59da8efb5e28fa929557f7ff7154.css">
40
- <link integrity="" rel="stylesheet" href="assets/ghost-71cfcdf9410af9b3aec11a28f9a4130f.css" title="light">
40
+ <link integrity="" rel="stylesheet" href="assets/ghost-85d66247f3eb43a3d462b89c9280e805.css" title="light">
41
41
 
42
42
 
43
43
  </head>
@@ -56,9 +56,9 @@
56
56
 
57
57
  <div id="ember-basic-dropdown-wormhole"></div>
58
58
 
59
- <script src="assets/vendor-43a631b7c834235c4ff0b2186b5ca27d.js"></script>
60
- <script src="assets/chunk.763.7849440ec6494d2449e9.js"></script>
61
- <script src="assets/chunk.524.3d8d7c3975612d38f35d.js"></script>
62
- <script src="assets/ghost-1c39a8a5afc462b8b49fe2e99cdc4f2c.js"></script>
59
+ <script src="assets/vendor-f9bad0b8c0149699f84c0bd9d325068e.js"></script>
60
+ <script src="assets/chunk.682.597be201dde4abdd4e68.js"></script>
61
+ <script src="assets/chunk.524.a8bf57854398790b354d.js"></script>
62
+ <script src="assets/ghost-c3ba0161decd868a3a79d6f4264c3286.js"></script>
63
63
  </body>
64
64
  </html>
@@ -2,5 +2,6 @@ User-agent: *
2
2
  Sitemap: {{blog-url}}/sitemap.xml
3
3
  Disallow: /ghost/
4
4
  Disallow: /email/
5
+ Disallow: /members/api/comments/counts/
5
6
  Disallow: /r/
6
7
  Disallow: /webmentions/receive/
@@ -139,6 +139,11 @@ module.exports = function handleImageSizes(req, res, next) {
139
139
  if (err.code === 'SHARP_INSTALLATION' || err.code === 'IMAGE_PROCESSING' || err.errorType === 'NoContentError') {
140
140
  return redirectToOriginal();
141
141
  }
142
+
143
+ if (err.errorType === 'NotFoundError') {
144
+ return next();
145
+ }
146
+
142
147
  next(err);
143
148
  });
144
149
  };
@@ -24,7 +24,7 @@ class ConnectionPoolInstrumentation {
24
24
  this.createStartTimes[eventId] = Date.now();
25
25
  const poolMetrics = this.getPoolMetrics();
26
26
  this.logging.debug(`[ConnectionPool] Creating a connection. EventID: ${eventId} Pending Creates: ${poolMetrics.numPendingCreates} Free: ${poolMetrics.numFree} Used: ${poolMetrics.numUsed}`);
27
- this.metrics.metric('metrics-connection-pool', {
27
+ this.metrics.metric('connection-pool', {
28
28
  event: 'create-request',
29
29
  eventId,
30
30
  ...poolMetrics
@@ -37,7 +37,7 @@ class ConnectionPoolInstrumentation {
37
37
  // Delete the start time so we don't leak memory
38
38
  delete this.createStartTimes[eventId];
39
39
  this.logging.debug(`[ConnectionPool] Created a connection. EventID: ${eventId} Connection ID: ${resource.connectionId} Knex ID: ${resource.__knexUid} Time to Create: ${timeToCreate}ms`);
40
- this.metrics.metric('metrics-connection-pool', {
40
+ this.metrics.metric('connection-pool', {
41
41
  event: 'create-success',
42
42
  eventId,
43
43
  connectionId: resource.connectionId,
@@ -53,7 +53,7 @@ class ConnectionPoolInstrumentation {
53
53
  delete this.createStartTimes[eventId];
54
54
  const poolMetrics = this.getPoolMetrics();
55
55
  this.logging.error(`[ConnectionPool] Failed to create a connection. EventID: ${eventId} Time to Create: ${timeToFail}ms`, err);
56
- this.metrics.metric('metrics-connection-pool', {
56
+ this.metrics.metric('connection-pool', {
57
57
  event: 'create-fail',
58
58
  eventId,
59
59
  timeToFail,
@@ -66,7 +66,7 @@ class ConnectionPoolInstrumentation {
66
66
  this.requestStartTimes[eventId] = Date.now();
67
67
  const poolMetrics = this.getPoolMetrics();
68
68
  this.logging.debug(`[ConnectionPool] Acquiring a connection. EventID: ${eventId} Pending Acquires: ${poolMetrics.numPendingAcquires} Free: ${poolMetrics.numFree} Used: ${poolMetrics.numUsed}`);
69
- this.metrics.metric('metrics-connection-pool', {
69
+ this.metrics.metric('connection-pool', {
70
70
  event: 'acquire-request',
71
71
  eventId,
72
72
  ...poolMetrics
@@ -81,7 +81,7 @@ class ConnectionPoolInstrumentation {
81
81
  // Track when the connection was acquired for calculating lifetime upon release
82
82
  resource.connectionAcquired = Date.now();
83
83
  this.logging.debug(`[ConnectionPool] Acquired a connection. EventID: ${eventId} Connection ID: ${resource.connectionId} Knex Id: ${resource.__knexUid} Time to Acquire: ${timeToAcquire}ms`);
84
- this.metrics.metric('metrics-connection-pool', {
84
+ this.metrics.metric('connection-pool', {
85
85
  event: 'acquire-success',
86
86
  eventId,
87
87
  connectionId: resource.connectionId,
@@ -97,7 +97,7 @@ class ConnectionPoolInstrumentation {
97
97
  delete this.requestStartTimes[eventId];
98
98
  const poolMetrics = this.getPoolMetrics();
99
99
  this.logging.error(`[ConnectionPool] Failed to acquire a connection. EventID: ${eventId} Time to Acquire: ${timeToFail}ms`, err);
100
- this.metrics.metric('metrics-connection-pool', {
100
+ this.metrics.metric('connection-pool', {
101
101
  event: 'acquire-fail',
102
102
  eventId,
103
103
  timeToFail,
@@ -108,7 +108,7 @@ class ConnectionPoolInstrumentation {
108
108
  handleRelease(resource) {
109
109
  const lifetime = Date.now() - resource.connectionAcquired;
110
110
  this.logging.debug(`[ConnectionPool] Released a connection. Connection ID: ${resource.connectionId} Lifetime: ${lifetime}ms`);
111
- this.metrics.metric('metrics-connection-pool', {
111
+ this.metrics.metric('connection-pool', {
112
112
  event: 'release',
113
113
  connectionId: resource.connectionId,
114
114
  knexUid: resource.__knexUid,
@@ -139,4 +139,4 @@ class ConnectionPoolInstrumentation {
139
139
  }
140
140
  }
141
141
 
142
- module.exports = ConnectionPoolInstrumentation;
142
+ module.exports = ConnectionPoolInstrumentation;
@@ -0,0 +1,20 @@
1
+ const {combineTransactionalMigrations, addPermissionToRole} = require('../../utils');
2
+
3
+ module.exports = combineTransactionalMigrations(
4
+ addPermissionToRole({
5
+ permission: 'Edit posts',
6
+ role: 'Author'
7
+ }),
8
+ addPermissionToRole({
9
+ permission: 'Edit posts',
10
+ role: 'Contributor'
11
+ }),
12
+ addPermissionToRole({
13
+ permission: 'Delete posts',
14
+ role: 'Author'
15
+ }),
16
+ addPermissionToRole({
17
+ permission: 'Delete posts',
18
+ role: 'Contributor'
19
+ })
20
+ );
@@ -929,7 +929,7 @@
929
929
  "recommendation": ["browse", "read"]
930
930
  },
931
931
  "Author": {
932
- "post": ["browse", "read", "add"],
932
+ "post": ["browse", "read", "edit", "add", "destroy"],
933
933
  "setting": ["browse", "read"],
934
934
  "slug": "all",
935
935
  "tag": ["browse", "read", "add"],
@@ -946,7 +946,7 @@
946
946
  "recommendation": ["browse", "read"]
947
947
  },
948
948
  "Contributor": {
949
- "post": ["browse", "read", "add"],
949
+ "post": ["browse", "read", "edit", "add", "destroy"],
950
950
  "setting": ["browse", "read"],
951
951
  "slug": "all",
952
952
  "tag": ["browse", "read"],
@@ -93,8 +93,7 @@ Invite = ghostBookshelf.Model.extend({
93
93
  } else if (_.some(loadedPermissions.user.roles, {name: 'Editor'})) {
94
94
  allowed = ['Author', 'Contributor'];
95
95
  }
96
- }
97
- if (loadedPermissions.apiKey) {
96
+ } else if (loadedPermissions.apiKey) {
98
97
  allowed = ['Editor', 'Author', 'Contributor'];
99
98
  }
100
99
 
@@ -324,16 +324,6 @@ Settings = ghostBookshelf.Model.extend({
324
324
  return allSettings;
325
325
  },
326
326
 
327
- permissible: function permissible(modelId, action, context, unsafeAttrs, loadedPermissions, hasUserPermission, hasApiKeyPermission) {
328
- if (hasUserPermission && hasApiKeyPermission) {
329
- return Promise.resolve();
330
- }
331
-
332
- return Promise.reject(new errors.NoPermissionError({
333
- message: tpl(messages.notEnoughPermission)
334
- }));
335
- },
336
-
337
327
  validators: {
338
328
  async all(model) {
339
329
  const settingName = model.get('key');
@@ -59,26 +59,12 @@ class CanThisResult {
59
59
  let hasMemberPermission = false;
60
60
 
61
61
  const checkPermission = function (perm) {
62
- let permObjId;
63
-
64
62
  // Look for a matching action type and object type first
65
63
  if (perm.get('action_type') !== actType || perm.get('object_type') !== objType) {
66
64
  return false;
67
65
  }
68
66
 
69
- // Grab the object id (if specified, could be null)
70
- permObjId = perm.get('object_id');
71
-
72
- // If we didn't specify a model (any thing)
73
- // or the permission didn't have an id scope set
74
- // then the "thing" has permission
75
- if (!modelId || !permObjId) {
76
- return true;
77
- }
78
-
79
- // Otherwise, check if the id's match
80
- // TODO: String vs Int comparison possibility here?
81
- return modelId === permObjId;
67
+ return true;
82
68
  };
83
69
 
84
70
  if (loadedPermissions.user && _.some(loadedPermissions.user.roles, {name: 'Owner'})) {
@@ -23,6 +23,13 @@ module.exports = function setupParentApp() {
23
23
  // @TODO: figure out if this is really needed everywhere? Is it not frontend only...
24
24
  parentApp.use(mw.ghostLocals);
25
25
 
26
+ // Enable request queuing if configured
27
+ const queueConfig = config.get('optimization:requestQueue');
28
+
29
+ if (queueConfig?.enabled === true) {
30
+ parentApp.use(mw.queueRequest(queueConfig));
31
+ }
32
+
26
33
  debug('ParentApp setup end');
27
34
 
28
35
  return parentApp;
@@ -2,5 +2,6 @@ module.exports = {
2
2
  emitEvents: require('./emit-events'),
3
3
  ghostLocals: require('./ghost-locals'),
4
4
  logRequest: require('./log-request'),
5
+ queueRequest: require('./queue-request'),
5
6
  requestId: require('./request-id')
6
7
  };
@@ -0,0 +1,60 @@
1
+ const errors = require('@tryghost/errors');
2
+ const logging = require('@tryghost/logging');
3
+ const path = require('node:path');
4
+ const expressQueue = require('express-queue');
5
+
6
+ const debug = (message) => {
7
+ logging.debug(`[queue-request] ${message}`);
8
+ };
9
+
10
+ module.exports = function queueRequest(
11
+ config,
12
+ queueFactory = expressQueue
13
+ ) {
14
+ if (config.concurrencyLimit === undefined) {
15
+ throw new errors.IncorrectUsageError({
16
+ message: 'concurrencyLimit must be defined when using queueRequest middleware'
17
+ });
18
+ }
19
+
20
+ debug(`Initialising queueRequest middleware with config: ${JSON.stringify(config)}`);
21
+
22
+ // @see https://github.com/alykoshin/express-queue#usage
23
+ const queue = queueFactory({
24
+ activeLimit: config.concurrencyLimit,
25
+ queuedLimit: -1 // Do not limit the number of queued requests
26
+ });
27
+
28
+ /**
29
+ * Available events:
30
+ * - queue - when a request is queued
31
+ * - dequeue - when a request is dequeued
32
+ * - process - when a request is being processed
33
+ * - reject - when a request is rejected
34
+ * - cancel - when a request is cancelled
35
+ * - complete - when a request has completed
36
+ *
37
+ * @see https://github.com/search?q=repo:alykoshin/mini-queue%20job._toState&type=code
38
+ */
39
+ queue.queue.on('queue', (job) => {
40
+ debug(`Request queued: ${job.data.req.path}`);
41
+
42
+ job.data.req.queueDepth = job.queue.getLength();
43
+ });
44
+
45
+ queue.queue.on('complete', (job) => {
46
+ debug(`Request completed: ${job.data.req.path}`);
47
+ });
48
+
49
+ return (req, res, next) => {
50
+ // Do not queue requests for static assets - We assume that any path
51
+ // with a file extension is a static asset
52
+ if (path.extname(req.path)) {
53
+ debug(`Request for assumed static asset skipping queue: ${req.path}`);
54
+
55
+ return next();
56
+ }
57
+
58
+ return queue(req, res, next);
59
+ };
60
+ };
@@ -48,7 +48,8 @@ const ALPHA_FEATURES = [
48
48
  'importMemberTier',
49
49
  'lexicalIndicators',
50
50
  // 'adminXOffers',
51
- 'adminXDemo'
51
+ 'adminXDemo',
52
+ 'onboardingChecklist'
52
53
  ];
53
54
 
54
55
  module.exports.GA_KEYS = [...GA_FEATURES];
package/index.js CHANGED
@@ -1,6 +1 @@
1
- // Load New Relic
2
- if (process.env.PRO_ENV) {
3
- require('newrelic');
4
- }
5
-
6
1
  require('./ghost');