Commit Graph

19779 Commits

Author SHA1 Message Date
Kevin Ansfield
47e6911ca0
Added cache-control header back to /auth-frame/ response (#19858)
ref https://linear.app/tryghost/issue/ENG-721

- when changing the response to a `204` for requests with no cookie we'd lost the `Cache-Control: public, max-age: 0` header which meant some cache systems weren't caching as efficiently as possible
2024-03-13 16:00:46 +00:00
renovate[bot]
2c7253edd7 Update dependency ts-node to v10.9.2 2024-03-13 16:31:48 +01:00
renovate[bot]
7f6bc16df8 Update nest monorepo to v10.3.3 2024-03-13 16:31:35 +01:00
Sag
9869d9adb6
Added referral tracking to the powered-by-ghost newsletter badge (#19850)
ref https://linear.app/tryghost/issue/TRI-65

In the context of referrals, we want to understand how useful our
“Powered by Ghost” badges are.

There are currently a few places where the “Powered by Ghost” badge can
be rendered:
- in newsletters (enabled/disabled by publisher, on a newsletter basis)
- in Portal popups, e.g. member signup/signin/account settings
- in the footer of some themes, including Source & Casper

We're adding the query param ?via to evaluate the usage of the badge in
newsletters.
2024-03-13 16:03:13 +01:00
Fabien "egg" O'Carroll
0fb0c6c2b5 Added NestJS Playground
no-issue

This adds the barebones of a NestJS application wired up to the Admin API
behind a feature flag, so that we can experiement with how to use Nest in the
context of Ghost
2024-03-13 19:44:06 +07:00
Fabien "egg" O'Carroll
d2620171ea Refactored auth services so they can be used in Nest
no-issue

This decouples the business logic from the express middleware so that it can be
used inside of a NestJS application.
2024-03-13 19:44:06 +07:00
Sag
59bbade630
Fixed browser tests (#19852)
no issue

- browser tests were failing due to the renaming of a button
2024-03-13 12:54:19 +01:00
Peter Zimon
9d9707e6f4
Settings keyboard shortcuts (#19836)
ref DES-166

Accessing settings via a keyboard shortcut is a great productivity
booster for advanced users and it is missing from Ghost today.
2024-03-13 08:46:22 +01:00
Fabien 'egg' O'Carroll
5a5ddcb609
🐛 Fixed Tiers API erroring when invalid filter passed (#19845)
closes ENG-730
closes https://linear.app/tryghost/issue/ENG-730/

We've updated the input serializer to parse the filter, and responded
with an error if it cannot be parsed correctly.

Now that it's parsed, we can pass a mongo query object through the
stack, which will lend itself to better typing for this code, which is a
direction we want to go in anyway. We've had to update all the internal
usages of the `browse` method to use mongo query objects.
2024-03-13 00:25:42 +07:00
Daniel Lockyer
55791a8c64 Switched to throwing error upon failed image processing
ref https://linear.app/tryghost/issue/ENG-740/http-500-error-when-image-processing-fails
refs 4aad551c72

- upon further discussion, we've decided it's better to throw an error
  in this case because the uploaded image is deemed invalid and storing
  it on the filesystem might cause more issues with resizing/further
  processing in the future
- this commit implements that and alters the tests
2024-03-12 16:24:29 +01:00
Daniel Lockyer
4aad551c72 🐛 Fixed HTTP 500 error when image processing fails during upload
fixes ENG-740
fixes https://linear.app/tryghost/issue/ENG-740/http-500-error-when-image-processing-fails

- in the event the image transform library throws (which can happen for
  many reasons; sharp/libvips can come across a number of errors), we
  currently return this as a HTTP 500 error to the user
- in this case, we should just try-catch the call and jump to the
  non-processing flow where it just saves the original image
- also added breaking test
2024-03-12 15:33:17 +01:00
Kevin Ansfield
ef143978e7
🎨 Reduced requests and 403 responses for comments auth check (#19840)
closes https://linear.app/tryghost/issue/ENG-721
ref https://linear.app/tryghost/issue/ENG-708

Comments-UI loads `/ghost/admin-frame/` in an iframe to check if a Staff User is authenticated in order to  show moderation options. That iframe request loads a HTML page which in turn contains a script that fires off an API request that attempts to fetch the logged-in user details, resulting in a 403 "error" showing up when not authenticated. In the vast majority of cases there will be no staff user authenticated so lots of extra requests and "errors" are seen unnecessarily.

- adjusted the `/ghost/auth-frame/` endpoint to check if the request contains an Admin session cookie
  - if it does, continue as before with rendering the HTML page so the script is loaded
  - if it doesn't, return an empty 204 response avoiding the script request and subsequent 403-generating API request
- eliminates the 403 error being generated for all typical visitor traffic, the error should only be seen when an Admin was previously logged in but their cookie is no longer valid (either from logging out, or going past the 6month validity period)
2024-03-12 12:27:18 +00:00
Daniel Lockyer
dea639e3f6 🐛 Fixed returning HTTP 500 response when recommendations check fails
ref ENG-737
ref https://linear.app/tryghost/issue/ENG-737/http-500-errors-from-recommendations-check-endpoint

- it's still possible for `this.#externalRequest.get` to throw, like if
  DNS resolution fails
- we want to try-catch this so we don't throw from this function and
  return a HTTP 500 to the user
- instead, we can just return `undefined`, which is the fallback
- adds a breaking test too
2024-03-12 12:31:44 +01:00
Daniel Lockyer
5fa4496d52 🐛 Fixed HTTP 500 responses when oembed endpoint receives error
fixes https://github.com/TryGhost/Product/issues/4237

- this fixes the fact that we return a HTTP 500 response when the oembed
  library receives an error, such as a 401 or 403
- includes special handling for cases where we want to return a slightly
  different error message
- also adds unit tests for @tryghost/oembed-service package
2024-03-12 12:31:44 +01:00
Daniel Lockyer
6842d599e9 🐛 Fixed handling of image uploads with overly long filenames
fixes ENG-733
ref https://linear.app/tryghost/issue/ENG-733/handle-image-uploads-where-name-is-too-long

- filesystems usually have a filename length limit; ie. on macOS it is
  255 characters
- if a file is uploaded with a longer filename, we'll return a HTTP 500
- we shouldn't do this as it is user error, so we can just catch the
  error code and return BadRequest
- this implements that, and adds a breaking test
2024-03-12 12:31:44 +01:00
Daniel Lockyer
6db20fc14b Fixed minor code nits
- made fixes for the following:
  - jsdoc definitions
  - typos
  - extra parameter to function
  - missing `utf-8` to fs file read
2024-03-12 12:31:44 +01:00
renovate[bot]
bba53b82aa Update dependency html-validate to v8.15.0 2024-03-12 06:26:02 +01:00
timemanagementsk
7fb5def470
Edited few phrases in Slovak (sk) translation to make it sound better (#19825)
I think my changes make the Slovak better. I changed just a few thins,
it's my first time trying Github, but if this is approved, I plan to do
more changes in the future and make the Slovak translation even btetter.

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2024-03-11 17:56:26 -04:00
Raka Afp
6e82aac14f
Updated Bahasa Indonesia translations (#19829)
Translation for new strings in portal.json
2024-03-11 14:58:31 -04:00
Daniel Lockyer
360ecf15ae 🐛 Fixed HTTP 500 error when given incorrect Range header
ref ENG-729
ref https://linear.app/tryghost/issue/ENG-729/incorrect-range-header-leads-to-http-500-errors

- we didn't have handling here for the `RangeNotSatisfiableError` that
  can come from express/serve-static/send
- as a result, passing an invalid range would cause a 500 error
- this prevents that and adds a breaking test
2024-03-11 19:14:30 +01:00
Daniel Lockyer
162f438c63 Updated @tryghost/errors dependency
- this version is written in TS, but was published a few months ago and
  needs to be bumped here
- also updates a previous deep include into the library, which was
  unnecessary anyway
2024-03-11 17:33:51 +01:00
Daniël van der Winden
f0d6a64f7a
Fixed scrolling issues on members table (#19833)
ref DES-86

Set fixed widths for different columns on the Members table specifically, so content does not jump up & down anymore as you scroll down the page.

---------

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2024-03-11 17:32:10 +01:00
renovate[bot]
b41d9c9251 Update dependency html-validate to v8.10.0 2024-03-11 17:17:01 +01:00
renovate[bot]
0162fea441 Update dependency typescript to v5.4.2 2024-03-11 17:16:17 +01:00
Ghost CI
f83d51c1e3 v5.80.2 2024-03-08 16:04:08 +00:00
Ghost CI
76383b4295 🎨 Updated Source to v1.2.0 2024-03-08 16:04:08 +00:00
renovate[bot]
e17bbb6215 Update dependency i18next to v23.10.1 2024-03-08 07:07:33 +00:00
Peter Zimon
ad491ea4f3
Fixed udpated banner z-index (#19822)
refs.
https://linear.app/tryghost/issue/DES-168/z-index-is-really-messed-up-in-settings

The update banner's z-index was conflicting with settings.
2024-03-07 14:46:48 +01:00
renovate[bot]
57c5e24f5b Update dependency jose to v4.15.5 2024-03-07 12:55:02 +00:00
renovate[bot]
3301332253 Update dependency express to v4.18.3 2024-03-07 13:42:27 +01:00
Ghost CI
624168ead5 Merged v5.80.1 into main 2024-03-07 09:04:51 +00:00
Ghost CI
0a8716b0ae v5.80.1 2024-03-07 09:04:50 +00:00
Sag
ae95e8de8c Fixed tiers paywall selecting all paid tiers (#19817)
refs INC-36

- oversight in parent commit 00cff0a
2024-03-06 22:35:43 +01:00
Sag
69466ecab9 🐛 Fixed free tier showing in the tiers-only paywall in posts (#19807)
refs INC-36
fixes https://github.com/TryGhost/Ghost/issues/19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
2024-03-06 22:35:33 +01:00
Sag
656846018a
Fixed tiers paywall selecting all paid tiers (#19817)
refs INC-36

- oversight in parent commit 00cff0a
2024-03-06 22:14:17 +01:00
Sag
00cff0aece
🐛 Fixed free tier showing in the tiers-only paywall in posts (#19807)
refs INC-36
fixes https://github.com/TryGhost/Ghost/issues/19796

- The tiers-only paywall was incorrectly rendering "Free". Example:
"This post is for subscribers of the Free, Silver and Gold tiers only"
- Steps to reproduce the issue:
    1. Create a post with public visibility, publish it
    2. Then swap the visibility to specific tiers. The default selects all
paid tiers. Leave it like that
    3. Update the post. The paywall show Free, even though it should be
showing only the paid tiers
- This fix filters out the "free" tier when visibility is set to tiers,
before updating a Post or a Page. The fix includes bulk updates from the
list of Posts and Pages (right-click on a Post/Page > Change Access).
2024-03-06 21:30:00 +01:00
Thibault Malfoy
5f80e9f7db
Fix a French translation error in portal.json (#19803)
In this context, "save" should be translated as "économiser".
2024-03-06 11:41:27 -05:00
renovate[bot]
b205214247 Update dependency terser to v5.29.1 2024-03-06 14:45:31 +00:00
renovate[bot]
1c7868b362 Update dependency terser to v5.29.0 2024-03-06 10:45:30 +00:00
Kevin Ansfield
3090f8ec95
🎨 Improved lazy-loading of comments data (#19809)
no issue

Bumps `Comments-UI` app version that contains an improvement to data loading:

- within the comments block we only use Admin auth to show moderation options on each displayed comment but we were always pre-emptively loading the `admin-auth` frame and making the associated Admin API user request. That loading has now been deferred until at least one comment has been displayed cutting down unnecessary requests on each post view
2024-03-06 10:29:55 +00:00
Kevin Ansfield
78aba5b22a
🎨 Improved lazy-loading of comments data (#19809)
no issue

Bumps `Comments-UI` app version that contains an improvement to data loading:

- within the comments block we only use Admin auth to show moderation options on each displayed comment but we were always pre-emptively loading the `admin-auth` frame and making the associated Admin API user request. That loading has now been deferred until at least one comment has been displayed cutting down unnecessary requests on each post view
2024-03-06 10:17:32 +00:00
Kevin Ansfield
b704530d74
🐛 Fixed unexpected conversion of single-quoted attributes in HTML cards (#19727)
closes ENG-627

We were using `cheerio` to parse+modify+serialize our rendered HTML to modify links for member attribution. Cheerio's serializer has a [long-standing issue](https://github.com/cheeriojs/cheerio/issues/720) (that we've [had to deal with before](https://github.com/TryGhost/SDK/issues/124)) where it replaces single-quote attributes with double-quote attributes. That was resulting in broken rendering when content used single-quotes such as in HTML cards that have JSON data inside a `data-` attribute or otherwise used single-quotes to avoid escaping double-quotes in an attribute value.

- swapped the implementation that uses `cheerio` for one that uses `html5parser` to tokenize the html string, from there we can loop over the tokens and replace the href attribute values in the original string without touching any other part of the content. Avoids a full parse+serialize process which is both more costly and can result unexpected content changes due to serializer opinions.
  - fixes the quote change bug
  - uses tokenization directly to avoid cost of building a full AST
- updated Content API Posts snapshot
  - one of our fixtures has a missing closing tag which we're no longer "fixing" with a full parse+serialize step in the link replacer (keeps modified src closer to original and better matches behaviour elsewhere in the app / without member-attribution applied)
  - the link replacer no longer converts `attr=""` to `attr` (these are equivalent in the HTML spec so no change in behaviour other than preserving the original source html)
- added a benchmark test file comparing the two implementations because the link replacer runs on render so it's used in a hot path
  - new implementation has a 3x performance improvement
  - the separate files with the old/new implementations have been cleaned up but I've left the benchmark test file in place for future reference

Benchmark results comparing implementations:

```
❯ node test/benchmark.js

LinkReplacer
├─ cheerio: 5.03K /s ±2.20%
├─ html5parser: 16.5K /s ±0.43%

Completed benchmark in 0.9976526670455933s
┌─────────────┬─────────┬────────────┬─────────┬───────┐
│   (index)   │ percent │ iterations │ current │  max  │
├─────────────┼─────────┼────────────┼─────────┼───────┤
│   cheerio   │   ''    │ '5.03K/s'  │  5037   │ 5037  │
│ html5parser │   ''    │ '16.5K/s'  │  16534  │ 16534 │
└─────────────┴─────────┴────────────┴─────────┴───────┘
```
2024-03-06 09:11:49 +00:00
Sodbileg Gansukh
e3d01e0b1f
Decreased header spacing for newsletters on mobile screen (#19690)
ref DES-115
2024-03-05 14:01:58 +08:00
Fabien O'Carroll
d9fb4787ec Removed whitelist of JWT errors
refs https://linear.app/tryghost/issue/ENG-712/

I don't think we ever need to respond with a 500 here, if the verify call
fails, we know that the token is unauthorized for use.
2024-03-05 03:04:34 +07:00
Fabien O'Carroll
dcbd168585 🐛 Fixed 500 error for premature api token use
refs https://linear.app/tryghost/issue/ENG-712

We weren't handling the NotBeforeError and instead responing with a 500 which
is not correct.
2024-03-05 03:04:34 +07:00
renovate[bot]
b6b2e2ea31 Update dependency newrelic to v11.12.0 2024-03-04 18:35:26 +00:00
Ghost CI
9df5148427 v5.80.0 2024-03-01 16:04:20 +00:00
renovate[bot]
69459e9b42 Update dependency yjs to v13.6.14 2024-03-01 11:32:05 +00:00
renovate[bot]
81f1b63cca Update dependency yjs to v13.6.13 2024-02-29 19:32:37 +00:00
Peter Zimon
8f3617aaa8
Content card design improvements (#19737)
refs. https://linear.app/tryghost/issue/DES-122/bookmark-card-issues

This PR addresses the following content card related problems:

1. The design of the following cards are more self-contained so it makes
more sense to use `px` for their font-sizes and spacings so it looks the
same regardless of the theme. Of course themes still can override these
values.

Updated cards to use `px` for font sizing:
- audio
- bookmark
- file
- product

2. So far header and signup cards had been using `rem` for font-sizes
and some sizing. This commit updates these to use `em` instead so that
it's consistent with all other cards.

3. The favicon sometimes is not available for bookmark cards. This PR also
fixes that by providing a default favicon for these cases.
2024-02-29 17:09:34 +01:00
Sanne de Vries
c7e475feb0
Remove comment icon at the top of email template (#19771)
Refs
https://linear.app/tryghost/issue/DES-80/newsletter-view-in-browser-breaking-to-next-line-with-incorrect
2024-02-29 14:45:38 +01:00
Kevin Ansfield
e0d8e18785
Added lazy-loading of comments data (#19778)
no issue

Bumps `Comments-UI` app version that contains a few changes:

- comments data is now lazy-loaded with API requests being deferred until the comments block is scrolled into view, saving up-front visitor data usage as well as reducing server-load for page views where the comments are never seen
- comments data is now fetched from `/members/api/comments/{post_id}/` rather than using the post_id in the `filter` param to enable cache bucketing and cache invalidation
- `created_at` timestamp has been dropped from the initial comments data request so the results can be cached, on pagination requests the timestamp has been improved to use the created_at data from the response so it remains consistent and can also be cached
- `order` param has been dropped from API requests as the API has been updated to include our default ordering
2024-02-29 10:21:05 +00:00
Ronald Langeveld
6c624d12a2
🎨 Include archived offers in members filter (#19756)
refs
https://linear.app/tryghost/issue/ENG-19/allow-archived-offers-to-be-used-in-member-filtering

- Removed the filter to only include Active Offers so that we can also
filter memebers that previously redeemed archived offers.
2024-02-29 08:31:23 +02:00
Fabien 'egg' O'Carroll
a489d5a3d8
Added /comments/:id/replies/ to X-Cache-Invalidate
refs https://linear.app/tryghost/issue/ENG-682/

This should allow us to bust both endpoints cache when write operations
are made to comments.
2024-02-28 23:15:02 +00:00
Kevin Ansfield
44e602b447
Switched to default ordering for comments API requests (#19774)
closes ENG-681

There's no need to provide an `order` param with every request in Comments-UI if the API has default ordering that matches our requirements. The order param makes logs more noisy/harder to read than they need to be so we want to get rid of it.

- modified comments API input serializer to add a default order param to the browse and replies endpoints when none is provided
- removed order param from the requests that Comments-UI makes
2024-02-28 18:42:02 +00:00
Fabien O'Carroll
4c6f7715ef Cleaned up comments controller
no-issue

This removes some redundant calls to `get` and makes refactoring
easier in future.
2024-02-29 00:24:34 +07:00
Fabien O'Carroll
001f2b0b91 Invalidated post comments cache on like&unlike
refs https://linear.app/tryghost/issue/ENG-676/

We want to make sure that we're not serving stale liked counts for
comments, which means we need to cache bust when they're liked/unliked

Unfortuantely this means we need to fetch the comment from the db so
that we have access to the post id.
2024-02-29 00:24:34 +07:00
Fabien O'Carroll
58dd79ccb4 Invalidated the new comments endpoint cache on add & edit
refs https://linear.app/tryghost/issue/ENG-676/

This is the meat of the change and actually causes the cache to be
invalidated on adds and edits to the comments endpoints.

It doesn't currently include the liked/unliked actions at the moment
as we don't have easy access to the post id from those endpoints.
2024-02-28 22:40:56 +07:00
Fabien O'Carroll
2c6321472c Added endpoint for comments/post/:post_id
refs https://linear.app/tryghost/issue/ENG-676/

This is pretty simple as we can reuse the existing browse method
on the CommentsController, but we need to add support for the post_id
option to the endpoint, for it to be added to the frame.

We also need to update the browse method to enforce the post_id on the
NQL filter. I initially tried this with string concatenation, but ran
into way too many bugs, so we're using a mongo transformer instead.
2024-02-28 22:40:56 +07:00
Djordje Vlaisavljevic
f032f11d8a Added hrefs to paywall links for improved SEO
refs DES-150
2024-02-28 15:28:41 +00:00
Fabien O'Carroll
93263fa7be Ensured that endpoint header config is not modified in future
refs https://linear.app/tryghost/issue/ENG-674/

This will cause errors to be thrown if developers attempt to modify the shared
header config in future.
2024-02-28 21:31:04 +07:00
Fabien O'Carroll
ec697051dc 🐛 Fixed cache invalidation header race conditions
refs https://linear.app/tryghost/issue/ENG-674/

This ensures that all of our dynamic cache invalidation header logic
is applied on a per-request basis!
2024-02-28 21:31:04 +07:00
Fabien O'Carroll
a177600b30 Supported setting headers on a per-request basis
refs https://linear.app/tryghost/issue/ENG-674

This paves the way for us to have dynamic cache invalidation headers
without clobbering the shared headers config.
2024-02-28 21:31:04 +07:00
Fabien 'egg' O'Carroll
5fae212416
Ensured comment counts route doesn't load member (#19762)
refs https://linear.app/tryghost/issue/ENG-672/

The comment counts endpoint does not need member authentication.
This saves us a bunch of db queries for each request
2024-02-28 07:36:35 +07:00
Fabien 'egg' O'Carroll
7f392c305b
Added output to the get helper when the timeout is exceeded (#19761)
refs https://linear.app/tryghost/issue/ENG-670

We keep running into issues with a sites content not being correct,
and slow get helpers being the suspect - but it's difficult to prove.
The idea behind this it to give us concrete evidence, which will allow
us to diagnose the problem faster.
2024-02-28 07:35:16 +07:00
renovate[bot]
0c5f1daf96 Update dependency newrelic to v11.11.0 2024-02-27 22:55:16 +00:00
Kevin Ansfield
f3e36bcd4e
🐛 Fixed extra whitespace in plaintext transactional member emails (#19736)
closes ENG-660

- added tagged template function to strip leading whitespace from our plaintext email strings without making the source file harder to read
2024-02-27 16:24:38 +00:00
Kevin Ansfield
89ab3b26d2
🐛 Fixed pasting into HTML card editor replacing the card with a paragraph (#19757)
closes ENG-657

- bumps `@tryghost/koenig-lexical` to include fix for preventing default Lexical behaviour when we detect a paste event inside a nested CodeMirror editor
2024-02-27 12:38:26 +00:00
Ghost CI
536f67398c Merged v5.79.6 into main 2024-02-26 17:18:43 +00:00
Ghost CI
3b0d0934eb v5.79.6 2024-02-26 17:18:41 +00:00
Kevin Ansfield
ab7c1cfa92
Fixed incorrect cache invalidation headers for slugs Admin API endpoint (#19753)
closes ENG-666

- the Admin API `GET /slugs/{type}/{slug}/` endpoint is used by Admin to check when a potential slug needs de-duping by adding a `-{x}` suffix. Most often this occurs when setting a draft post title
- the endpoint was returning a full-site cache invalidation header meaning hosting services could be blowing away their site caches and needlessly hurting performance because this endpoint is purely a read operation and makes no changes to the site
- updated the endpoint to return no cache invalidation header
2024-02-26 17:02:09 +00:00
Kevin Ansfield
ca9c0a4055
Fixed incorrect cache invalidation headers for slugs Admin API endpoint (#19753)
closes ENG-666

- the Admin API `GET /slugs/{type}/{slug}/` endpoint is used by Admin to check when a potential slug needs de-duping by adding a `-{x}` suffix. Most often this occurs when setting a draft post title
- the endpoint was returning a full-site cache invalidation header meaning hosting services could be blowing away their site caches and needlessly hurting performance because this endpoint is purely a read operation and makes no changes to the site
- updated the endpoint to return no cache invalidation header
2024-02-26 16:59:29 +00:00
renovate[bot]
65a9a04959 Update dependency mysql2 to v3.9.2 2024-02-26 16:25:50 +00:00
Ghost CI
3a0fd45958 v5.79.5 2024-02-26 06:26:13 +00:00
renovate[bot]
afe1350008 Update dependency terser to v5.28.1 2024-02-23 17:18:29 +00:00
renovate[bot]
e1bc7c555a Update dependency terser to v5.28.0 2024-02-23 11:29:11 +00:00
renovate[bot]
49fc876fe1 Update dependency sanitize-html to v2.12.1 2024-02-22 19:17:35 +00:00
Alexandre "Lekler" Rodrigues
fd3192281a
Updated Brazilian Portuguese translations (#19724)
<!--
copilot:summary
-->
2024-02-22 14:05:27 -05:00
renovate[bot]
211016210e Update dependency i18next to v23.10.0 2024-02-22 14:10:30 +00:00
Steve Larson
02edc5ad4f
Updated browser tests to be less flaky (#19701)
no refs

- Offers browser tests were subject to a race condition. I'm guessing
this dates back to when we moved to Settings X (and React), as it seems
the url for the offer is not present on the first render of the page -
despite being returned in the `POST` request of the offer creation, the
component does a `GET` on render to get the link. This is now awaited.
- The Publishing timezone test also seemed to suffer from a race
condition. This is less sure of a fix as it's a much less frequent
failure. The date time picker input is now validated in the test before
continuing.
- Offers browser tests often timed out so the timeout has been moved to
90s for these tests.
- All tests were bumped to 75s timeout as we generally would
occasionally hit the timeout.
2024-02-21 17:47:44 +00:00
renovate[bot]
bcbd3fbcc8 Update dependency sanitize-html to v2.12.0 2024-02-21 16:47:38 +00:00
Kevin Ansfield
a3f8aa110d
🐛 Fixed explicit HTML entities being decoded when rendering HTML cards (#19728)
closes ENG-608

- bumps Koenig rendering packages to include fix for HTML entities in HTML card content being decoded during rendering which could result in unexpected/broken output
2024-02-21 16:36:04 +00:00
Nick Moreton
7c407af642
Added Posthog event sending to trackEvent function (#19716)
refs PA-37

As we add Posthog to the stack we want to send the existing events we
track to it, as well as opening up the method to teams to use in their
initiatives.

---------

Co-authored-by: Chris Raible <chris@ghost.org>
2024-02-20 14:32:56 -08:00
Chris Raible
f49b5ab78d
Added reusable isPosthogLoaded function (#19722)
no issue

- We were checking if Posthog was loaded in a few separate places using
the same logic — this PR consolidates that logic into a simple utility
function so we can ensure consistency and change this logic more easily
if we need to in the future
2024-02-20 14:08:35 -08:00
Chris Raible
fbeecd58e6
Fixed issue with calling Posthog functions before it is loaded (#19721)
refs PA-36

- Since Posthog is loaded outside of the main Admin app bundle, we need
to check to make sure it exists before calling it. This way it will only
run on Pro and not locally or on self-hosted instances
- Previously we were checking that `window.posthog` existed, but there
are some cases where `window.posthog` may exist, but the `posthog`
object is not fully loaded yet.
- This change fixes this by checking for `window.posthog.__loaded`
instead, which is set to `true` once the `posthog` object is fully
loaded — at this point, we should be able to call whatever functions we
need to on `window.posthog`
2024-02-20 13:57:42 -08:00
Sag
034df3714e
Removed leftover alpha flag (#19717)
no issue
2024-02-20 14:07:03 +01:00
Sag
ba3ea9b36c
Fixed browser tests (#19719)
no issue
2024-02-20 14:03:36 +01:00
Sag
e9f5af110c
🎨 Added option to change the name of the free tier (#19715)
ref ENG-607

- also added the option to show the monthly pricing by default during
signup

Co-authored-by: Simon Backx <simon@ghost.org>
Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2024-02-20 12:54:41 +01:00
renovate[bot]
cc46406eb9 Update dependency terser to v5.27.2 2024-02-19 13:13:50 +00:00
Ghost CI
8be7f7c528 Merged v5.79.4 into main 2024-02-19 11:26:02 +00:00
Ghost CI
98b5992f63 v5.79.4 2024-02-19 11:26:01 +00:00
Kevin Ansfield
d1ce0ad34a
🐛 Fixed wide + full-width cards not displaying correctly inside the editor (#19711)
closes ENG-651

- bumps `@tryghost/koenig-lexical` to include fix for styling regression
  - https://github.com/TryGhost/Koenig/pull/1161
2024-02-19 11:06:32 +00:00
Kevin Ansfield
ef66cd0433
🐛 Fixed wide + full-width cards not displaying correctly inside the editor (#19711)
closes ENG-651

- bumps `@tryghost/koenig-lexical` to include fix for styling regression
  - https://github.com/TryGhost/Koenig/pull/1161
2024-02-19 11:05:37 +00:00
renovate[bot]
6b19637566 Update dependency i18next to v23.9.0 2024-02-19 00:18:33 +00:00
Ghost CI
0c4d62880e v5.79.3 2024-02-16 18:20:06 +00:00
Ghost CI
49bf6d2754 v5.79.2 2024-02-16 16:06:40 +00:00
renovate[bot]
3437e26bc9 Update dependency webpack to v5.90.2 2024-02-15 15:57:41 +00:00
renovate[bot]
25f744ccea Update dependency terser to v5.27.1 2024-02-15 12:19:15 +00:00
renovate[bot]
fa89379474
🐛 Fixed editor card panels being positioned under post settings menu (#19635)
closes DES-112

- bumps `@tryghost/koenig-lexical` to include a few card settings panel improvements
  - initial panel positioning now takes sidebar into consideration
  - panels re-adjust position when opening/closing sidebar
  - panels can no longer be dragged off-screen or under the sidebar
2024-02-14 17:16:47 +00:00
renovate[bot]
c0325da0e7 Update dependency newrelic to v11.10.4 2024-02-13 21:27:42 +00:00
Chris Raible
7dafefbfa7
Added PostHog identify calls in admin using hashed email address of user (#19685)
refs PA-24

- Added PostHog identify() calls using the user's hashed email address
when a user is logged into admin
- Added PostHog reset() calls to reset PostHog's distinct_id when a user
logs out of admin
- These events will only be sent in Admin running on Ghost(Pro), and won't impact self-hosted instances.
2024-02-13 13:23:03 -08:00
Kevin Ansfield
8a6a35851e
🐛 Fixed editor feature image caption not expanding to show long content (#19688)
closes DES-6
refs https://github.com/TryGhost/Ghost/issues/19545

- changed fixed height to min-height so the input expands when content wraps over multiple lines
2024-02-13 13:06:09 +00:00
Peter Zimon
ba9b695626
Update "Customize" link on Setup screen (#19686)
refs.
https://linear.app/tryghost/issue/DES-113/clicking-customize-design-on-setup-page-lands-you-on-top-level

On the setup screen 60% of people choose "Customize your site" which ATM
just take people to the top level Settings screen. This is very
confusing as with all the settings people don't know where to click to
actually get to customizing their site.

This PR fixes it by showing the design settings when clicking on
"Customize your site" and to the Dashboard after closing it.
2024-02-13 11:16:01 +01:00
Zeit08
92451e9bc2
Small adjustments italian (#19673)
I refined some translations, and I wrongly translated a line, which I
commented. I hope it is understandable.

---------

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
Co-authored-by: Ryan Feigenbaum <ryan.feigenbaum@gmail.com>
2024-02-12 16:32:09 -05:00
renovate[bot]
cd8b5f3ab3 Update dependency yjs to v13.6.12 2024-02-12 02:16:00 +00:00
Ghost CI
300563eb95 v5.79.1 2024-02-09 16:04:10 +00:00
Chris Raible
59076d1bca
Reverted "Fixed PostHog toolbar in admin (#19675)" (#19680)
This reverts commit c32ee3ca40.

- I found another way to fix this, making this change unnecessary
2024-02-08 16:58:46 -08:00
Chris Raible
c32ee3ca40
Fixed PostHog toolbar in admin (#19675)
refs PA-32

- The PostHog toolbar relies on a value that is passed via a hash in the
URL to launch successfully
- Admin overwrites the hash (since it uses hash based routing) before
the toolbar has a chance to read the value
- This change checks for the hash and if it exists, it launches the
toolbar using the hash value
2024-02-08 13:40:03 -08:00
Kevin Ansfield
600445cf39
Added re-enable of innodb redo log once DataImporter has run (#19678)
no issue

- DataGenerator disables the redo log to make data imports faster but it's a persisted global config change and we were missing the re-enable query once the imports have finished
- when the redo log remains disabled an unexpected shutdown puts the database into a non-starting state with the error `Server was killed when Innodb Redo logging was disabled. Data files could be corrupt. You can try to restart the database with innodb_force_recovery=6`
2024-02-08 16:02:01 +00:00
Djordje Vlaisavljevic
5a6690eef4 Made selection background color in dark mode lighter
refs DES-8
2024-02-08 11:36:15 +00:00
Peter Zimon
3ef8b53fad
Added "No search result" screen to Settings (#19672)
refs.
https://linear.app/tryghost/issue/DES-21/empty-screen-is-missing-for-search-in-settings

- Search is one of the most useful functions in Settings and currently
the screen when there's no result for a searchterm is just a plain white
screen. Very non user-friendly.
- This update gives us an opportunity to improve the overall visual
hierarchy and focus of Settings in general.

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-02-08 08:32:40 +01:00
renovate[bot]
46866788dd Update dependency newrelic to v11.10.3 2024-02-07 20:03:13 +00:00
Ronald Langeveld
b460dabf68
Revert "Added headers if making a preview site request (#19668)" (#19669) 2024-02-07 16:54:27 +02:00
Kevin Ansfield
8522ca175d
🐛 Fixed duplicate text when pasting URL on selection with multiple formats (#19671)
closes ENG-29

- bumped editor package to include fix for handling child nodes within a selection when pasting a URL to convert text to a link
2024-02-07 13:48:14 +00:00
Agustín Gómez
a1b52e43d7
Typo in spanish translation "paga" should be "pagada" (#19643)
Update portal.json reflecting this change. 
"Pagar" is the Spanish verb for "to pay (for)", the past participle
"pagada" is the correct word in this particular use case, meanwhile
"paga" is the indicative present which does not fit well.

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2024-02-07 08:30:49 -05:00
Ronald Langeveld
d3e16bb885
Added headers if making a preview site request (#19668)
no issue

- to test if we can access Private Sites in Admin when set as a private
site.
- the issue is, we have CORS issues that doesn't allow a cookie to be
passed via Admin when the site uses a custom domain.
- generally does not affect self hosters.
2024-02-07 11:37:59 +00:00
zabkacze
695bf69c6a
Added changes in Czech (#19645)
It's not complete but hope it helps

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2024-02-06 17:42:19 -05:00
Steve Larson
5f371027a3
Updated editor lexical packages (#19664)
no refs
- updated koenig packages with the newest lexical version to bring in bugfixes and improvements
2024-02-06 22:13:54 +00:00
Chris Raible
90ebdacabb
🐛 Fixed members importer overwriting name and note if left blank (#19663)
fixes ENG-610

- Previously, when importing an existing member, if the name or note
field is left blank in the CSV file, this would overwrite (re: delete)
the existing name or note in the database.
- This change ensures that the name and note fields are only updated if
they are not blank in the CSV file.
2024-02-06 13:31:34 -08:00
Chris Raible
c2fd22a246
🐛 Fixed members import unsubscribing members when subscribe_to_emails is empty (#19658)
fixes ENG-611

- Previously, if an existing member with newsletter subscriptions was
imported, and `subscribe_to_emails` was blank/empty, the member would be
unsubscribed from all newsletters, which is not the expected behavior.
- This PR changes the behavior so if `subscribe_to_emails` is blank, it
will not unsubscribe existing members.
2024-02-06 10:19:16 -08:00
Djordje Vlaisavljevic
aa29e8fa32 Fixed members table background bug
refs DES-97
2024-02-06 10:02:09 +00:00
alaingrdj
24c5dd345e
Update ghost.json (#19644)
my proposal is one which is suitable in most situations and which is
respectful for ghost's customers. Thank you for your kind consideration
of my request.

Bonjour : This is the safe and universally appropriate way to say hello
in French, regardless of the situation. It's always polite and
respectful.

Salut : This is a casual greeting generally used with friends, family,
or people you know well. It's not appropriate in formal settings.

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this
list, thanks!

- [ ] There's a clear use-case for this code change, explained below
- [ ] Commit message has a short title & references relevant issues
- [ ] The build will pass (run `yarn test:all` and `yarn lint`)

We appreciate your contribution!

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2024-02-05 12:50:46 -05:00
renovate[bot]
00ea166575 Update dependency fastq to v1.17.1 2024-02-05 16:15:17 +00:00
Ronald Langeveld
58c156001c
Added Newsletter Events Test to Members (#19653)
refs
https://linear.app/tryghost/issue/ENG-604/🐛-members-events-show-member-subscribed-to-archived-newsletter

- added a tests to avoid a potential regression
2024-02-05 13:54:10 +00:00
Ghost CI
c6c66d2a20 v5.79.0 2024-02-02 16:04:15 +00:00
Steve Larson
2c166582fd
Added config option to disable db backups (#19614)
refs https://linear.app/tryghost/issue/ENG-600
- users need an option so they can perform actions like delete users
without blowing up Ghost as large dbs can OOM node
2024-02-01 12:09:41 -06:00
renovate[bot]
1a3e7cbd7d Update dependency webpack to v5.90.1 2024-02-01 17:35:00 +00:00
Sag
c12e279e0c
Added migration to fix data discrepancy in free tier visibility (#19624)
refs INC-18

- release v5.69.0 introduced a data discrepancy in the free tier
visibility: the "free" tier visibility got out of sync with the
"portal_plans" setting due to a bug in the new Admin settings. The bug
was corrected in a patch release rolled out a few days later, v5.69.4
- however, the data discrepancy has not been corrected for all
customers; this data migration fixes the data discrepancy
2024-02-01 16:53:40 +01:00
Ronald Langeveld
ddc1a58c84
🐛 Fixed members events for archived newsletters (#19638)
fixes
https://linear.app/tryghost/issue/ENG-604/🐛-members-events-show-member-subscribed-to-archived-newsletter

- This fixes a bug where it doesn't take archived newsletters into account and would
create an Event for subscribing back to those newsletters even though
its not the case, which causes some confusion for publishers in Member
Events and wastes rows in the DB.
2024-02-01 16:11:01 +02:00
Ryan Feigenbaum
4d6aaf0f68
Update grammar and fix missing word in Email receiving FAQ (#19637)
There were two changes in the Email receiving FAQ page.

1. Add "a" to "If you're not receiving the email newsletter you've
subscribed to, here are a few things to check."
2. Remove unnecessary hyphens from "to-and-from this address."

@jonhickman
2024-01-31 16:16:40 -05:00
renovate[bot]
1bd7dea79d Update dependency newrelic to v11.10.2 2024-01-31 19:53:07 +00:00
Kevin Ansfield
99efb3aa08
🐛 Fixed embed card "Paste URL as link" button (#19634)
closes ENG-594

- bumps `@tryghost/koenig-lexical` to include fixed button click handler
2024-01-31 17:56:21 +00:00
Steve Larson
1ed34aebac
Added check for Stripe Pass in Stripe Connect test utils (#19633)
refs https://linear.app/tryghost/issue/ENG-599
- Portal tests occasionally failed without clear cause on CI, possibly
due to GH runner region
- Portal tests never successfully ran locally for US-based IPs because
of a required prompt for Stripe Pass
2024-01-31 11:52:09 -06:00
renovate[bot]
123ccdb6f9 Update dependency i18next to v23.8.2 2024-01-31 14:46:21 +00:00
Simon Backx
13c582205c
🐛 Increased email timeout when sending to lots of recipients (#19628)
fixes ENG-603

If the database is under load, it is possible that sending batches can
be slow due to connection timouts. In that case, we need to increase the
total timeout when sending an email.

Apart from that, this commit adds more logging.
2024-01-31 11:46:00 +00:00
Fabien 'egg' O'Carroll
38b29d0566
Fixed boot crashing when segment config is present (#19625)
refs https://github.com/TryGhost/Ghost/commit/c4912665e5d5af2c25e

We removed the segment service but continued to attempt to load it when
the segment config was present.
2024-01-31 13:01:34 +07:00
Steve Larson
d5077ac1bf
Cleared member count cache on manual member add/delete (#19623)
refs https://linear.app/tryghost/issue/ENG-599
- member count is based on the cache which only updates ~every minute
- forced cache clear on manual member add/delete (not import)
- tests were failing based on the assumption that a new site that adds a
member has a nonzero member count, although the cache did not reflect
this quickly enough for the test to pass

Previously on a new site if you tried to publish a newsletter, it would
require at least one member. If you quickly added a member and tried to
send a newsletter, it would stop you saying you need at least one
member, requiring a browser refresh. This was a bug that is resolved
with this changes, as well as odd behaviour to try to write tests
around.
2024-01-30 15:08:27 -06:00
Daniel Lockyer
f76bb91122 Updated @elastic/elasticsearch to latest version
refs https://github.com/TryGhost/Toolbox/issues/501

- at this point, we have no real reason to keep this behind as it wasn't
  proven what the cause of the high CPU was, and it's just causing more
  lockfile issues with the resolution
2024-01-30 21:41:33 +01:00
Ryan Feigenbaum
1c017f1b7b
Add Lithuanian language support (#19621)
Add Lithuanian language (lt) support
2024-01-30 14:37:03 -05:00
Aileen Booker
c4912665e5 Removed DomainEventsAnalytics
closes CA-11

- Segment events in Ghost core are not used currently
2024-01-30 13:58:22 -04:00
Kevin Ansfield
3c56005d44
🐛 Fixed error when converting or pasting HTML content with headings+text nested inside lists (#19618)
closes https://github.com/TryGhost/Product/issues/4234

- bumps Koenig packages to version containing a fix to our denest transform so it properly handles denesting element nodes inside list item nodes
2024-01-30 13:45:58 +00:00
Ghost CI
5d19c75482 v5.78.0 2024-01-30 11:17:31 +00:00
Simon Backx
7d0be3f1a9
Improved sending email addresses for self-hosters (#19617)
ref https://github.com/TryGhost/Ghost/issues/12802
fixes DMA-27

- You can choose any support and newsletter email address in the UI
without verification (as long as your SMTP-server / Mailgun can send
from it)
- All emails will use the mail.from config as the from address as a
default:
- Staff notification emails no longer use the made up ghost@domain email
address
    - Newsletters no longer default to 'noreply@domain' 
- Member related emails (signin/signup/comment notifications...) will
continue to be send from the chosen support address (Portal settings →
Account page), but will now default to the mail.from config instead of
noreply@domain if no support address is set.
2024-01-30 11:21:08 +01:00
Steve Larson
68dda65a12
Added refresh to publishing test (#19612)
refs ENG-599
- added refresh to publishing workflow test
- member count is cached and not updated immediately upon adding a
member, but a count >0 is required in order to send a newsletter (what
this test tests)
- we are looking at updating the cached count; until then, a refresh
will be a performance hit but allow this test to pass
2024-01-29 14:15:56 -06:00
Chris Raible
975bb6849f
Renamed performanceMonitoring config to telemetry (#19613)
no issue

- Renaming the configuration parameter created in this commit:
e0dae46dfc
- No functional difference, this change just makes the configuration a
bit more succinct
2024-01-29 11:56:17 -08:00
Chris Raible
e0dae46dfc
Added basic instrumentation to the database connection pool (#19589)
no issue

- To help debug potential causes of slow/aborted get helpers, it would
be cool to get more visibility into how Ghost handles database
connections, particularly if it has to spend a long time waiting to
acquire a new connection from the pool.
- Under the hood, knex uses a package called tarn
(https://github.com/Vincit/tarn.js/tree/3.0.2) to manage the connection
pool. Tarn provides some hooks for instrumentation, so we can use those
to get some basic visibility into the connection pool.
- This PR adds handling for creating, acquiring and releasing
connections from Tarn's connection pool which logs some basic metrics,
particularly the queue length and time it takes to acquire a connection.
2024-01-29 10:25:35 -08:00
Ghost CI
1d4b076670 v5.77.0 2024-01-29 15:36:59 +00:00
punkyard
6c314adf65
Update signup-form.json (#19602)
few suggestions

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this
list, thanks!

- [ ] There's a clear use-case for this code change, explained below
- [ ] Commit message has a short title & references relevant issues
- [ ] The build will pass (run `yarn test:all` and `yarn lint`)

We appreciate your contribution!
2024-01-29 10:18:02 -05:00
punkyard
9f039c3c97
Update ghost.json (#19601)
few suggestions

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this
list, thanks!

- [ ] There's a clear use-case for this code change, explained below
- [ ] Commit message has a short title & references relevant issues
- [ ] The build will pass (run `yarn test:all` and `yarn lint`)

We appreciate your contribution!

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2024-01-29 10:17:46 -05:00
punkyard
7e1e869e00
Update comments.json (#19600)
few suggestions

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this
list, thanks!

- [ ] There's a clear use-case for this code change, explained below
- [ ] Commit message has a short title & references relevant issues
- [ ] The build will pass (run `yarn test:all` and `yarn lint`)

We appreciate your contribution!

Co-authored-by: Ryan Feigenbaum <48868107+royalfig@users.noreply.github.com>
2024-01-29 10:17:25 -05:00