FossilRepo
| 4ce269c… | ragelink | 1 | # fossilrepo Caddy configuration |
| 4ce269c… | ragelink | 2 | # |
| 4ce269c… | ragelink | 3 | # Routes *.{domain} subdomains to the fossil server. |
| 4ce269c… | ragelink | 4 | # Each repo gets its own subdomain: reponame.fossilrepos.io |
| 4ce269c… | ragelink | 5 | # |
| 4ce269c… | ragelink | 6 | # In production, replace {$FOSSILREPO_CADDY_DOMAIN} with your domain |
| 4ce269c… | ragelink | 7 | # or set the environment variable. |
| 4ce269c… | ragelink | 8 | |
| 4ce269c… | ragelink | 9 | # Wildcard subdomain routing to fossil server |
| 4ce269c… | ragelink | 10 | *.{$FOSSILREPO_CADDY_DOMAIN:localhost} { |
| 4ce269c… | ragelink | 11 | # Extract repo name from subdomain |
| 4ce269c… | ragelink | 12 | @repo host *.{$FOSSILREPO_CADDY_DOMAIN:localhost} |
| 4ce269c… | ragelink | 13 | |
| 4ce269c… | ragelink | 14 | # Reverse proxy to fossil server |
| 4ce269c… | ragelink | 15 | # fossil server --repolist serves all repos under /data/repos/ |
| 4ce269c… | ragelink | 16 | # and routes by the first path segment or subdomain |
| 4ce269c… | ragelink | 17 | reverse_proxy @repo localhost:8080 |
| 4ce269c… | ragelink | 18 | } |
| 4ce269c… | ragelink | 19 | |
| 4ce269c… | ragelink | 20 | # Root domain — landing page or redirect |
| 4ce269c… | ragelink | 21 | {$FOSSILREPO_CADDY_DOMAIN:localhost} { |
| 4ce269c… | ragelink | 22 | respond "fossilrepo server running" 200 |
| 4ce269c… | ragelink | 23 | } |