Commit Graph

3170 Commits

Author SHA1 Message Date
Ghost CI
d0db527b8d v5.88.0 2024-07-19 16:04:20 +00:00
Ghost CI
db9bf51091 🎨 Updated Source to v1.3.2 2024-07-19 16:04:20 +00:00
Sodbileg Gansukh
87c12b5113
Fixed blockquote horizontal spacing on Outlook (#20625)
ref DES-571

- padding does not work well with paragraph inside blockquote as
horizontal spacing on Outlook
- using margin instead of padding makes sure the spacing is consistent
across Outlook versions
2024-07-18 21:01:43 +08:00
Kevin Ansfield
170fba0962 Enforced nested <p> when rendering <blockquote> for Aside nodes in email
closes https://linear.app/tryghost/issue/ENG-1432

- bumps `kg-lexical-html-render` package with required rendering change
2024-07-18 13:30:10 +01:00
Sodbileg Gansukh
7d2787aa32
Fixed blockquote spacing on iOS Mail app (#20621)
ref DES-571

- iOS Mail app ignores spacing on the \<blockquote\> element, but will
respect spacing on the \<p\> element inside it
- for that reason, we started to enforce always rendering \<p\> inside
\<blockquote\> for emails
- these changes move the spacing related styles from blockquote to p
inside
2024-07-18 20:10:29 +08:00
Kevin Ansfield
7488e2e7b2 Enforced nested <p> when rendering <blockquote> in email
closes https://linear.app/tryghost/issue/ENG-1432

- bumps `kg-lexical-html-render` package with required rendering change
- bumps `koenig-lexical` with TypeError fix and improved handling of failed image uploads
- bumps other packages that were missed from previous bumps, fixes split versions of underlying lexical packages
2024-07-18 12:10:58 +01:00
Steve Larson
809e987f32
Extended timeouts on image size test (#20616)
ref e626dd9

There has been some flakiness in Github CI with the new tests for the
probe library. We'll start with extending timeouts in case CI is running
particularly slowly.
2024-07-17 12:07:23 +00:00
Ghost CI
7d8c76d82e Merged v5.87.3 into main 2024-07-17 11:51:32 +00:00
Ghost CI
a7e1d57c4a v5.87.3 2024-07-17 11:51:30 +00:00
Michael Barrett
316a87e7c9
Reverted "Added custom redirects ReDoS validation" (#20614)
Reverts TryGhost/Ghost#20515

This is being reverted due to the validation being run on boot causing custom
redirects to not be loaded
2024-07-17 12:37:19 +01:00
Michael Barrett
63e64686ef
Reverted "Added custom redirects ReDoS validation" (#20614)
Reverts TryGhost/Ghost#20515

This is being reverted due to the validation being run on boot causing custom
redirects to not be loaded
2024-07-17 12:29:05 +01:00
renovate[bot]
b31e196368 Update dependency mysql2 to v3.10.3 2024-07-15 23:08:04 +00:00
Sag
e476eebd2d
🎨 Added staff notification when a sub is canceled due to failed payments (#20534)
ref https://linear.app/tryghost/issue/ENG-1254

- when a subscription is canceled automatically by Stripe (e.g. due to
multiple failed payments), we now send a staff notification
- logic before: if a member cancels a sub in Portal, then send a staff
notification
- logic now: if a subscription was active, but is now set to cancel
immediately or at the end of the billing period, then send a staff
notification.
- with that logic change, we now send a cancellation staff notification
when:
    1. A member cancels their sub in Portal (existing)
    2. A staff member cancels a member sub in Stripe (new)
    3. A staff member cancels a member sub in Admin (new)
    4. A sub is canceled automatically by Stripe because of multiple failed
payments (new)
- the copy of the staff notification email has also been updated to take
into account 1) manual vs automatic cancellations, and 2) immediate vs
end of billing period cancellations
2024-07-15 08:07:18 +02:00
Ghost CI
8971128046 v5.87.2 2024-07-12 16:04:42 +00:00
Ghost CI
d5b8095066 🎨 Updated Source to v1.3.1 2024-07-12 16:04:42 +00:00
Ghost CI
3d29fecfb7 🎨 Updated Casper to v5.7.4 2024-07-12 16:04:42 +00:00
Steve Larson
e626dd9353
🐛 Fixed image dimension retrieval causing Ghost requests to hang (#20589)
ref https://linear.app/tryghost/issue/ENG-1408/
- added additional safeguards to the image size dimensions probing

For some reason that requires further investigation, the
probe-image-size package was silently failing (neither resolving nor
rejecting) for a particular URL. This was causing Ghost to hang on to
serving the request, and after a few of these came in, ultimately caused
Ghost to stop being responsive.

Rather than trying to patch a dependency, we'll wrap the call to this
package and use the same timeout we pass into the package (which is
ignored in this particular case) as an additional safeguard.
2024-07-11 09:37:44 -05:00
Daniël van der Winden
22824b9685
Fixed paywall button border radius (#20582)
Fixes
https://linear.app/tryghost/issue/DES-544/upgrade-email-paywall-button-doesnt-match-normal-buttons-in-newsletter

In emails, the button for the paywall wasn't getting the border-radius,
as [Gmail strips out font styling applied to the `td` element in the
HTML](https://stackoverflow.com/a/38041282). Those styles are now moved
out of that element, and look to apply correctly.
2024-07-10 12:45:49 +00:00
Sag
f8966e26c8
Cleaned up "Recommendations" GA feature flag (#20580)
no issue

- "Recommendations" feature was released in Ghost
[v5.71.0](https://github.com/TryGhost/Ghost/releases/tag/v5.71.0)
(commit: 1b82efe5d2)
- [Project
details](https://www.notion.so/ghost/Recommentions-5be89ec0d02a4c9b9310a964f9b22901?pvs=4)
2024-07-10 12:24:27 +00:00
Sag
a8533c9dc9
Cleaned up "Embeddable signup form" GA feature flag (#20577)
no issue

- "Embeddable signup form" feature was released in Ghost
[v5.51.0](https://github.com/TryGhost/Ghost/releases/tag/v5.51.0)
(commit: 5e7edb9)
- [Project
details](https://www.notion.so/ghost/Embeddable-signup-forms-1632735f1f894d01be491aeffb48bd45?pvs=4)
2024-07-10 10:46:04 +00:00
Sodbileg Gansukh
7266ca869f
Set explicit text color to the bookmark card content (#20578)
ref DES-263

- we've recently started forcing white background color to the bookmark
card by default
- the reason was making it look good regardless of the site background
color
- it caused an issue to some sites, mostly in dark mode, because the
text color was inherited from the theme
- this sets explicit color to the bookmark content which is consistent
with the nft card
2024-07-10 10:27:45 +00:00
Sag
83b1603202
Cleaned up "List Unsubscribe Header" GA feature flag (#20573)
no issue

- "List Unsubscribe Header" feature was added in Ghost release
[v5.74.0](https://github.com/TryGhost/Ghost/releases/tag/v5.74.0)
(commit: 69ee4a5)
- [Project
details](https://www.notion.so/ghost/One-click-unsubscribe-from-gmail-2b5cdc81e49f462287e9894c9c368aad?pvs=4)
2024-07-10 09:52:13 +00:00
Michael Barrett
6bfba13937
🐛 Fixed data importer allowing invalid free product to be imported (#20572)
refs
[ENG-1355](https://linear.app/tryghost/issue/ENG-1355/site-boot-cycling-due-to-free-tier-having-a-currency)

Fixed data importer allowing invalid free product to be imported which
could cause Ghost to not start due to the error:

`ValidationError: Free Tiers cannot have a currency`

It should not be possible to import a free product with pricing data (as
that means its not free 😄)
2024-07-10 10:49:56 +01:00
Steve Larson
9d15aef243
Updated timezone dependency (#20570)
ref https://linear.app/tryghost/issue/ENG-1266
- Mexico changed tz to not participate in DST
- our package was a couple years behind, so we likely have fixes for
other countries/regions, too
2024-07-09 16:31:36 -05:00
Sag
d0d0783837
🐛 Fixed pasting product URLs into the editor (#20565)
fixes https://linear.app/tryghost/issue/ENG-1215

- when pasting URLs that return `type: link` from the oembed service, we
now fallback to using a Bookmark card
- previously, this would render a plain link in the editor
- example product URL with `type: link`:
https://indiebeer.co.uk/products/terra-tempo-vinicius-red-wine-ba-wild-ale-with-mango-pineapple-honeydew-melon-and-banana-750ml-7
2024-07-09 18:28:56 +02:00
Steve Larson
00230314db
🐛 Fixed member source attribution for sign-up (Portal) links (#20566)
ref https://linear.app/tryghost/issue/ONC-154
- the query params did not carry through on portal sign up links because
of the hash creating an ignored fragment
(/#/portal/signup?ref=something)

Now when we check link attribution, we'll attempt to run the same logic
for the referrer source after stripping out `#/portal` from the URL.
Otherwise we should continue to treat these fragments as fragments to be
ignored by the client.

NOTE: We do not have e2e tests that cover member signup on the front end
and the data entered in the back end. The tests we have mock only the
server side of things. The test added here only covers the data that is
generated from the front end request (at this time), *not* the front end
request itself, meaning it's fragile.
2024-07-09 16:14:33 +00:00
Sag
8b45af3458
Cleaned up 'Filter by email disabled' GA feature flag (#20554)
no issue

- "Filter by email disabled" feature has been released to GA in [Ghost
v5.74.0](https://github.com/TryGhost/Ghost/releases/tag/v5.74.0)
(commit: 32d0d2b293)
- cf. [Project
details](https://www.notion.so/ghost/Filter-by-email-disabled-2a73f5da5e8b46bcaacb944bd98e0674?pvs=4)
2024-07-09 10:11:26 +00:00
Sag
6e884b1a95
🐛 Fixed selection bugs in editor (#20557)
ref https://ghost.slack.com/archives/CTH5NDJMS/p1720422460943619

- bumping 'lexical' from 0.13.1 to 0.14.2 created a few selection bugs
in the editor
- this commit reverts 'lexical' back to 0.13.1 and any related changes
in the editor codebase
2024-07-08 13:34:51 +01:00
Ronald Langeveld
3818445a18
🐛 Fixed bad redirects yaml overriding backed up working yaml file (#20555)
ref ENG-945

- Fixed an issue where upload a broken redirects yaml will override the
last working yaml.
- Instead it will now do the validation before saving and overriding the
yaml.
2024-07-08 16:45:20 +07:00
Ghost CI
bd15ce5c03 v5.87.1 2024-07-05 16:04:15 +00:00
Ghost CI
d260d81348 🎨 Updated Source to v1.3.0 2024-07-05 16:04:15 +00:00
Ghost CI
dc1f9492de 🎨 Updated Casper to v5.7.3 2024-07-05 16:04:15 +00:00
Kevin Ansfield
191a301242
Cleaned up hasPortalImprovements GA feature flag (#20548)
no issue

- the feature has been GA for a long time now so the conditionals are no longer required
2024-07-04 16:21:48 +00:00
Kevin Ansfield
3b87c9be53
Cleaned up websockets experiment (#20547)
no issue

- we're no longer making use of the websockets experiment so it's just bloat
- this is the whole feature in a single commit in case we need to revive it at some point
2024-07-04 16:08:06 +00:00
Daniel Lockyer
98d171cfc6 Bumped @tryghost/metrics package
- this change contains the removal of the `promise.allsettled` package,
  as this is not needed on Node 12+, which removes 75 further dependencies
  in production mode
2024-07-04 11:40:56 +02:00
renovate[bot]
6fadf45f4a Update dependency ws to v8.18.0 2024-07-03 17:36:56 +00:00
Kevin Ansfield
e6df014f84 Cleaned up newsletterExcerpt flag
no issue

- feature is GA so the flag and related conditionals are no longer required
2024-07-03 18:22:39 +01:00
Sanne de Vries
e393676e8d
Removed duplicate email template and styles files (#20528)
Refs https://ghost.slack.com/archives/C02G9E68C/p1720003723371169
- These duplicate files have been lingering since working on an email
customisation feature that was never released.
2024-07-03 14:35:17 +02:00
Sag
6e0b009034
🎨 Added 'Payment failed' subscription cancellation reason (#20527)
ref https://linear.app/tryghost/issue/ENG-1254

- we currently only store a cancellation reason when a member cancels
manually in Portal
- we now also store "Payment failed" when the cancellation is automatic
due to several payment failures
2024-07-03 13:12:01 +02:00
renovate[bot]
8d33c9d64f Update dependency lib0 to v0.2.94 2024-07-02 18:27:02 +02:00
Michael Barrett
b36c2356fc
Added custom redirects ReDoS validation (#20515)
refs
[ENG-709](https://linear.app/tryghost/issue/ENG-709/%F0%9F%90%9B-bad-redirects-causing-container-tear-down)

Added validation to prevent RegEx's susceptible to ReDoS from being used
with custom redirects. Also moved error details out of `context` and
into `errorDetails` to be consistent with error logging elsewhere as
well as fix issue in admin-x where blank screen would be shown when an
error occurred during redirects upload (due to logic not accounting for
`context` being an object)
2024-07-02 16:00:19 +01:00
Sanne de Vries
3618632129
Updated password updated successfully notification copy (#20512)
REF DES-540
2024-07-02 16:26:12 +02:00
renovate[bot]
90033eff2d Update dependency @tryghost/kg-html-to-lexical to v1.1.6 2024-07-02 08:26:16 +02:00
Kevin Ansfield
2fd9116499
🐛 Fixed unwanted extra blank paragraphs when copy/pasting from Google Docs (#20505)
closes https://linear.app/tryghost/issue/ENG-1255

- updated Koenig packages including:
  - addition of `/preview` for public preview card
  - fix for HTML import from Google Docs
  - fix for embed thumbnails being cut off in email
  - fix for wide image card width on medium screens
- multiple fixes for unhandled (but non user-visible) errors causing noise in console and error logging
2024-07-01 21:14:07 +01:00
Sag
7f963e9c2a
🎨 Added 'Changed email address' event to Member Activity (#20493)
fixes https://linear.app/tryghost/issue/ENG-1256

- when a member changes their email address, surface it in Member
Activity
2024-07-01 15:33:33 +00:00
Michael Barrett
c285b0a0f1
🔒 Added timestamp to webhook signature hash (#20500)
refs
[ENG-1238](https://linear.app/tryghost/issue/ENG-1238/🔒-webhook-signatures-dont-include-timestamp-in-the-signature)

Added timestamp to the webhook signature hash to prevent replay attacks.
This is
a breaking change for webhook consumers as signature verification logic
will need to be updated to account for the timestamp in the hash, for
example:

```js
const crypto = require('crypto');

// Webhook secret from Ghost Admin
const WEBHOOK_SECRET = 'FOOBARBAZ'

// Sample incoming webhook request object
const req = {
    headers: {
        'x-ghost-signature': 'sha256=fc9749d5b3333109bd779f65d4b1b891576bc5c92febea3b1d186a7f946d0745, t=1719842984367'
    },
    body: {
        tag: {
            current: {
                id: '6682b8a8e10cc04306284330',
                name: 'test',
                slug: 'test',
                description: null,
                feature_image: null,
                visibility: 'public',
                og_image: null,
                og_title: null,
                og_description: null,
                twitter_image: null,
                twitter_title: null,
                twitter_description: null,
                meta_title: null,
                meta_description: null,
                codeinjection_head: null,
                codeinjection_foot: null,
                canonical_url: null,
                accent_color: null,
                created_at: '2024-07-01T14:09:44.000Z',
                updated_at: '2024-07-01T14:09:44.000Z',
                url: 'http://localhost:2368/404/'
            },
            previous: {}
        }
    }
};

// Get the request body as a JSON string
const reqBodyJSON = JSON.stringify(req.body);

// Extract the hash and timestamp from the x-ghost-signature header
const {sha256: hash, t: timestamp} = req.headers['x-ghost-signature']
    .split(', ')
    .map((x) => x.split('='))
    .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})

// Recreate the hash using the secret, request body, and timestamp and compare it to the hash from the header
const isValid = crypto.createHmac('sha256', WEBHOOK_SECRET).update(`${reqBodyJSON}${timestamp}`).digest('hex') === hash

if (isValid) {
    console.log('Valid signature!')
}
```
2024-07-01 15:59:04 +01:00
Daniel Lockyer
60f37ed118 Fixed browser tests
refs 6378d7d66f

- the buttons have been renamed and split apart into separate ones
2024-07-01 14:49:20 +02:00
Daniel Lockyer
a146709c16 Cleaned up unused core dependencies
- analytics-node usage was removed a while back
- juice is used by a different package now
2024-07-01 13:56:31 +02:00
Sanne de Vries
95a4895e8f
Center aligned feature image in email template (#20491)
REF DES-380
- Center aligned feature image in email template
- Updated feature image css in editor to better display image overlay
and improve caption spacing
2024-07-01 08:43:26 +00:00
renovate[bot]
f561f362f4 Update dependency postcss to v8.4.39 2024-07-01 07:28:24 +02:00