Commit Graph

4446 Commits

Author SHA1 Message Date
Kevin Ansfield
e97717a0cc Added flag to skip gscan checks during boot
no issue

- bumped gscan version to provide `skipChecks` flag to `check` function
- added `optimization:themes:skipBootChecks` config flag defaulting to `false` to maintain current behaviour
  - updated theme service initialization to use `skipChecks: true` when the config flag is set
  - we only want to skip the checks during boot in specific cases to improve performance, they are still useful for general development and any production use-cases where themes get edited directly on the server
- updated our theme validate module to accept and pass through `skipChecks` option
- switched the `isZip` positional argument of `validate.check()` to an options object property to make usage cleaner
2024-10-10 16:27:43 +01:00
Daniel Lockyer
de5dcb8189 Fixed treeshaking and require size for date-fns
- we don't need to require the entire package and this costs 5% of our
  boot time
- this commit bumps NQL to the latest version, which fixes the requires
  to help with treeshaking and loading less code
2024-10-09 17:03:04 +01:00
renovate[bot]
1877419939 Update dependency express-session to v1.18.1 2024-10-08 21:05:01 +00:00
renovate[bot]
62d7b7ea52 Update dependency express to v4.21.1 2024-10-08 21:53:17 +01:00
Daniel Lockyer
8aa34fcf38 ️ Improved performance of several checks in GScan
ref f57ab075c6

- this commit bumps the GScan version in Ghost to include a commit that
  implements partial caching
2024-10-08 14:34:11 +01:00
renovate[bot]
747632bf45 Update dependency nx to v19.8.4 2024-10-08 07:40:09 +01:00
renovate[bot]
084022a30d Update dependency html-validate to v8.24.1 2024-10-07 15:13:31 +02:00
renovate[bot]
e65283f049 Update dependency i18next to v23.15.2 2024-10-07 00:52:05 +00:00
renovate[bot]
d7ab1c60d7 Update dependency @uiw/react-codemirror to v4.23.5 2024-10-07 00:51:08 +00:00
renovate[bot]
83e9eb1345
Pin dependency parse-prometheus-text-format to 1.1.1 (#21211)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[parse-prometheus-text-format](https://redirect.github.com/yunyu/parse-prometheus-text-format)
| devDependencies | pin | [`^1.1.1` ->
`1.1.1`](https://renovatebot.com/diffs/npm/parse-prometheus-text-format/1.1.1/1.1.1)
|

Add the preset `:preserveSemverRanges` to your config if you don't want
to pin your dependencies.

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguOTcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-03 19:16:42 +00:00
Chris Raible
768336efad
Added a prometheus metrics exporter to Ghost (#21193)
ref
https://linear.app/tryghost/issue/ENG-1505/add-prometheus-metrics-server-to-allow-monitoring-ghost-metrics

# Summary
This commit includes two main components: a prometheus client class to
collect metrics from Ghost, and a standalone metrics server that exposes
a /metrics endpoint at a separate port (9416 by default) from the main
Ghost app.

The prometheus client is a very thin wrapper around
[prom-client](https://github.com/siimon/prom-client). We could use
prom-client directly, but this approach should make it easier to switch
to a different prometheus client package (or make our own) if we ever
need to down the line.

The list of default metrics this enables is specified in an e2e test
[here](https://github.com/TryGhost/Ghost/pull/21192/files#diff-ebc52236be2cd14b40be89220ae961f48d3f837693f7d1da76db292348915941R66-R92).
This also gives us the ability to create and collect custom metrics,
although none are included in this commit yet.

# Configuration
The prometheus client and the metrics server are both disabled by
default, but can be enabled by setting the metrics_server:enabled flag
to true.

You can also define a custom host and port using `metrics_server:host`
and `metrics_server:port`.

## Why not expose the /metrics endpoint in one of the existing express
apps?
The standalone express app exists for two main reasons:

1. We don't want these metrics to be public, and the easiest way to
accomplish that is to expose the /metrics endpoint at a different port
that won't be exposed to the internet.

2. Creating a standalone express instance decouples the metrics endpoint
from the Ghost server, so if Ghost is not responding for whatever
reason, we should still be able to scrape metrics to understand what's
going on internally.


## Impact on Boot & Shut down time
The prometheus client is initialized early in the boot process so we can
collect metrics during the boot sequence. Testing locally has shown that
this increases boot time by ~20ms. The metrics server which exposes the
/metrics endpoint is not initialized until after the background
services, and it is not awaited, to avoid impacting boot time. None of
this code, including the requires, will run if the
metrics_server:enabled flag is set to false (or not set).

Shutting down the metrics server is added as a cleanup task for the main
Ghost server instance, and is setup to shut down with 0 grace period to
avoid impacting shut down time.
2024-10-03 11:34:25 -07:00
renovate[bot]
0bbb29fbf8 Update dependency sanitize-html to v2.13.1 2024-10-03 14:42:44 +00:00
renovate[bot]
34090f7370
Update dependency flexsearch to v0.7.43 (#19455)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [flexsearch](https://redirect.github.com/nextapps-de/flexsearch) |
[`0.7.21` ->
`0.7.43`](https://renovatebot.com/diffs/npm/flexsearch/0.7.21/0.7.43) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/flexsearch/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/flexsearch/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/flexsearch/0.7.21/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/flexsearch/0.7.21/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nextapps-de/flexsearch (flexsearch)</summary>

###
[`v0.7.43`](12f48e64f7...4c3966709f)

[Compare
Source](12f48e64f7...4c3966709f)

###
[`v0.7.42`](a0a798d7fe...12f48e64f7)

[Compare
Source](a0a798d7fe...12f48e64f7)

###
[`v0.7.41`](5c54b465a8...a0a798d7fe)

[Compare
Source](5c54b465a8...a0a798d7fe)

###
[`v0.7.40`](b8279ebddc...5c54b465a8)

[Compare
Source](b8279ebddc...5c54b465a8)

###
[`v0.7.39`](f18da33d8f...b8279ebddc)

[Compare
Source](f18da33d8f...b8279ebddc)

###
[`v0.7.34`](1d620d68c4...f18da33d8f)

[Compare
Source](1d620d68c4...f18da33d8f)

###
[`v0.7.33`](https://redirect.github.com/nextapps-de/flexsearch/compare/0.7.31...1d620d68c498e6617192fdd6ff6e0e70c666b254)

[Compare
Source](https://redirect.github.com/nextapps-de/flexsearch/compare/0.7.31...1d620d68c498e6617192fdd6ff6e0e70c666b254)

###
[`v0.7.31`](65b027ca31...0.7.31)

[Compare
Source](65b027ca31...0.7.31)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjEuMCIsInVwZGF0ZWRJblZlciI6IjM4Ljk3LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-02 16:21:12 +01:00
renovate[bot]
4bd844fc2c Update dependency @uiw/react-codemirror to v4.23.4 2024-10-02 09:34:41 +00:00
renovate[bot]
9a93a5cfc6 Pin dependency i18n-iso-countries to 7.12.0 2024-10-02 07:28:28 +00:00
Peter Zimon
7cb8cbdf7a
Showing country names instead of codes in Stats (#21172)
[ANAL-53](https://linear.app/tryghost/issue/ANAL-53/10-stats-page-engineering-stuff)

- So far only country codes were displayed instead of human readable country names in the Stats page
2024-10-02 09:17:06 +02:00
renovate[bot]
9834f0946c Update dependency nx to v19.8.3 2024-10-02 08:38:19 +02:00
renovate[bot]
e2d20d5c49 Update tiptap monorepo to v2.8.0 2024-09-30 16:05:32 +00:00
Michael Barrett
8fa9fb9c25
Updated search to be dynamic in admin-x-activitypub app (#21099)
refs
[AP-352](https://linear.app/tryghost/issue/AP-352/search-for-mastodon-usernames-in-ghost-admin)

Updated the search functionality in the admin-x-activitypub app to be
dynamic and utilise the search API endpoint provided by the activitypub
service

---------

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2024-09-30 11:32:05 +01:00
Daniel Lockyer
e2bf950b63 Removed unused @sentry/tracing dependency
- this isn't used anywhere so we can remove it and cleanup a dependency
2024-09-30 11:05:22 +02:00
renovate[bot]
06c54f2472 Update dependency terser to v5.34.1 2024-09-30 08:54:20 +00:00
renovate[bot]
d9a18a77a9 Update dependency webpack to v5.95.0 2024-09-30 08:52:06 +00:00
renovate[bot]
b4f2e03ae2 Update dependency nx to v19.8.2 2024-09-30 09:10:20 +02:00
Chris Raible
a9ace11d9d
Removed OpenTelemetry (#21145)
no issue

- This commit removes all OpenTelemetry related code and dependencies
from Ghost.
- The initial implementation was done as a POC but it raised some
performance concerns with boot time, so we never actually enabled it
widely.
- We can revisit this in the future, but in the meantime it's just
adding unnecessary dependencies and bloating the codebase.
2024-09-26 16:18:49 -07:00
renovate[bot]
bec6371e5c Update tiptap monorepo to v2.7.4 2024-09-26 13:01:56 +00:00
renovate[bot]
7b274497d2 Update tiptap monorepo to v2.7.3 2024-09-25 19:46:00 +00:00
renovate[bot]
3f0e4b4584 Update dependency mysql2 to v3.11.3 [SECURITY] 2024-09-25 15:02:44 +00:00
renovate[bot]
7f6517fbe8 Update dependency mysql2 to v3.11.2 [SECURITY] 2024-09-25 14:38:19 +00:00
renovate[bot]
1616acc20d Update dependency mysql2 to v3.11.1 [SECURITY] 2024-09-25 12:50:53 +00:00
renovate[bot]
b6e5c0fe68 Update tiptap monorepo to v2.7.2 2024-09-25 12:13:09 +00:00
Daniel Lockyer
5a72c5ad91 Updated Nx to v19
refs https://github.com/nrwl/nx/releases/tag/19.8.0

- this commit updates Nx to v19
- we need to add some extra commands to the dev script to stop and
  restart the Nx daemon, so it's ready and running before we execute a
  bunch of Nx commands concurrently
- this also updates nx.json to the format needed for the latest version
2024-09-25 10:16:08 +02:00
renovate[bot]
662d10077f Update dependency html-validate to v8.24.0 2024-09-25 08:23:04 +02:00
renovate[bot]
31f1d7b464
Update dependency @tinybirdco/charts to v0.2.1 (#20937)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @&#8203;tinybirdco/charts | [`0.2.0-beta.2` ->
`0.2.1`](https://renovatebot.com/diffs/npm/@tinybirdco%2fcharts/0.2.0-beta.2/0.2.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tinybirdco%2fcharts/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tinybirdco%2fcharts/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tinybirdco%2fcharts/0.2.0-beta.2/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tinybirdco%2fcharts/0.2.0-beta.2/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-24 11:08:32 +01:00
renovate[bot]
355793ebd1 Update dependency tailwindcss to v3.4.13 2024-09-24 08:59:06 +02:00
Kevin Ansfield
459a2c553e Added full-page refresh when new post route is in a bad state
ref https://linear.app/tryghost/issue/ONC-323

When the store gets into a bad state for new posts that causes saves to fail we can detect that by looking at the `model.isNew` property. Currently our best approach to fix this state is to restart the app.

- added a `didTransition()` hook to our `lexical-edit.new` route
  - detects the bad state, logs the error, and triggers a browser refresh
  - logs with a `recreatedPostIsGood` property that will let us know if we could instead just try recreating the post and avoiding a full refresh (so far we have no reproduction case so we need to learn what we can)
- added `sinon-chai` dependency for better assertions on spies/stubs
- added `sentry-testkit` dependency so we can test our Sentry integration calls
  - we can't use sinon for these calls because of the way Sentry's es6 imports work
- extracted our full Sentry config object generation to a util function so it can be re-used in unit tests
  - updated our integrations list to disable the default `dedupe` integration because it can cause very unexpected/difficult to debug test failures when you're asserting using `sentry-testkit`
2024-09-23 22:38:34 +01:00
renovate[bot]
7d441f24be Update dependency ember-auto-import to v2.8.1 2024-09-23 09:34:16 +02:00
renovate[bot]
894a961f9e Update dependency tailwindcss to v3.4.12 2024-09-23 09:13:59 +02:00
renovate[bot]
a1dcd9168d Update dependency ember-auto-import to v2.8.0 2024-09-23 09:08:50 +02:00
renovate[bot]
56af0e0095 Update dependency html-validate to v8.23.0 2024-09-23 08:59:09 +02:00
renovate[bot]
ed04bd4a8b Pin dependency microdiff to 1.4.0 2024-09-23 08:56:08 +02:00
renovate[bot]
6d80063539 Update dependency @uiw/react-codemirror to v4.23.3 2024-09-23 06:34:27 +00:00
renovate[bot]
78ad06226a Update dependency react-select to v5.8.1 2024-09-19 15:41:43 +00:00
renovate[bot]
46aa2a7ce7
Update Koenig packages (#21048)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons

When a bookmark is added(pasting a URL) into the editor we’re immediately hitting the oembed endpoint twice.
The editor shouldn’t be firing a second bookmark oembed request when it’s already been given all the bookmark data from the first request.
Details: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons#comment-852d53dc
2024-09-19 18:19:36 +05:30
renovate[bot]
8d957c3ec1 Update dependency @slack/webhook to v7.0.3 2024-09-18 06:49:39 +00:00
Daniel Lockyer
5832ab5138 Added workaround for internal adapter dependencies
refs https://linear.app/tryghost/issue/DEV-23/workaround-for-yarn-caching-issues

- in our build pipeline, we add some more dependencies for our internal
  adapters
- recently we've been seeing caching issues with these dependencies, not
  sure why
- to workaround that, we'll just include them here and eventually bring
  the adapters into the OSS repo
2024-09-18 08:34:51 +02:00
Kevin Ansfield
03df113d5c Improved logging of unsaved changes modal
ref https://linear.app/tryghost/issue/ENG-661

Logging the full lexical objects to Sentry for the "showing leave editor modal" event isn't very useful because they almost always truncated due to size or stripped due to potentially sensitive data which makes the reports difficult to debug and action.

- added `code` to the context for each report to make identification easier
- updated `reason` for the lexical diverged reason to better match what's happened
- stripped `lexical`, `scratch`, and `secondaryLexical` from the context that is logged to Sentry because they aren't actionable there and just add noise
- added a diff to the logged context for the lexical change reason to more easily identify the changes that triggered an unexpected modal display
  - previously we didn't get full objects in Sentry so couldn't do a comparison and the local workflow was to grab the logged scratch and secondaryLexical values and run a manual diff - this should help in both cases
2024-09-17 17:22:02 +01:00
Princi Vershwal
1c08fd2b9d
Update dependency gscan to v4.43.5
Ref:
https://linear.app/tryghost/issue/ONC-318/support-escalation-re-500-error,
https://linear.app/tryghost/issue/ENG-1444/gscan-slow-checking-for-themes-with-many-files
2024-09-17 13:40:36 +00:00
renovate[bot]
c5dd77e551 Update dependency terser to v5.33.0 2024-09-17 12:27:26 +00:00
renovate[bot]
3d65690987 Update dependency jwk-to-pem to v2.0.6 2024-09-17 14:13:00 +02:00
Sag
430fbdb987
🐛 Fixed member filtering for "Unsubscribed from newsletter" filters (#20926)
ref https://linear.app/tryghost/issue/ENG-1466
ref https://linear.app/tryghost/issue/ENG-1484

- Previously, filtering members with multiple "Unsubscribed from
newsletter x" led to no filtering at all, all members were returned
- This was caused by a bug in NQL, that is fixed in version 0.12.5, cf.
[commit](dd18d1d6ca)
- We're also removing the safeguard in the product around bulk deletion
when multiple newsletter filters are in use, as the root problem has
been fixed
2024-09-16 11:16:49 +02:00