Commit Graph

3295 Commits

Author SHA1 Message Date
renovate[bot]
979e704410 Update dependency express to v4.20.0 2024-09-11 08:21:15 +02:00
renovate[bot]
137a0b6aba Update dependency yjs to v13.6.19 2024-09-10 14:43:10 +00:00
renovate[bot]
d3cf1045f5 Update dependency body-parser to v1.20.3 2024-09-10 00:22:39 +00:00
renovate[bot]
c96744156e
Update dependency @playwright/test to v1.46.1 (#20866) 2024-09-06 10:35:50 -07:00
Ghost CI
18cc8dc7fb v5.94.0 2024-09-06 15:05:07 +00:00
Chris Raible
ee514a397c
Added configurable target delivery window for batch sending (#20719)
ref
https://linear.app/tryghost/issue/ONC-217/implement-the-deliverytime-option-in-mailgun-api-calls

Ghost experiences its highest peak load immediately after sending out a
newsletter, as it recieves an influx of traffic from users clicking on
the links in the email, a burst of email analytics events to process
from mailgun, and an increase in organic traffic to the site's frontend
as well as the admin analytics pages. The `BatchSendingService`
currently sends all the batches to Mailgun as quickly as possible, which
may contribute to higher peak loads.

This commit adds a `deliverytime` parameter to our API calls to Mailgun,
which allows us to specify a time in the future when we want the email
to be delivered. This will allow us to moderate the rate at which emails
are delivered, and in turn that should moderate the peak traffic volume
that Ghost receives in the first 2-3 minutes after sending an email.

The `deliverytime` is calculated based on a configurable parameter:
`bulkEmail.targetDeliveryWindow`, which specifies the maximum allowable
time (in milliseconds) after the email is first sent for Ghost to
instruct Mailgun to deliver the emails. Ghost will attempt to space out
all the batches as evenly as possible throughout the specified window.
For example, if the targetDeliveryWindow is set to `300000` (5 minutes)
and there are 100 batches, Ghost will set the `deliveryTime` for each
batch ~3 seconds apart.
2024-09-05 22:28:40 -07:00
Chris Raible
55e6166618
Removed retries from batch sending tests (#20934)
no issue

- These retries were added a while ago when these tests were flaking in
CI, but this only serves to cover up any potential problems with these
tests or the code they are testing
- Ran these tests in CI three times in a row without them failing, so I
don't think the retries are necessary
2024-09-05 16:29:16 -07:00
Chris Raible
289b18c01f
Fixed dependency between tests in batch sending integration tests (#20932)
no issue

- One of the tests in this suite added a member and didn't clean it up
when it was finished.
- Because of this, the tests after this one depended on this test
running first, so running an individual test in isolation might fail,
despite passing when run in the whole test suite
- This commit removes the added member, so all the tests in this suite
should pass whether run independently or all together
2024-09-05 13:37:06 -07:00
Kevin Ansfield
0b5f26ab97 🐛 Fixed "Unsaved changes" modal showing for some published posts with images
closes https://linear.app/tryghost/issue/ENG-1532

- bumps Koenig to version that doesn't re-populate image node dimensions when they already exist
2024-09-05 17:19:10 +01:00
Sam Lord
46a4f7bc36
Added middleware to prevent other sites' content from being served (#20922)
ref ONC-294

---------

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2024-09-05 17:15:09 +01:00
Steve Larson
a47298a75c
Reimplemented email analytics prioritizing email opens (#20914)
ref https://github.com/TryGhost/Ghost/pull/20835
- reimplemented email analytics changes that prioritized opened events
over other events in order to speed up open analytics
- added db persistence to fetch missing job to ensure we re-fetch every
window of events, especially important if we restart following a large
email batch

We learned a few things with the previous trial run of this. Namely,
that event throughput is not as high as we initially saw in the data for
particularly large databases. This set of changes is more conservative,
while a touch more complicated, in ensuring we capture edge cases for
really large newsletter sends (100k+ members).

In general, we want to make sure we're fetching new open events at least
every 5 mins, and often much faster than that, unless it's a quiet
period (suggesting we haven't had a newsletter send or much outstanding
event data).
2024-09-05 08:10:07 -05:00
Princi Vershwal
426b1d4d93
🐛 Fixed bookmark card hot linking icons and thumbnails (#20923)
Ref:
https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons
2024-09-05 16:09:17 +05:30
renovate[bot]
2faa051c9b
Update Koenig packages (#20925) 2024-09-05 13:29:53 +05:30
Princi Vershwal
77cfa39eec
Revert Fetch and store icons and thumbnails ENG-904 (#20920)
Reverting this as there is an issue with the urls stored in db. Details
in the
[thread](https://ghost.slack.com/archives/C02G9E68C/p1725445854035799)
2024-09-04 11:10:23 +00:00
Princi Vershwal
b6407f2d45
🐛 Fixed bookmark card hot linking icons and thumbnails ENG-904 (#20906)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons

Bookmark cards' icons and thumbnails are not fetched and stored in our storage.
2024-09-04 12:33:14 +05:30
Ghost CI
fb0f7d284a v5.93.0 2024-09-03 20:25:25 +00:00
Kevin Ansfield
013041304e 🐛 Fixed Tips & Donations checkout error for sites with long titles
ref https://linear.app/tryghost/issue/ONC-296

Our `stripe_prices.nickname` field had a length of 50 chars which meant we could error out trying to save a donation Stripe price with a generated product nickname containing a long site title.

- updated db schema and added a migration to change column length to 255
- added truncation to nickname generation to enforce a limit of 250 chars to match Stripe's limit
2024-09-03 21:08:24 +01:00
renovate[bot]
67291056b0
Update Koenig packages (#20911)
Ref: https://linear.app/tryghost/issue/ENG-1435/threads-embeds-contain-broken-images

Fixed broken Thumbnails and Icons
2024-09-03 16:13:13 +00:00
Ghost CI
4ce116d5fb v5.92.0 2024-09-03 15:21:50 +00:00
Kevin Ansfield
1bc34f7227 Added Tips & Donations one-off payments
no issue

Give your audience a simple way to support your work with one-time payments, no membership required.

- cleaned up `tipsAndDonations` labs flag
2024-09-03 16:00:48 +01:00
Kevin Ansfield
73d75413a0
🎨 Convert portal links to relative to avoid homepage flash on click (#20896)
closes https://linear.app/tryghost/issue/PLG-190

- often when adding portal links to your own site pages the URLs are added as absolute on the site's homepage due to copy+paste from displayed URLs in Admin
- when clicking absolute portal URLs the homepage is first loaded before the Portal popup is shown resulting in a slower and flashier experience
- added a transform for all local portal URLs on the page when Portal is initialized so links open the Portal popup immediately on the current page
2024-09-02 11:23:12 +00:00
Kevin Ansfield
9467ffadb5 Removed sqlite skip in recommendation email test
no issue

- test runs OK locally in SQLite
- enabling it to run eliminates a potential tripping point when generating updated snapshots locally
2024-09-02 11:16:02 +01:00
Daniel Lockyer
0f8fd441c7 Renamed ghost:build to ghost:build:assets
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- this was previously causing duplicate builds of the TS projects
  because Nx was building all projects with `build` targets, and we were
  also calling `build:ts`
- this cuts 12 compilation jobs from the archive process, which should
  help with container build times
2024-09-02 09:08:47 +02:00
Ghost CI
bf4e6600a9 v5.91.0 2024-08-30 15:05:40 +00:00
Hannah Wolfe
f79f5471b4
Added stats tracker script to ghost head (#20881)
closes
https://linear.app/tryghost/issue/ANAL-9/initial-tracker-in-ghost-head

- Given that all of the correct config is in place, output a tracking
script
- This allows us to send pageview events into tinybird
- All of the details (location of the script, destination etc) are kept
in config so that it's easy to change for different environments
2024-08-29 21:40:41 +01:00
Sodbileg Gansukh
d30164df97
Improved publishing flow (#20878)
ref DES-706

* After a user publishes or schedules a post, they are directed to the post list
* If a post is sent as an email, they are directed to the Analytics page
* In both cases, a confirmation modal is shown
* If a post is published, they can share it directly from the confirmation modal
* Added a "Share" button and some additional functions (view, edit, and delete post) to
published posts in post analytics
* Added a manual "Refresh" button to post analytics so that there is
no need to reload the whole app to update the data

---------

Co-authored-by: Sag <guptazy@gmail.com>
2024-08-29 21:17:16 +02:00
Steve Larson
c2ae91e4db
Added config flag to disable recommendations service (#20879)
no ref

This service can get rather noisy when doing local development with our
data generator, as we do not use real urls, and therefore generate a lot
of not found errors in the console.
2024-08-29 17:51:23 +00:00
Sanne de Vries
b79534387d Updated notification email mobile styles
ref https://linear.app/tryghost/issue/PLG-200
2024-08-29 17:15:45 +01:00
Hannah Wolfe
3e25370ebe
Added initial stats config to API (#20875)
closes https://linear.app/tryghost/issue/ANAL-8/flag-and-config

- This checks if tinybird:stats is set, and if so passes through the
config that is set via the config API
- This is used by Ghost admin to configure where to pull charts from
2024-08-29 11:37:28 +01:00
Daniel Lockyer
0a6cd75993 Gated NestJS framework behind environment variable
- we added NestJS to Ghost as a way forwards for a new framework within
  Ghost but we haven't added much to it
- requiring all the NestJS code adds about 6-9% to our boot time, so if
  we're not using it, it's just time we're burning for no benefit
- for now, I've gated this behind an env var to prevent it from loading
- we can't use labs flags in the boot process, so I've gone for an env
  var
2024-08-29 12:18:42 +02:00
Fabien O'Carroll
2d00d5ca0e Fixed welcome email being sent for Admin API creates
ref https://linear.app/tryghost/issue/ONC-274

This fix is done at the endpoint layer, which isn't ideal, but has the smallest
surface area for the change. I think we may want to move it up a layer though,
despite the extra complications. If we move the check _into_ the MembersAPI
class however, we start to run into issues with circular dependncies due to the
mess that is our dependency injection approach with the Members service
2024-08-29 16:05:27 +07:00
Fabien O'Carroll
3adc0c0441 Added breaking test for sending welcome emails
ref https://linear.app/tryghost/issue/ONC-274

This test checks that a welcome email is not sent when adding a member via the
Admin API if the site is in need of email verification, regardless of whether
or not the flag to send an email is set.

It is currently failing to demonstrate the whole in our logic.
2024-08-29 16:05:27 +07:00
Fabien O'Carroll
b012da023d Cleaned up settings cache after test
All tests after this one were in a non-sending email state, which luckily
doesn't affect these tests, but it will affect future ones! This just cleans up
the settings so that they're back to a standard default.
2024-08-29 16:05:27 +07:00
Hannah Wolfe
0a7093b7dd
Updated Config API testing to use snapshot + unit tests (#20854)
- Swap the e2e config API test to use our newer framework, and match against a
snapshot for the default case
- Move the individual test cases to unit tests (new file) - there are more to add
here, but this is parity with what we had before
- We use unit tests for checking through various cases for how config
changes modify the output as this is faster and more explicit
2024-08-28 14:29:17 +01:00
Hannah Wolfe
ac345aa84d Removed unused billing url from config API
ref 40cedb84ff (diff-dba52cb217f89ed45931ded5618ce83294fc32cf4a8dec73aa605c65441331b3R43)
ref 639be25f1d/ghost/core/core/server/api/endpoints/utils/serializers/output/config.js

- This was moved under hostSettings very early on in development and should have been cleaned up
- As this property wasn't listed in the output serializer, we know it's not being used anywhere
- We can see from the limit code that it looks for hostSettings.billing.url
2024-08-28 13:49:13 +01:00
Hannah Wolfe
9e45822dbb
Removed unused items from config API (#20851)
ref 
639be25f1d
ref
f705dda314

- These items are never returned from the API as they've been removed
from the serializer
- The tests also check that they are not present
- They were removed by the referenced commits, which changed how these
things were built
2024-08-28 13:25:05 +01:00
Ronald Langeveld
e8e1b8ea2f
Added donation message to Stripe and Email (#20828)
ref PLG-160

- Refactored donation handling logic to be processed within the
`checkout.session.completed` webhook event.
- Added support for capturing and storing donation messages from Stripe
sessions.
- Integrated donation messages into the email notifications sent to
staff.
- Added database integration.
- Removed redundant donation logic from the invoice.payment_succeeded
webhook, since custom fields isn't supported.
- Updated and added new tests

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2024-08-28 21:08:42 +09:00
Kevin Ansfield
32edc12cc2 Fixed error closing donation success modal
no issue

- when redirecting from Stripe back to Ghost after making a donation the URL contained a double slash (`//#/portal/...`) which triggered browser security errors when Portal modified the browser history stack when navigating
- the above could prevent the donation success modal from closing
2024-08-28 12:38:14 +01:00
renovate[bot]
1871269e8f
Update Koenig packages (#20849)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-28 13:10:57 +02:00
renovate[bot]
cfda52ead2 Update dependency gscan to v4.43.3 2024-08-28 10:10:54 +02:00
Ronald Langeveld
41e696f00f
Added migration to include donation_message in donation_payment_events (#20839)
ref PLG-197

- DB migration to add `donation_message` to `donation_payment_events`
table
2024-08-28 15:58:11 +09:00
Steve Larson
962194b595
Bumped Portal (#20837)
no ref
2024-08-27 21:29:40 +00:00
Ghost CI
291d48ecb7 Merged v5.90.2 into main 2024-08-27 21:29:17 +00:00
Ghost CI
eaf414a2de v5.90.2 2024-08-27 21:29:15 +00:00
Steve Larson
ae15e12ffc Reverted email analytics jobs commits (#20835)
ref https://linear.app/tryghost/issue/ENG-1518

After releasing the analytics job improvements, it appears for large
sites we're awfully close to missing some Mailgun events because of an
unexpected behavior of the aggregateStats call for just the opened
events job. This is taking 2-5x(+) the amount of time that the aggregate
queries take for the other jobs, despite not being dependent on the
events.

To err on the side of caution, we're going to roll this back and look to
optimize the aggregation queries before re-implementing. And we may be a
bit more cautious in giving _some_ but not _all_ priority to the
`opened` events.
2024-08-27 16:16:07 -05:00
Steve Larson
8f3985bc66
Reverted email analytics jobs commits (#20835)
ref https://linear.app/tryghost/issue/ENG-1518

After releasing the analytics job improvements, it appears for large
sites we're awfully close to missing some Mailgun events because of an
unexpected behavior of the aggregateStats call for just the opened
events job. This is taking 2-5x(+) the amount of time that the aggregate
queries take for the other jobs, despite not being dependent on the
events.

To err on the side of caution, we're going to roll this back and look to
optimize the aggregation queries before re-implementing. And we may be a
bit more cautious in giving _some_ but not _all_ priority to the
`opened` events.
2024-08-27 16:15:34 -05:00
Kevin Ansfield
709ee163e3 Bumped Portal
ref https://linear.app/tryghost/issue/PLG-152

- updates tips and donations success states
2024-08-27 19:30:27 +01:00
Kevin Ansfield
f613f42bec Updated donation success states
closes https://linear.app/tryghost/issue/PLG-152

- switched member success to a notification
- updated non-member success modal to include signup and signin links
2024-08-27 19:30:27 +01:00
Daniel Lockyer
2757ef70fa Revert "🐛 Fixed frontend routing prioritizing collections over built in routes (#20765)"
refs https://app.incident.io/ghost/incidents/102

- this reverts commit c0471f0c28
2024-08-27 18:04:27 +02:00
Daniel Lockyer
d5bac91feb
Revert "🐛 Fixed frontend routing prioritizing collections over built in routes (#20765)"
This reverts commit c0471f0c28.
2024-08-27 17:31:08 +02:00