Skip to content

Commit 1eb32d2

Browse files
committed
Add glitchtip app (Sentry-compatible error tracking)
GlitchTip replaces the broken self-hosted Sentry setup: it runs with only PostgreSQL (shared) and Redis, with no ClickHouse/Kafka/Snuba dependency. Includes web, worker+beat, and a one-shot migrate service. Made-with: Cursor
1 parent 9828a54 commit 1eb32d2

4 files changed

Lines changed: 204 additions & 0 deletions

File tree

apps/glitchtip/.env.example

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Public URL where GlitchTip is served — used in outbound links and emails
2+
GLITCHTIP_DOMAIN=https://glitchtip.example.com
3+
4+
# Django secret key — generate with:
5+
# python3 -c "import secrets; print(secrets.token_hex(50))"
6+
SECRET_KEY=
7+
8+
# PostgreSQL connection (uses the shared postgresql service)
9+
DATABASE_URL=postgresql://glitchtip_user:password@postgresql:5432/glitchtip_db
10+
11+
# Redis connection (uses the internal glitchtip-redis service)
12+
REDIS_URL=redis://glitchtip-redis:6379/0
13+
14+
# Email
15+
DEFAULT_FROM_EMAIL=glitchtip@example.com
16+
EMAIL_URL=smtp://postfix:25
17+
18+
# Port the web service listens on (default 8000)
19+
PORT=8000
20+
21+
# Celery worker scaling: min,max concurrent workers
22+
CELERY_WORKER_AUTOSCALE=1,3
23+
CELERY_WORKER_MAX_TASKS_PER_CHILD=10000
24+
25+
# Set to True to allow new user registrations; disable once initial accounts exist
26+
ENABLE_USER_REGISTRATION=False
27+
28+
# Image versions
29+
#IMAGE_VERSION=latest
30+
#REDIS_IMAGE_VERSION=7-alpine

apps/glitchtip/.rsync-exclude

Whitespace-only changes.

apps/glitchtip/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# glitchtip
2+
3+
[GlitchTip](https://glitchtip.com) is a Sentry-compatible self-hosted error
4+
tracking and uptime monitoring platform. Unlike Sentry, it runs with only
5+
PostgreSQL and Redis — no ClickHouse, Kafka, or Snuba required.
6+
7+
## Services
8+
9+
| Service | Image | Role |
10+
|---|---|---|
11+
| `glitchtip` | `glitchtip/glitchtip` | Django web app + API |
12+
| `glitchtip-worker` | `glitchtip/glitchtip` | Celery worker + beat scheduler |
13+
| `glitchtip-redis` | `redis` | Celery broker and cache |
14+
| `glitchtip-migrate` | `glitchtip/glitchtip` | One-shot database migration runner |
15+
16+
## Networks
17+
18+
| Network alias | Actual network | Purpose |
19+
|---|---|---|
20+
| `db` | `postgres-net` | Shared PostgreSQL |
21+
| `proxy` | `nginx-proxy-net` | Reverse proxy (nginx-proxy-manager) |
22+
| `mail` | `postfix-net` | Outbound email via shared postfix |
23+
| `redis` | `glitchtip-redis-net` | Internal Redis (glitchtip-redis only) |
24+
25+
## First-time setup
26+
27+
### 1. Create the database
28+
29+
Connect to the shared PostgreSQL instance:
30+
31+
```sql
32+
CREATE USER glitchtip_user WITH PASSWORD 'your-password';
33+
CREATE DATABASE glitchtip_db OWNER glitchtip_user;
34+
```
35+
36+
### 2. Configure environment
37+
38+
```sh
39+
cp .env.example .env
40+
```
41+
42+
Edit `.env` and fill in at minimum:
43+
44+
- `SECRET_KEY` — generate with:
45+
```sh
46+
python3 -c "import secrets; print(secrets.token_hex(50))"
47+
```
48+
- `DATABASE_URL` — update the password to match what you set above
49+
- `GLITCHTIP_DOMAIN` — the public URL (e.g. `https://glitchtip.example.com`)
50+
- `DEFAULT_FROM_EMAIL` — sender address for alerts and invites
51+
52+
### 3. Run migrations
53+
54+
```sh
55+
docker compose run --rm glitchtip-migrate
56+
```
57+
58+
### 4. Start
59+
60+
```sh
61+
docker compose up -d
62+
```
63+
64+
The `glitchtip-migrate` container will also run automatically on every
65+
`docker compose up`; Django migrations are idempotent so this is safe.
66+
67+
### 5. Create the first superuser
68+
69+
```sh
70+
docker compose exec glitchtip ./manage.py createsuperuser
71+
```
72+
73+
Then log in at your `GLITCHTIP_DOMAIN` and create an organization and project.
74+
75+
## SDK configuration
76+
77+
Point your Sentry SDK at GlitchTip by replacing the DSN host. GlitchTip
78+
issues DSNs in the same format as Sentry — copy the DSN from the project
79+
settings page.
80+
81+
## Reverse proxy
82+
83+
Configure nginx-proxy-manager to proxy `glitchtip.example.com``glitchtip:8000`.
84+
85+
## Stopping safely
86+
87+
```sh
88+
docker compose down
89+
```

apps/glitchtip/docker-compose.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
services:
2+
glitchtip-redis:
3+
image: redis:${REDIS_IMAGE_VERSION:-7-alpine}
4+
container_name: glitchtip-redis
5+
hostname: glitchtip-redis
6+
restart: unless-stopped
7+
volumes:
8+
- ../../lib/glitchtip/redis:/data
9+
networks:
10+
- redis
11+
healthcheck:
12+
test: ["CMD", "redis-cli", "ping"]
13+
interval: 10s
14+
timeout: 5s
15+
retries: 5
16+
17+
glitchtip:
18+
image: glitchtip/glitchtip:${IMAGE_VERSION:-latest}
19+
container_name: glitchtip
20+
hostname: glitchtip
21+
restart: unless-stopped
22+
volumes:
23+
- ../../lib/glitchtip/uploads:/code/uploads
24+
env_file:
25+
- .env
26+
networks:
27+
- db
28+
- proxy
29+
- redis
30+
- mail
31+
depends_on:
32+
glitchtip-redis:
33+
condition: service_healthy
34+
healthcheck:
35+
test: ["CMD-SHELL", "curl -fSs http://localhost:8000/ || exit 1"]
36+
interval: 30s
37+
timeout: 10s
38+
retries: 3
39+
start_period: 40s
40+
41+
glitchtip-worker:
42+
image: glitchtip/glitchtip:${IMAGE_VERSION:-latest}
43+
container_name: glitchtip-worker
44+
hostname: glitchtip-worker
45+
restart: unless-stopped
46+
command: ./bin/run-celery-with-beat.sh
47+
volumes:
48+
- ../../lib/glitchtip/uploads:/code/uploads
49+
env_file:
50+
- .env
51+
networks:
52+
- db
53+
- redis
54+
- mail
55+
depends_on:
56+
glitchtip-redis:
57+
condition: service_healthy
58+
59+
glitchtip-migrate:
60+
image: glitchtip/glitchtip:${IMAGE_VERSION:-latest}
61+
container_name: glitchtip-migrate
62+
hostname: glitchtip-migrate
63+
restart: "no"
64+
command: ./manage.py migrate
65+
env_file:
66+
- .env
67+
networks:
68+
- db
69+
- redis
70+
depends_on:
71+
glitchtip-redis:
72+
condition: service_healthy
73+
74+
networks:
75+
proxy:
76+
external: true
77+
name: nginx-proxy-net
78+
db:
79+
external: true
80+
name: postgres-net
81+
mail:
82+
external: true
83+
name: postfix-net
84+
redis:
85+
name: glitchtip-redis-net

0 commit comments

Comments
 (0)