Skip to content

Commit f384c7b

Browse files
committed
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
1 parent 22af0fb commit f384c7b

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

.env.example

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1+
# Use the below flags to enable the Analytics or ActivityPub containers as well
2+
# Note: You must set ENABLE_DEVELOPER_EXPERIMENTS to `true` when enabling either profile below
13
# COMPOSE_PROFILES=analytics,activitypub
24

35
# Which Ghost version to run
46
GHOST_VERSION=5-alpine
57

8+
# Public domain Ghost is going to run on
69
DOMAIN=example.com
710

8-
# Location to store uploaded data
9-
UPLOAD_LOCATION=./data/ghost
10-
11-
# Location for database data
12-
MYSQL_DATA_LOCATION=./data/mysql
13-
11+
# Database settings
1412
DATABASE_ROOT_PASSWORD=reallysecurerootpassword
1513
DATABASE_USER=optionalusername
1614
DATABASE_PASSWORD=ghostpassword
1715

18-
# Tinybird configuration for analytics
16+
# Developer Experiences must be enabled for
17+
# both Traffic Analytics and ActivityPub
18+
ENABLE_DEVELOPER_EXPERIMENTS=false
19+
20+
# Developer Experiments must be enabled above
21+
ENABLE_ACTIVITYPUB=false
22+
23+
# Tinybird configuration
1924
TINYBIRD_API_URL=https://api.tinybird.co
2025
TINYBIRD_TRACKER_TOKEN=p.eyJxxxxx
2126
TINYBIRD_STATS_TOKEN=p.eyJxxxxx
27+
28+
# Data locations
29+
# Location to store uploaded data
30+
UPLOAD_LOCATION=./data/ghost
31+
32+
# Location for database data
33+
MYSQL_DATA_LOCATION=./data/mysql

TINYBIRD.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ Steps:
1111
1. Using the UI link from the previous step, open your workspace and click on *Tokens* in the left hand menu
1212
1. Copy your Tinybird `stats_page` token and add it to your `.env` file as `TINYBIRD_STATS_TOKEN`
1313
1. Copy your Tinybird `tracker` token and add it to your `.env` file as `TINYBIRD_TRACKER_TOKEN`
14-
1. Run `docker compose --profile=analytics up -d` to start all services in the background. You can also set `COMPOSE_PROFILES=analytics` in your `.env` file to automatically include the `analytics` profile when running `docker compose` commands.
14+
1. Run `docker compose --profile=analytics up -d` to start all services in the background
15+
1. Set `COMPOSE_PROFILES=analytics` in your `.env` file to automatically include the `analytics` profile when running `docker compose` commands
1516
1. At this point, everything should be working. You can test it's working by visiting your site's homepage, then checking the Stats page in Ghost Admin — you should see a view recorded.

compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ services:
3333
database__connection__user: ${DATABASE_USER:-ghost}
3434
database__connection__password: ${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required}
3535
database__connection__database: ghost
36-
enableDeveloperExperiments: true
37-
labs__trafficAnalytics: true
38-
labs__ActivityPub: true
36+
enableDeveloperExperiments: ${ENABLE_DEVELOPER_EXPERIMENTS:-false}
37+
labs__ActivityPub: ${ENABLE_ACTIVITYPUB:-false}
3938
tinybird__tracker__endpoint: https://${DOMAIN:?DOMAIN environment variable is required}/.ghost/analytics/tb/web_analytics
4039
tinybird__tracker__datasource: analytics_events
4140
tinybird__tracker__token: ${TINYBIRD_TRACKER_TOKEN:-}

0 commit comments

Comments
 (0)