Commit Graph

58 Commits

Author SHA1 Message Date
renovate[bot]
19ebc03bdb Pin dependencies 2025-07-10 16:42:09 +10:00
James Loh
91a279fae9 Renovate: Slightly tweak config
ref

- Use best-practices instead of recommended as its the newer default
- Don't rate limit, just slam us
- Use branch merges over PRs where told to
- Pin all deps not just dev ones
- Everything else that was removed is now just included via `config:best-practices`
2025-07-10 16:36:51 +10:00
James Loh
e24893139b Pin to specific versions of packages to make renovate clearer 2025-07-10 16:30:23 +10:00
James Loh
c07d7cf7cf Don't pin AP Migration container as well 2025-07-10 16:26:23 +10:00
James Loh
3d8e896403 Restrict MySQL version to 8.0.x
no ref

- We officially only support MySQL v8, not 8.4 or 9, so can't go above this
2025-07-10 16:23:01 +10:00
James Loh
a081853573 Disable Major docker upgrades
no ref

- At the moment this would try and upgrade us to MySQL v9 which we don't officially support
2025-07-10 16:23:01 +10:00
James Loh
eac2324292 Start setting up initial renovate config 2025-07-10 16:23:01 +10:00
James Loh
afa3bb1ea9 Update AP with additional endpoints and make default proxying easier 2025-07-10 16:04:59 +10:00
Fabien O'Carroll
6e2f94f25d Updating ActivityPub paths
We do not support running on a subdirectory
We need to proxy webfinger requests for AP to work
2025-07-10 16:04:59 +10:00
Chris Raible
6e5400acb5 Updated Tinybird tracker endpoint to use versioned API endpoint (#17)
ref https://linear.app/ghost/issue/PROD-2270/update-the-ghost-docker-repo-to-use-the-apiv1page-hit-endpoint

The Analytics Service is now using a new versioned endpoint at `/api/v1/page_hit` instead of the `/tb/web_analytics` endpoint. This update's Ghost's configuration to use this new endpoint for the tracker requests.

Note: this will require a docker compose pull to get the latest version of the analytics service, which includes the new versioned endpoint.
2025-07-09 20:53:40 -07:00
James Loh
1630a4e60f Slightly tweak wording after feedback
Closes https://linear.app/ghost/issue/ENG-2435
2025-07-10 13:13:19 +10:00
James Loh
cad2d17db5 Ghost: Added some very basic mail setup placeholders
ref https://linear.app/ghost/issue/ENG-2435

- Mail must be setup to have a proper functioning Ghost install
- Bulk mail doesn't require env variables but standard SMTP mail does
- We'll update the docs but prompting users in the example env file is a starting point
2025-07-10 13:11:09 +10:00
James Loh
bb09cd2c2a Start MySQL container earlier on in migration
- The idea here is this can start up and do its thing in the background whilst we're rsync'ing content and saves us waiting longer later on
2025-07-09 17:15:30 +10:00
James Loh
511a50079f Add some additional help commands and a help script
no ref

- This should help users with the 'What next?' question at the end of their migration and gives them something to come back to once done
2025-07-09 17:15:30 +10:00
James Loh
87b0b3a556 Implemented some automatic search for Ghost installations
no ref

- Our docs suggest installation Ghost by default in `/var/www/` so search one level deep for Ghost installations
- If we find any, prompt the user if any of these are the ones they want to migrate otherwise let users prompt for a custom dir
2025-07-09 17:02:35 +10:00
James Loh
c18cc88f7f Make rsync progress quieter
no ref

- rsync will print us out a nice progress screen if we lower the verbosity which is nicer than outputting all of the files we're moving
2025-07-09 17:02:35 +10:00
James Loh
8411a38ccc Silence MySQL password errors
no ref

- Using a passsord on the CLI causes MySQL to print 'mysql: [Warning] Using a password on the command line interface can be insecure.' which doing via environment variables prevents
- This also fixes our other `cut` usages in the event the string has a
  `=` in it not printing the whole string
2025-07-09 17:02:35 +10:00
James Loh
c9b43fb74e Silence stopping Nginx
no ref

- No reason beyond making things quieter
2025-07-09 15:16:43 +10:00
James Loh
7f332ff9ac Start exposing Ghost on localhost and template port
no ref

- The thinking here is this allows users to more easily run multiple Ghost instances on the same server by templating the Ghost port
- Majority wont need this but it also simplifies the message around having to forward traffic if you don't start Caddy
2025-07-09 15:16:43 +10:00
James Loh
7bb2eec30b Don't prompt users to import configuration
no ref

- 99% of users will want to import their configuration by default so just do it and let users know
- We now just print the config we're importing then continue on
2025-07-09 15:16:43 +10:00
James Loh
0a64820e78 Migrate script: Copy and wording updates
no ref
2025-07-09 15:16:43 +10:00
Chris Raible
1585fe040f Moved Tinybird tracker token to the analytics service 2025-07-08 17:34:46 -07:00
James Loh
6890f5c4c6 Improved MySQL migration system
no ref

- Currently we prompt a user for a username to dump their Ghost database with which can be confusing if users can't remember their database details
- The Ghost user _likely_ has the required permissions to dump the database itself so we can first try that without prompting the user and _then_ prompt them if it doesn't work
- We added `--no-tablespaces` to the dump command to try and reduce the likelyhood of hitting users not having the `PROCESS` permission since most hosted DBs don't let this and Ghost's DB setup doesn't require DBs be dumped with that anyway
2025-07-08 15:57:13 +10:00
James Loh
fb8703d862 Update CLAUDE.md to latest version 2025-07-08 14:57:49 +10:00
James Loh
60c018371e Redo MySQL healthcheck to be more generic
no ref

- This follows a more Docker standard approach by using MySQL admin's `ping` tool
- `start_interval` and `start_period` are required just to give MySQL a bit of time to start up and create the initial DBs on first boot
- We need to use `$$` to escape the variable in the compose file so it
  goes through to the healthcheck as a variable to expanded there
2025-07-08 14:25:13 +10:00
James Loh
9563a311be Added in yaml schema to aid IDE completion
no ref
2025-07-08 14:16:24 +10:00
James Loh
f384c7b906 TB: Move configuration to UI instead of env
- TB can now be toggled via the UI and setting it via env variables means the setting can never be toggled on/off properly
- Doing it this way lets users control things more
2025-07-03 17:56:11 +10:00
James Loh
22af0fb447 TB: Remove requirement for UUID setting
Closes https://linear.app/ghost/issue/ENG-2442/
ref e97d6c027c

- Ghost used to require this to set/manage a UUID in TB/clickhouse but we now use Ghost's generated one directly, instead of requiring it here
- Cleaning this up because otherwise if they don't match the UI and the tracking events don't go to the same bucket
2025-07-03 14:38:33 +10:00
James Loh
cae06d8e1d Fix shellcheck issues 2025-06-30 21:16:16 +10:00
James Loh
2818e27fdc Rewrite migrate script to be more informative
no ref

- This adds disk space checks, MySQL connection checks and outputs more informative messages
- We go over what all the changes involve and add an escape hatch in the event that people want to back out or run into issues
2025-06-30 21:09:55 +10:00
James Loh
bf7bbd3199 Fix importing existing configuration into Docker setup
no ref

- I mistakenly didn't realise we don't import our `.env` file and instead populate the settings individually into each container
- This fixes that by just importing it all into the Ghost container which eases importing settings from existing installations
- This will result in a bit of duplication and split env vars but the rest are generally required across multiple containers so it makes sense
2025-06-30 15:51:10 +10:00
James Loh
aa83faa766 Move NODE_ENV variable to compose.yml file
- This should hopefully show that the setting shouldn't just be changed and instead be left as-is
2025-06-27 18:28:58 +10:00
James Loh
4251163b73 Add script to migrate existing Ghost config
- Ghost requires env variables to be in a special `__` format which is hard to construct manually
- This script automates that for ease of migration
- Currently doesn't meet our ESLint rules in the slightest so will need tweaking
2025-06-27 18:04:50 +10:00
James Loh
7a7f41b82c Set NODE_ENV to production
no ref

- This used to be handled by the `systemd` service and I forgot to port
2025-06-27 16:32:49 +10:00
James Loh
d13c2c1c8f Migration script: Make stopping Nginx optional
- People might have other systems running on server they want to migrate over first
2025-06-27 15:47:22 +10:00
James Loh
e065e8667c Add migration script for Ghost CLI -> Docker installs
- This script handles the copy of both assets and the MySQL database
  from an existing install to a new Docker based install
- Its currently been tested on the "happy path" of a Ghost CLI install
  and works
2025-06-27 14:40:27 +10:00
James Loh
946dff3b76 Simplify TB token experience
- Unfortunately the TB CLI doesn't just output the token and instead
  tries to copy it to the clipboard
- Since we're running inside a container we can't do that, so need to
  just update the docs to get it from the UI
2025-06-26 16:33:12 +10:00
James Loh
29e86facec Improve Tinybird login experience
- This helps clean up the TB setup since we no longer need to install the CLI tools locally
- The service dependency chaining is a bit annoying here but it should all work
- We have to change some of the mounts around because of how TB works
  and where it expects tokens to be
2025-06-25 16:54:15 +10:00
James Loh
57c084aac0 Ignore new data dir in git
ref https://linear.app/ghost/issue/ENG-2413

- This is where we now store Ghost and MySQL data by default (see commit 81893178fd) so need to ensure it doesn't try and get checked into git
2025-06-25 15:44:39 +10:00
James Loh
a924fa976a Pinned Ghost + Tinybird Sync container to same image
Closes https://linear.app/ghost/issue/ENG-2414

- These two containers must run the same version of Ghost since the TB container uses assets from the Ghost container
- If the two are out of sync we'd be updating or migrating Tinybird to a different set of APIs than what Ghost is expecting which could break things
2025-06-23 14:23:45 +10:00
James Loh
81893178fd Migrated data dirs to mount instead of docker volume
Closes https://linear.app/ghost/issue/ENG-2413

- This makes migration from standard `ghost-cli` installs to Docker a bit easier and also tries to prevent people from accidentally pruning their Docker volumes are removing data
2025-06-23 14:03:18 +10:00
James Loh
0d2fad0878 Ghost/AP: Added dependency pinning
ref https://linear.app/ghost/issue/ENG-2411

- This doesn't completely solve the 'Ghost mustn't start will AP does' problem _but_ does save it on cold boots or when the whole stack isn't running
- If Ghost is already running it unfortunately wont restart but we can work around that with docs
2025-06-20 15:53:45 +10:00
Fabien O'Carroll
ac7fdad0f1 Replaced dependency on GCS with local storage
ref https://linear.app/ghost/issue/PROD-2009

ActivityPub now supports configuring a local storage adapter, we defer
to the ghost service for actually serving the images, so we write to a
shared volume and point our URLs at the Ghost content directory.
2025-06-19 08:28:44 +07:00
Joe Grigg
83189dc550 Fixed typo in traffic-analytics caddy config 2025-06-04 14:32:04 +01:00
Joe Grigg
fda8a96f72 Updated caddy path handling for activitypub 2025-06-03 11:36:31 +01:00
Joe Grigg
7ac2f94615 Added ALLOW_PRIVATE_ADDRESS environment variable for activitypub 2025-06-03 11:05:54 +01:00
Joe Grigg
46cf0bdf51 Added required GOOGLE_CLOUD_PROJECT environment variable 2025-06-03 11:05:02 +01:00
Joe Grigg
b1dabdf71b Corrected caddy reverse proxy host for activitypub 2025-06-03 10:55:52 +01:00
Joe Grigg
c6bbdc2887 Added GCS auth setup for activitypub 2025-06-03 10:50:34 +01:00
Joe Grigg
2a65c4ec66 Started routing activitypub requests to activitypub container 2025-06-03 10:25:07 +01:00