Commit Graph

24 Commits

Author SHA1 Message Date
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
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
Chris Raible
1585fe040f Moved Tinybird tracker token to the analytics service 2025-07-08 17:34:46 -07: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
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
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
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
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
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
Joe Grigg
6fae0bdc68 Added activitypub container into activitypub compose profile 2025-06-03 10:02:56 +01:00
Joe Grigg
fb9d5ffd05 Enabled traffic analytics & activity pub via config 2025-06-03 09:54:16 +01:00
Joe Grigg
dc63fab879 Added activitypub configuration 2025-06-02 14:12:19 +01:00
Chris Raible
e6d4754682 Added Tinybird migrations (#2)
no refs

The current setup runs the base Ghost installation without Traffic Analytics functionality. This commit adds:

- `tinybird-sync` service, which copies the latest Tinybird datafiles from the `ghost` container into a shared volume
- `tinybird-deploy` service & Dockerfile that includes the `tb` CLI, and runs `tb --cloud deploy` on boot
- Instructions for one-time manual setup of the Tinybird workspace in `TINYBIRD.md`

After the one-time manual setup, this configuration should automatically update Tinybird's datasources and endpoints in sync with the Ghost container when it is updated.


The initial setup is a bit clumsy and requires more manual steps than expected:
- The tinybird datafiles are in the Ghost image, but we need to access them from the `tinybird-deploy` service, which includes the `tb` CLI.
- When creating a new workspace in Tinybird, you can't access your admin token right away. Instead, it forces you to run `tb login` and `tb --cloud deploy` before you can access the rest of your workspace UI. This requires the user to install the `tb` CLI locally, and run an interactive login to authenticate with their Tinybird workspace. The generated `.tinyb` file is then mounted into the `tinybird-deploy` container, so this is only required for initial setup.
- Ghost requires the Tinybird `stats` and `tracker` token to be provided at boot. This means the user has to manually copy these tokens (either from CLI or the Workspace UI) and add them to their `.env` file manually. 
- We may want to either publish the Docker image with the Tinybird CLI installed, or possibly add the `tb` CLI to the traffic-analytics container.
2025-06-01 14:13:40 -07:00
Joe Grigg
de4605e48d Added tinybird config 2025-05-29 14:01:17 +01:00
Joe Grigg
72be447b06 Added inital configuration for Ghost, Caddy, MySQL & Traffic Analytics 2025-05-27 16:36:01 +01:00