FossilRepo

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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button