Commit Graph

39850 Commits

Author SHA1 Message Date
Bastien
c336d46352
🌐 Improved French translations (#21570)
ref https://ghost.org/changelog/internationalization/

- I've changed "email" to "e-mail", which is more correct in French. The
official term is "courriel" but it sounds a bit old-fashioned.
- Apart from that, I've made a few harmonisations and small corrections to
ensure consistency between the files.
2024-11-11 10:08:18 +08:00
Chris Raible
85408d10b7
Added connection pool metrics to prometheus client (#21576)
ref
https://linear.app/ghost/issue/ENG-1592/start-monitoring-connection-pool-utilization-in-ghost

- This commit adds prometheus metrics to the connection pool so we can
start to track connection pool utilization, number of pending acquires,
and also adds some basic SQL query summary metrics like queries per
minute and query duration percentiles.
- The connection pool has now been theorized to be a main constraint of
Ghost for some time, but it's been challenging to get actual visibility
into the state of the connection pool. With this change, we should be
able to directly observe, monitor and alert on the connection pool.
- Updated grafana version to fix a bug in the query editor that was
fixed in 8.3, even though this is a couple versions ahead of production
2024-11-07 23:01:34 -08:00
Ghost CI
08fe08a0a2 Merged v5.100.1 into main 2024-11-07 23:24:07 +00:00
Ghost CI
d3625537e0 v5.100.1 2024-11-07 23:24:04 +00:00
Hannah Wolfe
5229fd44ab Moved newsletter date localisation behind labs flag (#21575)
ref https://github.com/TryGhost/Ghost/pull/21573

- We discussed this, and figured we should get this behind the flag for
now, even though it's pulled
- This gives us the ability to do a fast revert if we have to later,
which is the point of having the labs "GA FEATURES" array
- Note this removes the labsEnabled variable in the tests to make it
clearer if the flag is off or on (it was off!)
2024-11-07 16:47:24 -06:00
Hannah Wolfe
cdb92f1528
Moved newsletter date localisation behind labs flag (#21575)
ref https://github.com/TryGhost/Ghost/pull/21573

- We discussed this, and figured we should get this behind the flag for
now, even though it's pulled
- This gives us the ability to do a fast revert if we have to later,
which is the point of having the labs "GA FEATURES" array
- Note this removes the labsEnabled variable in the tests to make it
clearer if the flag is off or on (it was off!)
2024-11-07 22:46:30 +00:00
Hannah Wolfe
3dc3d7e433 🐛 Fixed newsletter not sending if locale is invalid (#21573)
ref https://github.com/moment/luxon/blob/master/docs/intl.md

- We noticed the following error trace: RangeError: Incorrect locale
information provided
at BatchSendingService.retryDb
(/home/ghost/node_modules/@tryghost/email-service/lib/BatchSendingService.js:639:32)
    at new DateTimeFormat (<anonymous>)
at getCachedDTF
(/home/ghost/node_modules/luxon/build/node/luxon.js:621:11)
at new PolyDateFormatter
(/home/ghost/node_modules/luxon/build/node/luxon.js:842:16)
at Locale.dtFormatter
(/home/ghost/node_modules/luxon/build/node/luxon.js:1066:12)
at Formatter.dtFormatter
(/home/ghost/node_modules/luxon/build/node/luxon.js:2274:21)
at Formatter.formatDateTime
(/home/ghost/node_modules/luxon/build/node/luxon.js:2280:17)
at DateTime.toLocaleString
(/home/ghost/node_modules/luxon/build/node/luxon.js:6893:78)
at formatDateLong
(/home/ghost/node_modules/@tryghost/email-service/lib/EmailRenderer.js:45:74)
at Object.getValue
(/home/ghost/node_modules/@tryghost/email-service/lib/EmailRenderer.js:683:47)
at
/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:158:36
    at Array.map (<anonymous>)
at
/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:154:54
    at Array.map (<anonymous>)
at SendingService.buildRecipients
(/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:151:24)
at SendingService.send
(/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:127:33)
at response.retryDb
(/home/ghost/node_modules/@tryghost/email-service/lib/BatchSendingService.js:451:51)
- This is due to the locale being user-input - it can be set to any
string.
- In our email sending code we pass the string to luxon to format dates,
which errors if the locale is not valid according it Intl.
- This fix ensures that the locale is valid before passing it to luxon,
falling back to en-gb if the locale is not valid
2024-11-07 16:18:09 -06:00
Hannah Wolfe
d3cda0d39d
🐛 Fixed newsletter not sending if locale is invalid (#21573)
ref https://github.com/moment/luxon/blob/master/docs/intl.md

- We noticed the following error trace: RangeError: Incorrect locale
information provided
at BatchSendingService.retryDb
(/home/ghost/node_modules/@tryghost/email-service/lib/BatchSendingService.js:639:32)
    at new DateTimeFormat (<anonymous>)
at getCachedDTF
(/home/ghost/node_modules/luxon/build/node/luxon.js:621:11)
at new PolyDateFormatter
(/home/ghost/node_modules/luxon/build/node/luxon.js:842:16)
at Locale.dtFormatter
(/home/ghost/node_modules/luxon/build/node/luxon.js:1066:12)
at Formatter.dtFormatter
(/home/ghost/node_modules/luxon/build/node/luxon.js:2274:21)
at Formatter.formatDateTime
(/home/ghost/node_modules/luxon/build/node/luxon.js:2280:17)
at DateTime.toLocaleString
(/home/ghost/node_modules/luxon/build/node/luxon.js:6893:78)
at formatDateLong
(/home/ghost/node_modules/@tryghost/email-service/lib/EmailRenderer.js:45:74)
at Object.getValue
(/home/ghost/node_modules/@tryghost/email-service/lib/EmailRenderer.js:683:47)
at
/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:158:36
    at Array.map (<anonymous>)
at
/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:154:54
    at Array.map (<anonymous>)
at SendingService.buildRecipients
(/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:151:24)
at SendingService.send
(/home/ghost/node_modules/@tryghost/email-service/lib/SendingService.js:127:33)
at response.retryDb
(/home/ghost/node_modules/@tryghost/email-service/lib/BatchSendingService.js:451:51)
- This is due to the locale being user-input - it can be set to any
string.
- In our email sending code we pass the string to luxon to format dates,
which errors if the locale is not valid according it Intl.
- This fix ensures that the locale is valid before passing it to luxon,
falling back to en-gb if the locale is not valid
2024-11-07 21:55:20 +00:00
Chris Raible
2eb1fdf7cd
Removed nodemon in favor of node --watch (#21572)
no issue

- We had reintroduced nodemon in
af0f26c75f (diff-bf18f8caf848e17b35e266db04bcaeaad05a3e5d069846615d2b1260482396e1)
for the docker setup, but it has since caused some issues with the `yarn
dev` script.
- In particular, it was causing a restart while migrations were running
in development, which left a migration lock on and prevented Ghost from
starting.
- This commit removes nodemon and replaces it with node --watch, which
we had been using in the past without issues.
2024-11-07 12:25:22 -08:00
Chris Raible
8aba92e444
Fixed CPU Usage chart in grafana dashboard (#21568)
ref
https://linear.app/ghost/issue/ENG-1505/start-monitoring-ghosts-constraints-and-our-3-goals-using-prometheus

- Using `irate` for aggregating CPU usage was resulting in some strange
behavior — the CPU Usage chart would zero out after a few mins of
running. Switching to regular `rate` seems to have fixed the issue
completely.
2024-11-07 10:18:41 -08:00
Djordje Vlaisavljevic
5138ef8ed3 Bumped admin-x-activitypub package
ref https://linear.app/ghost/issue/AP-522/inbox-view-thumbnail-size-inconsistencies
2024-11-07 17:36:03 +00:00
Djordje Vlaisavljevic
a9a72f9445 Made hover states for list items look nicer
ref https://linear.app/ghost/issue/AP-506/suggested-profiles-hover-refinement, https://linear.app/ghost/issue/AP-530/notifications-list-hover-state-is-inconsistent-with-the-rest, https://linear.app/ghost/issue/AP-516/profile-view-hover-state-on-profile
2024-11-07 17:36:03 +00:00
Djordje Vlaisavljevic
c5861a7664 Made all thumbnails in Inbox layout the same width
ref https://linear.app/ghost/issue/AP-522/inbox-view-thumbnail-size-inconsistencies
2024-11-07 17:36:03 +00:00
Djordje Vlaisavljevic
3709a4811e
Improved ActivityPub drawer view UI (#21521)
ref https://linear.app/ghost/issue/AP-507/inbox-view-missing-min-width-for-inbox-card, https://linear.app/ghost/issue/AP-562/remove-unused-viewfollowersmodal-and-viewfollowingmodal-files, https://linear.app/ghost/issue/AP-559/add-post-stats-and-buttons-to-articles-in-drawer-view, https://linear.app/ghost/issue/AP-468/drawer-visual-refinements, https://linear.app/ghost/issue/AP-558/add-actor-info-to-articles-in-drawer-view, https://linear.app/ghost/issue/AP-573/add-anchor-link-to-replies-in-the-drawer

- Made `Articles` in drawer view wider for better reading experience
- Added `Actor` info to `Articles` in drawer view for more context about who posted it
- Added `Like` and `Reply` buttons and counters to `Articles` in drawer view
- Clicking on a Reply notification or Reply icon in the drawer view now scrolls you directly to replies
- Removed modals we’re no longer using
- Updated `RoutingProvider` so it can work without any modals passed to
it
2024-11-07 15:59:29 +00:00
Bastien
28062367d9
🌐 Updated French translations (#21498)
ref https://ghost.org/changelog/internationalization/

- It's difficult out of context to know whether to use an infinitive,
_Ajouter votre commentaire_ or an imperative, _Ajoutez votre
commentaire_. English doesn't make the difference, but French does. By
default, an infinitive is preferable because it remains a suggestion,
whereas an imperative gives an order. For example, I think that _Ajoutez
votre commentaire_ is not relevant, because you don't necessarily have
to add a comment, but you can, so you should say _Ajouter votre
commentaire_. I've tried to be as precise as possible, but you may need
to make some adjustments with the context.

- I find that the word _membre_ is too literal a translation of the
English language and includes too many innuendos such as "member of a
community", "member of a clan", "member of a club", and frankly, it's
not relevant to many blogs. The word _abonné_ is more relevant, because
it doesn't imply a social affiliation. As for the discussion, I've even
taken the liberty of writing _discussion entre lecteurs_, because that's
essentially what it is. It's not a discussion between members or
subscribers, it's a discussion between _readers_.

- Some placeholders are completely American (Jamie Larson), so I've
replaced him with a French one (Jean Martin).

- Complimentary is a word that I didn't understand in the context of
Ghost. I have the impression that it means _offert_, but I don't
understand when it's used.
2024-11-07 15:39:12 +00:00
Ghost CI
87b0c04e26 v5.100.0 2024-11-07 15:02:46 +00:00
Daniël van der Winden
eae76703eb
Custom Integrations and Webhooks layout fixes (#21565)
fixes
https://linear.app/ghost/issue/DES-790/some-urls-not-wrapping-in-integration-detail-modal

- Webhook URLs were breaking out of the modal container. They now wrap
across a few lines.
- Long descriptions of Custom Integrations caused the integration's icon
to scale down. That no longer happens.
- Descriptions of Custom Integrations wrap properly.
2024-11-07 14:24:15 +00:00
Fabien 'egg' O'Carroll
d6cedaae06
Initialised ActivityPub integration on boot (#21558)
refs https://linear.app/ghost/issue/AP-500

We've got a new @tryghost/activitypub package, which is gonna handle all
of the wiring between Ghost and ActivityPub. Currently that is just the
configuration of webhooks for the internal ActivityPub integration.

All this logic is run on the boot of Ghost, though notably in a
non-blocking manner, it's initialised as part of the background services
so it should not have an effect on the time to serving requests. having
said that - it needs to be defensive against errors, which is why the
entire network request is in a try/catch, as well as lookups for the
integration able to handle missing data.

Unit tests use an in-memory sqlite instance, which means we're testing a
full flow, ideally there would be a way to get the schema from Ghost for
this, but for now this is acceptable IMO.
2024-11-07 13:55:51 +00:00
Fabien 'egg' O'Carroll
8f9dbcd0ea
Added Ghost ActivityPub internal integration (#21540)
refs https://linear.app/ghost/issue/AP-500

Rather than having to manually create an integration for communication
with the ActivityPub service, we are going to have an internal
integration which will then be used to handle webhooks between Ghost &
ActivityPub

The 'internal' type has been used to keep it out of the UI/API but
available for all Pro customers, which is necessary during the private
beta.

---------

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-11-07 13:55:11 +00:00
Hannah Wolfe
bb9a69edfe
Added i18n for portal, newsletters, search, comments, etc (#21547)
ref https://ghost.org/changelog/internationalization/ closes:
https://linear.app/ghost/issue/ENG-1038/make-month-and-year-translatable

- This takes our automatic translations feature out of beta
- Translations are available in ~60 languages, although many are not yet complete
- Translations cover portal, comments, search, newsletter emails and member transactional emails
- If you find a missing translation, you can contribute it in the Ghost repo, by editing the files here: https://github.com/TryGhost/Ghost/tree/main/ghost/i18n/locales
- This feature was created 100% by the Ghost community

Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
2024-11-07 13:04:45 +00:00
Daniel Sjöberg
d1722b1be3
🌐 Updated swedish translations (#21562)
ref https://ghost.org/changelog/internationalization/

- added missing Swedish translations and improved a few existing
ones
2024-11-07 12:24:22 +00:00
Andrei Hodorog
17b34b7a63
🌐 Updated Romanian translations (#21550)
ref https://ghost.org/changelog/internationalization/
2024-11-07 20:22:15 +08:00
echobilisim3421
72c0c2e7ce
Updated Turkish translations
ref https://ghost.org/changelog/internationalization/
2024-11-07 20:20:11 +08:00
echobilisim3421
085450c5e5
🌐 Updated Turkish translations (#21553)
ref https://ghost.org/changelog/internationalization/
2024-11-07 20:18:27 +08:00
Daniël van der Winden
86ecedf079
Revert "Admin navigation settings fix (#21323)" (#21563)
This reverts commit eaed33972f.

The fix we shipped for using the `RETURN` key to create navigation items
in Admin broke something with regards to saving the URL, so we're
reverting that change.
2024-11-07 12:34:34 +01:00
Sanne de Vries
5f7734bf36
Fixed comments dropdown menu being cutoff by iframe (#21555)
REF https://linear.app/ghost/issue/PLG-255/dropdown-cut-off-by-iframe
- Avoided menu cutoff by positioning the dropdown of the last comment
above the MoreButton
2024-11-07 11:39:52 +01:00
Cathy Sarisky
274f2aa8d3
🐛 Fixed translations not being picked up in newsletters without reboot (#21549)
ref https://ghost.org/changelog/internationalization/

- this fixes an error in which changing the language (or sliding the i18n
toggle) didn't correctly update email-service.

---------

Co-authored-by: Sag <guptazy@gmail.com>
2024-11-07 17:55:21 +08:00
Kevin Ansfield
79f41dc679 Added in-reply-to support to comments API
ref https://linear.app/tryghost/issue/PLG-230

- adds `in_reply_to_id` to API output
- adds `in_reply_to_snippet` to API output
  - dynamically generated from the HTML of the replied-to comment
  - excluded if the replied-to comment has been deleted or hidden
- adds `commentSnippet` to `@tryghost/html-to-plaintext`
  - skips anchor tag URLs as they won't be useful for snippet purposes
  - skips blockquotes so the snippet is more likely to contain the unique content of the replied-to comment when it's quoting a previous comment
  - returns a single line (no newline chars)
- allows setting `in_reply_to_id` when creating comments
  - id must reference a reply with the same parent
  - id must reference a published comment
- adds email notification for the original reply author when their comment is replied to
2024-11-07 09:20:03 +00:00
Kevin Ansfield
f9b0280553 Added comments.in_reply_to_id column migration
ref https://linear.app/tryghost/issue/PLG-230

- `comments.in_reply_to_id` will be used to keep a reference to the comment that the new comment was directed at
- used only for replies-to-replies, will be `null` for the top-level parent and `null` for any replies directly to that parent
- technically allows for infinite nesting within a parent comment thread but we won't be using that ability for now
- `comments.parent_id` will be kept as it provides a useful optimisation for loading the top-level comments list
- we're not using `comments.parent_id` for this to keep complexity down and avoid the need for recursive lookups
2024-11-07 09:20:03 +00:00
Fabien 'egg' O'Carroll
6dc2e7f3fe
Refactored identity token generation into separate service
refs https://linear.app/ghost/issue/AP-500

The logic for generating identity tokens, whilst small, is something
that we don't want to duplicate - as it concerns security & access - so
can easily break interactions between different services. We're gonna
need to use identity tokens as part of the initialisation of the
activitypub service, so this is pulling it out preemptively for that use
case

We shouldn't have logic inside of the endpoint controllers anyway, so
this is kinda general cleanup.
2024-11-07 13:16:33 +07:00
mafizaki
12d7f0c4fb
🌐 Added Polish translations for search (#21548)
no issue
2024-11-07 01:56:04 +00:00
Chris Raible
7efbc60e1e
Improved error log output for prometheus pushgateway requests (#21556)
ref
https://linear.app/ghost/issue/ENG-1746/enable-ghost-to-push-metrics-to-a-pushgateway

- Trying to get Ghost working with the prometheus pushgateway in
staging, but it's logging an error each time it tries to push the
metrics. The error output is pretty useless for debugging, so this
commit improves the error messages to make it easier to debug.
2024-11-06 15:03:10 -08:00
Chris Raible
a26f63dc11
Configured local prometheus and pushgateway in docker-compose (#21538)
ref
https://linear.app/ghost/issue/ENG-1746/enable-ghost-to-push-metrics-to-a-pushgateway

- Added prometheus job to scrape the pushgateway
- Updated grafana dashboard to use the metrics from the pushgateway
- Added some logging to prometheus client to log errors when pushing
metrics to pushgateway
2024-11-06 11:36:37 -08:00
MonRyse
cd8d581aab
🌐 Added more Italian translations (#21535)
no issue

- filled some missed translations but there are yet some missed
translations to complete. Actually i'm not managing newsletters so i
need more context to translate them correctly.
2024-11-06 12:20:51 +00:00
Princi Vershwal
1655799aea
🐛 Fixed error message for when 2fa email sending fails (#21541)
Fixes
https://linear.app/ghost/issue/ENG-1683/display-useful-error-message-if-2fa-email-send-fails
2024-11-06 12:18:41 +00:00
Fabien 'egg' O'Carroll
466d7fef3f
Bumb admin-x-activitypub to 0.3.10 (#21546)
closes https://linear.app/ghost/issue/AP-523
2024-11-06 11:07:17 +00:00
Sodbileg Gansukh
9516d144a0
Used theme package name for hiding theme-specific font settings (#21545)
ref DES-929
2024-11-06 10:42:32 +00:00
Sodbileg Gansukh
fefd45a27b
Added Libre Baskerville font (#21539)
ref DES-903
2024-11-06 15:27:47 +08:00
Andrei Hodorog
4283c417bb
🌐 Updated Romanian (RO) translation strings (#21542)
no issue
2024-11-06 06:39:26 +00:00
renovate[bot]
7a7e77f054 Pin dependency prom-client to 15.1.3 2024-11-06 04:37:08 +00:00
Sodbileg Gansukh
e25d5cc105
Hide typography related theme settings from official themes (#21530)
ref DES-929
2024-11-06 12:26:20 +08:00
Yovko Lambrev
9f9c8dc364
🌐 Updated Bulgarian translations (#21533)
no issue

- Some lexical and punctuation improvements of the previous translations
- Bulgarian translation of the newly introduced newsletter strings
2024-11-06 10:00:08 +08:00
Chris Raible
190ebcd684
Added ability to push prometheus metrics to a pushgateway (#21526)
ref
https://linear.app/ghost/issue/ENG-1746/enable-ghost-to-push-metrics-to-a-pushgateway

- We'd like to use prometheus to expose metrics from Ghost, but the
"standard" approach of having prometheus scrape the `/metrics` endpoint
adds some complexity and additional challenges on Pro.
- A suggested simpler alternative is to use a pushgateway, to have Ghost
_push_ metrics to prometheus, rather than have prometheus scrape the
running instances.
- This PR introduces this functionality behind a configuration. 
- It also includes a refactor to the current metrics-server
implementation so all the related code for prometheus is colocated, and
the configuration is a bit more organized. `@tryghost/metrics-server`
has been renamed to `@tryghost/prometheus-metrics`, and it now includes
the metrics server and prometheus-client code itself (including the
pushgateway code)
- To enable the prometheus client alone, `prometheus:enabled` must be
true. This will _not_ enable the metrics server or the pushgateway — it
will essentially collect the metrics, but not do anything with them.
- To enable the metrics server, set `prometheus:metrics_server:enabled`
to true. You can also configure the host and port that the metrics
server should export the `/metrics` endpoint on in the
`prometheus:metrics_server` block.
- To enable the pushgateway, set `prometheus:pushgateway:enabled` to
true. You can also configure the pushgateway's `url`, the `interval` it
should push metrics in (in milliseconds) and the `jobName` in the
`prometheus:pushgateway` block.
2024-11-05 11:50:39 -08:00
renovate[bot]
b6f1ecc149 Update dependency mysql2 to v3.11.4 2024-11-05 18:22:17 +00:00
Fabien 'egg' O'Carroll
b591912c74
Updated the local state after following an account (#21509)
refs https://linear.app/ghost/issue/AP-523

We want to preempt the Accept activity from our Follows, so we make the
assumption that it's succeeded. What this means is that we have to
update our `following`, `followingCount` as well as the fetched profile
to set the `isFollowing` property. This gives a more fluid user
experience when following accounts and keeps our state up to date.

Accounts where the follow request has to be accepted manually, are a
little trickier as we don't currently have easy access to the "requested
but not accepted state"
2024-11-06 00:15:39 +07:00
Kevin Ansfield
c0a00cabe4 Bumped Comments-UI to 0.21.8
no issue
2024-11-05 10:55:50 +00:00
Daniël van der Winden
9d0e4e7d45
Updated Signup Page (#21434)
fixes
https://linear.app/ghost/issue/DES-881/sign-up-flow-on-mobile-with-checkbox-on-requires-ux-improvement

On mobile, the Sign Up button is no longer sticky. This ensures
customers scroll down and see the checkbox before they hit the button.

If they do still miss the checkbox, we now have a check in place that
— if the checkbox is the last missing thing — scrolls the checkbox into
view upon submission.

https://github.com/user-attachments/assets/5d7867b6-d60c-4844-9482-af04a0eb1eaf
2024-11-05 10:51:14 +01:00
Daniel Lockyer
18adf4b000 Optimized collating members and email IDs
- using lodash to do this is unnecessarily heavy, so this commit
  switches the code to the equivalent native version
- as mentioned in the comment I added, I think we can further optimize
  this by storing it as a Set and then calling `Array.from` once, but
  that's a step too far for now
2024-11-05 08:49:34 +01:00
Daniel Lockyer
44edf3d379 Removed duplicate serialization for offers
- we can skip an extra `toJSON` call here by storing the value and
  re-using it, which means we can cut down on the number of calls, which
  can be particularly heavy when this codepath is hit hard
2024-11-05 08:49:34 +01:00
Duy
19f6f910b6
Updated Vietnamese translations in newsletter.json (#21525)
no issue
2024-11-05 11:51:58 +08:00