Commit Graph

14506 Commits

Author SHA1 Message Date
Daniel Lockyer
3067fbe97c v4.20.2 2021-10-25 08:19:06 +01:00
Daniel Lockyer
6d9ee79ad8 Updated Admin to v4.20.2 2021-10-25 08:19:06 +01:00
Renovate Bot
54dba233f6
Update metascraper to v5.25.0 2021-10-25 03:52:14 +00:00
Daniel Lockyer
dfe207812d v4.20.1 2021-10-22 20:08:55 +01:00
Daniel Lockyer
85911658b3 Updated Admin to v4.20.1 2021-10-22 20:08:55 +01:00
Kevin Ansfield
a485509a2f
🐛 Fixed GA labs flags not appearing enabled in settings API (#13681)
no issue

The way GA flags were introduced means that they stop existing in the `'labs'` setting in the db and are instead forced to always return `true` when checking the flag in the labs service. However, Admin which uses the flags fetches them via the `/settings/` API endpoint which was only returning the raw labs setting db value meaning GA flags appeared to be disabled unless the flag had previously been enabled and no settings save had occured.

- updated the settings bread service to replace the labs setting value with the JSON stringified output of `labs.getAll()` which is the ultimate source-of-truth for a feature being enabled/disabled
  - extracted `browse()` behaviour to an internal `_formatBrowse()` method so we can apply the same filtering/modification for output of `browse()` and `edit()`

Co-authored-by: Fabien O'Carroll <fabien@allou.is>
2021-10-22 19:59:13 +01:00
Renovate Bot
3b773c2ab5
Update dependency oembed-parser to v1.4.9 2021-10-22 16:21:39 +00:00
Daniel Lockyer
9eaada9384 v4.20.0 2021-10-22 17:19:48 +01:00
Daniel Lockyer
0e844989f1 Updated Admin to v4.20.0 2021-10-22 17:19:47 +01:00
Fabien O'Carroll
f3bb6b43a5 Added Offers feature to Ghost
refs https://github.com/TryGhost/Team/issues/1115

This allows users to create Offers for Tier/Cadence pairs in order to
provide discounted subscriptions to Members! We have support for
percentage based discounts & fixed price discounts, either for the first
payment, all payments, or a number of monthly payments.

Offers also have a code, which can be used as an easy way to share them,
as visiting https://site.com/offer-code will automatically open Portal
with the Offer prepopulated.
2021-10-22 17:55:34 +02:00
Fabien O'Carroll
c3694c9903 Improved error messages for Offers API
no-issue

The error messages for duplicate Offer name and code were not
particularly helpful. This includes an update to them based on feedback
from Peter.
2021-10-22 16:50:48 +02:00
Fabien O'Carroll
696d8e3c49 Added 404 handling for edit Offer
no-issue

This was also missing as part of the Offers API.
2021-10-22 16:16:39 +02:00
Kevin Ansfield
a6982d5606
Added ability for themes to define custom settings (#13661)
closes https://github.com/TryGhost/Team/issues/1164

Themes can now define custom settings via their `package.json` file, and use them in templates via `@custom.{setting}`. Values for custom settings can be changed by site owners through a redesigned "Design settings" area in the admin interface.

Full announcement, documentation, and examples will be made available soon.

Co-authored-by:
- Sanne de Vries (@sanne-san)
- Thibaut Patel (@tpatel)
2021-10-22 15:02:16 +01:00
Renovate Bot
b2e95ba12a Update dependency @tryghost/metrics to v0.2.6 2021-10-22 15:50:35 +02:00
Renovate Bot
b467d45c5c Update dependency @tryghost/image-transform to v1.0.17 2021-10-22 15:47:28 +02:00
Renovate Bot
0bacf3ef69 Update dependency @tryghost/config-url-helpers to v0.1.3 2021-10-22 15:45:52 +02:00
Renovate Bot
e188c6bd9f Update dependency @tryghost/zip to v1.1.18 2021-10-22 15:45:12 +02:00
Renovate Bot
e7e1568a9c Update dependency @tryghost/mw-session-from-token to v0.1.26 2021-10-22 15:44:28 +02:00
Renovate Bot
9e5de91dc1 Update dependency @tryghost/limit-service to v0.6.5 2021-10-22 15:43:14 +02:00
Renovate Bot
742b5f7dd3 Update dependency @tryghost/package-json to v1.0.6 2021-10-22 15:41:53 +02:00
Renovate Bot
2208ae1655 Update dependency @tryghost/security to v0.2.13 2021-10-22 15:41:43 +02:00
Kevin Ansfield
0c6cd37679 Fixed missing space between authors in emails
no issue

- author line was appearing as "Author One,Author Two,..." with no space
- fixed the generation of `post.authors` when serializing a post before it's rendered for email
2021-10-22 14:41:15 +01:00
Renovate Bot
0e4be5a390 Update dependency @tryghost/job-manager to v0.8.11 2021-10-22 15:39:15 +02:00
Daniel Lockyer
e834904125
Fixed verification threshold when set to 0
no issue

- if the verification threshold is 0, `_.get(..)` becomes falsy so we
  fallback to Infinity
- this is not correct - we only want to default to Infinity if the value
  is not set
- this commit explicitly compares the config value to `undefined` and sets
  the fallback accordingly
2021-10-22 15:33:59 +02:00
Kevin Ansfield
d7fbf94d91
Fixed ETag header for admin templates not changing between versions (#13680)
refs https://github.com/TryGhost/Team/issues/1175

We found the ETag header sent when serving the Admin template for /ghost/ was not changing between versions which after an upgrade could result in out of date cached content being served containing links to JS/CSS files that no longer existed.

The culprit is weak etags served by Node's `send` package, coupled with Admin template filesize not changing between versions and `npm pack` setting a fixed modification date for every file. See https://github.com/pillarjs/send/issues/176 for more details.

- updated the Admin app's controller to read the template and generate an md5 hash of the contents so we can serve a strong ETag header value when serving the `/ghost/` html
2021-10-22 14:25:58 +01:00
Renovate Bot
cceda95ba0 Update dependency @tryghost/bootstrap-socket to v0.2.13 2021-10-22 15:21:54 +02:00
Renovate Bot
7b43e30d8e Update dependency @tryghost/adapter-manager to v0.2.18 2021-10-22 15:04:47 +02:00
Renovate Bot
d842259f22 Update dependency @tryghost/errors to v0.2.17 2021-10-22 15:04:38 +02:00
Renovate Bot
da6a66c777 Update dependency @tryghost/constants to v0.1.12 2021-10-22 15:04:30 +02:00
Renovate Bot
ff09230382 Update dependency @tryghost/promise to v0.1.13 2021-10-22 15:04:10 +02:00
Renovate Bot
51d6cf3922 Update dependency @tryghost/session-service to v0.1.28 2021-10-22 15:03:59 +02:00
Renovate Bot
b57dcf9a98 Update dependency @tryghost/vhost-middleware to v1.0.19 2021-10-22 15:03:47 +02:00
Fabien O'Carroll
363eb94aee Handled 404 for Offer not found
no-issue

This was missing handling! We need to throw a NotFoundError so we
return with the correct response.
2021-10-22 14:22:33 +02:00
Fabien O'Carroll
70f7039539 Handled empty Offer titles
no-issue

We want to allow for Offers titles to be blank/empty. This updates the
API to handle both null & empty strings for the Offer title.
2021-10-22 14:18:01 +02:00
Fabien 'egg' O'Carroll
d962f0e18e
Removed NOT NULL constraint from portal_title (#13659)
refs https://github.com/TryGhost/Team/issues/1163

We want to make the title for Offers optional, our nullable validation
means that we cannot store an empty string, so we must remove the NOT
NULL constraint from the column if we want to store either an empty
value or null.

There is a bug with editing columns in SQLite with `knex` which strips all
the indexes, so we have to manually add them afterwards.
2021-10-22 14:14:49 +02:00
Renovate Bot
4d56e9a7af Update dependency @tryghost/version to v0.1.7 2021-10-22 13:22:24 +02:00
Renovate Bot
8a6640d00f Update dependency @tryghost/request to v0.1.8 2021-10-22 13:08:36 +02:00
Renovate Bot
6d2de5b369 Update dependency @tryghost/debug to v0.1.9 2021-10-22 13:08:28 +02:00
Renovate Bot
2deb396291 Update dependency @tryghost/metrics to v0.2.5 2021-10-22 13:00:59 +02:00
Renovate Bot
f82f52a9e7 Update dependency @tryghost/bookshelf-plugins to v0.3.4 2021-10-22 13:00:17 +02:00
Renovate Bot
2ea8c5ee5b Update dependency @tryghost/validator to v0.1.8 2021-10-22 12:59:45 +02:00
Renovate Bot
842c850534 Update dependency @tryghost/nodemailer to v0.3.6 2021-10-22 12:27:45 +02:00
Renovate Bot
fe191a0f96 Update dependency @tryghost/root-utils to v0.3.7 2021-10-22 12:25:56 +02:00
Renovate Bot
113e01c2c4 Update dependency @tryghost/tpl to v0.1.8 2021-10-22 12:25:42 +02:00
renovate[bot]
c95ce4c685
Update dependency @tryghost/members-csv to v1.1.8 (#13642)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-22 12:03:56 +02:00
renovate[bot]
967f34f4e0
Update dependency @tryghost/express-dynamic-redirects to v0.2.1 (#13640)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-22 11:18:24 +02:00
renovate[bot]
be100d24ce
Update dependency @tryghost/magic-link to v1.0.14 (#13641)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-22 11:18:11 +02:00
renovate[bot]
cafbd01611
Update dependency @tryghost/members-importer to v0.3.4 (#13643)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-10-22 11:17:53 +02:00
Daniel Lockyer
ed6a8dca76 Inlined package requires to save boot time and memory
no issue

- following on from f4fb0fcbaa,
  this commit moves around some package requires in Ghost
- these are often niche packages that do something in a subsystem of
  Ghost, and are not necessarily be needed to boot the application
- these packages use non-negligible CPU and memory when they are
  required, so it makes sense to lazy-require them
- the concern here is that we obscure the code too much by moving
  random requires further into code, but the changes are small and the
  improvements big
- this commit bring the boot time since 4.19.0 down ~31% and initial
  memory usage down by a total of ~12%
2021-10-22 09:57:59 +02:00
Renovate Bot
a2b4ccb0ad Update dependency @tryghost/email-analytics-provider-mailgun to v1.0.4 2021-10-22 08:54:28 +02:00