|
2eca4eb…
|
ragelink
|
1 |
# Configuration |
|
2eca4eb…
|
ragelink
|
2 |
|
|
2eca4eb…
|
ragelink
|
3 |
## Environment Variables |
|
2eca4eb…
|
ragelink
|
4 |
|
|
2eca4eb…
|
ragelink
|
5 |
All configuration is done through environment variables, loaded from `.env` in development. |
|
2eca4eb…
|
ragelink
|
6 |
|
|
2eca4eb…
|
ragelink
|
7 |
### Django Settings |
|
2eca4eb…
|
ragelink
|
8 |
|
|
2eca4eb…
|
ragelink
|
9 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
10 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
11 |
| `SECRET_KEY` | -- | Django secret key (required) | |
|
2eca4eb…
|
ragelink
|
12 |
| `DEBUG` | `False` | Enable debug mode | |
|
2eca4eb…
|
ragelink
|
13 |
| `ALLOWED_HOSTS` | `localhost` | Comma-separated list of allowed hosts | |
|
2eca4eb…
|
ragelink
|
14 |
| `TIME_ZONE` | `UTC` | Server timezone | |
|
2eca4eb…
|
ragelink
|
15 |
|
|
2eca4eb…
|
ragelink
|
16 |
### Database |
|
2eca4eb…
|
ragelink
|
17 |
|
|
2eca4eb…
|
ragelink
|
18 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
19 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
20 |
| `POSTGRES_DB` | `fossilrepo` | Database name | |
|
2eca4eb…
|
ragelink
|
21 |
| `POSTGRES_USER` | `fossilrepo` | Database user | |
|
2eca4eb…
|
ragelink
|
22 |
| `POSTGRES_PASSWORD` | -- | Database password (required) | |
|
2eca4eb…
|
ragelink
|
23 |
| `POSTGRES_HOST` | `postgres` | Database host | |
|
2eca4eb…
|
ragelink
|
24 |
| `POSTGRES_PORT` | `5432` | Database port | |
|
2eca4eb…
|
ragelink
|
25 |
|
|
2eca4eb…
|
ragelink
|
26 |
### Redis & Celery |
|
2eca4eb…
|
ragelink
|
27 |
|
|
2eca4eb…
|
ragelink
|
28 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
29 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
30 |
| `REDIS_URL` | `redis://redis:6379/0` | Redis connection URL | |
|
2eca4eb…
|
ragelink
|
31 |
| `CELERY_BROKER_URL` | `$REDIS_URL` | Celery broker (defaults to Redis URL) | |
|
2eca4eb…
|
ragelink
|
32 |
|
|
2eca4eb…
|
ragelink
|
33 |
### Fossil |
|
2eca4eb…
|
ragelink
|
34 |
|
|
2eca4eb…
|
ragelink
|
35 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
36 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
37 |
| `FOSSIL_REPO_DIR` | `/data/repos` | Directory where `.fossil` files are stored | |
|
2eca4eb…
|
ragelink
|
38 |
| `FOSSIL_BASE_URL` | -- | Base URL for Fossil web UI (e.g., `https://code.example.com`) | |
|
2eca4eb…
|
ragelink
|
39 |
| `FOSSIL_BINARY` | `fossil` | Path to the Fossil binary | |
|
2eca4eb…
|
ragelink
|
40 |
|
|
2eca4eb…
|
ragelink
|
41 |
### Caddy (Production) |
|
2eca4eb…
|
ragelink
|
42 |
|
|
2eca4eb…
|
ragelink
|
43 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
44 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
45 |
| `CADDY_DOMAIN` | -- | Your domain (e.g., `example.com`) | |
|
2eca4eb…
|
ragelink
|
46 |
| `CADDY_EMAIL` | -- | Email for Let's Encrypt certificates | |
|
2eca4eb…
|
ragelink
|
47 |
|
|
2eca4eb…
|
ragelink
|
48 |
### Litestream (Backups) |
|
2eca4eb…
|
ragelink
|
49 |
|
|
2eca4eb…
|
ragelink
|
50 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
51 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
52 |
| `LITESTREAM_ACCESS_KEY_ID` | -- | S3 access key | |
|
2eca4eb…
|
ragelink
|
53 |
| `LITESTREAM_SECRET_ACCESS_KEY` | -- | S3 secret key | |
|
2eca4eb…
|
ragelink
|
54 |
| `LITESTREAM_BUCKET` | -- | S3 bucket name | |
|
2eca4eb…
|
ragelink
|
55 |
| `LITESTREAM_ENDPOINT` | -- | S3 endpoint (for MinIO/B2) | |
|
2eca4eb…
|
ragelink
|
56 |
| `LITESTREAM_REGION` | `us-east-1` | S3 region | |
|
2eca4eb…
|
ragelink
|
57 |
|
|
2eca4eb…
|
ragelink
|
58 |
### Sync Bridge |
|
2eca4eb…
|
ragelink
|
59 |
|
|
2eca4eb…
|
ragelink
|
60 |
| Variable | Default | Description | |
|
2eca4eb…
|
ragelink
|
61 |
|---|---|---| |
|
2eca4eb…
|
ragelink
|
62 |
| `GITHUB_TOKEN` | -- | GitHub personal access token (for mirroring) | |
|
2eca4eb…
|
ragelink
|
63 |
| `GITLAB_TOKEN` | -- | GitLab personal access token (for mirroring) | |
|
2eca4eb…
|
ragelink
|
64 |
|
|
2eca4eb…
|
ragelink
|
65 |
## Caddy Configuration |
|
2eca4eb…
|
ragelink
|
66 |
|
|
2eca4eb…
|
ragelink
|
67 |
The Caddyfile controls SSL termination and subdomain routing. Each Fossil repo gets its own subdomain: |
|
2eca4eb…
|
ragelink
|
68 |
|
|
2eca4eb…
|
ragelink
|
69 |
``` |
|
2eca4eb…
|
ragelink
|
70 |
{$CADDY_DOMAIN} { |
|
2eca4eb…
|
ragelink
|
71 |
reverse_proxy django:8000 |
|
2eca4eb…
|
ragelink
|
72 |
} |
|
2eca4eb…
|
ragelink
|
73 |
|
|
2eca4eb…
|
ragelink
|
74 |
*.{$CADDY_DOMAIN} { |
|
2eca4eb…
|
ragelink
|
75 |
reverse_proxy fossil:8080 |
|
2eca4eb…
|
ragelink
|
76 |
} |
|
2eca4eb…
|
ragelink
|
77 |
``` |
|
2eca4eb…
|
ragelink
|
78 |
|
|
2eca4eb…
|
ragelink
|
79 |
Caddy automatically provisions Let's Encrypt certificates for all subdomains. |
|
2eca4eb…
|
ragelink
|
80 |
|
|
2eca4eb…
|
ragelink
|
81 |
## Litestream Configuration |
|
2eca4eb…
|
ragelink
|
82 |
|
|
2eca4eb…
|
ragelink
|
83 |
Litestream continuously replicates every `.fossil` SQLite file to S3: |
|
2eca4eb…
|
ragelink
|
84 |
|
|
2eca4eb…
|
ragelink
|
85 |
```yaml |
|
2eca4eb…
|
ragelink
|
86 |
dbs: |
|
2eca4eb…
|
ragelink
|
87 |
- path: /data/repos/*.fossil |
|
2eca4eb…
|
ragelink
|
88 |
replicas: |
|
2eca4eb…
|
ragelink
|
89 |
- type: s3 |
|
2eca4eb…
|
ragelink
|
90 |
bucket: ${LITESTREAM_BUCKET} |
|
2eca4eb…
|
ragelink
|
91 |
endpoint: ${LITESTREAM_ENDPOINT} |
|
2eca4eb…
|
ragelink
|
92 |
region: ${LITESTREAM_REGION} |
|
2eca4eb…
|
ragelink
|
93 |
``` |
|
2eca4eb…
|
ragelink
|
94 |
|
|
2eca4eb…
|
ragelink
|
95 |
!!! tip "Point-in-time recovery" |
|
2eca4eb…
|
ragelink
|
96 |
Litestream replicates WAL frames continuously. You can restore any `.fossil` file to any point in time, not just the latest snapshot. |