|
1
|
# Setup Guide |
|
2
|
|
|
3
|
## Quick Start (Docker) |
|
4
|
|
|
5
|
```bash |
|
6
|
git clone https://github.com/ConflictHQ/fossilrepo.git |
|
7
|
cd fossilrepo |
|
8
|
docker compose up -d --build |
|
9
|
docker compose exec backend python manage.py migrate |
|
10
|
docker compose exec backend python manage.py seed |
|
11
|
docker compose exec backend python manage.py seed_roles |
|
12
|
``` |
|
13
|
|
|
14
|
Visit http://localhost:8000. Login: `admin` / `admin`. |
|
15
|
|
|
16
|
## Default Users |
|
17
|
|
|
18
|
| Username | Password | Role | |
|
19
|
|----------|----------|------| |
|
20
|
| admin | admin | Superuser | |
|
21
|
| viewer | viewer | View-only | |
|
22
|
| role-admin | role-admin | Admin role | |
|
23
|
| role-manager | role-manager | Manager role | |
|
24
|
| role-developer | role-developer | Developer role | |
|
25
|
| role-viewer | role-viewer | Viewer role | |
|
26
|
|
|
27
|
## Configuration |
|
28
|
|
|
29
|
### Environment Variables |
|
30
|
|
|
31
|
Copy `.env.example` to `.env` and customize. Key variables: |
|
32
|
|
|
33
|
| Variable | Default | Description | |
|
34
|
|----------|---------|-------------| |
|
35
|
| DJANGO_SECRET_KEY | change-me | **Required in production** | |
|
36
|
| DJANGO_DEBUG | false | Enable debug mode | |
|
37
|
| DJANGO_ALLOWED_HOSTS | localhost | Comma-separated hostnames | |
|
38
|
| POSTGRES_DB | fossilrepo | Database name | |
|
39
|
| POSTGRES_USER | dbadmin | Database user | |
|
40
|
| POSTGRES_PASSWORD | Password123 | Database password | |
|
41
|
| REDIS_URL | redis://localhost:6379/1 | Redis connection | |
|
42
|
| EMAIL_HOST | localhost | SMTP server | |
|
43
|
| CORS_ALLOWED_ORIGINS | http://localhost:8000 | CORS origins | |
|
44
|
| SENTRY_DSN | (empty) | Sentry error tracking | |
|
45
|
|
|
46
|
### Runtime Settings (Constance) |
|
47
|
|
|
48
|
Configurable via Django admin at `/admin/constance/config/`: |
|
49
|
|
|
50
|
| Setting | Default | Description | |
|
51
|
|---------|---------|-------------| |
|
52
|
| SITE_NAME | Fossilrepo | Display name | |
|
53
|
| FOSSIL_DATA_DIR | /data/repos | Where .fossil files live | |
|
54
|
| FOSSIL_BINARY_PATH | fossil | Path to fossil binary | |
|
55
|
| FOSSIL_STORE_IN_DB | false | Store snapshots via Django file storage | |
|
56
|
| FOSSIL_S3_TRACKING | false | Track S3 replication | |
|
57
|
| GIT_SYNC_MODE | disabled | Default sync mode | |
|
58
|
| GIT_SYNC_SCHEDULE | */15 * * * * | Default cron for git sync | |
|
59
|
|
|
60
|
### OAuth (GitHub/GitLab) |
|
61
|
|
|
62
|
For Git mirror sync via OAuth: |
|
63
|
1. Create an OAuth App on GitHub/GitLab |
|
64
|
2. Set Client ID and Secret in Constance (Django admin) |
|
65
|
3. Callback URLs are handled automatically |
|
66
|
|
|
67
|
## Adding Repositories |
|
68
|
|
|
69
|
### Create Empty |
|
70
|
|
|
71
|
1. Go to Projects > + New |
|
72
|
2. Fill in name and description |
|
73
|
3. Select "Create empty repository" |
|
74
|
4. Done — empty .fossil file created |
|
75
|
|
|
76
|
### Clone from Fossil URL |
|
77
|
|
|
78
|
1. Go to Projects > + New |
|
79
|
2. Select "Clone from Fossil URL" |
|
80
|
3. Enter the URL (e.g., `https://fossil-scm.org/home`) |
|
81
|
4. FossilRepo clones the repo and links it |
|
82
|
|
|
83
|
### Clone Fossil SCM (Example) |
|
84
|
|
|
85
|
```bash |
|
86
|
# Clone the official Fossil SCM repo |
|
87
|
docker compose exec backend fossil clone https://fossil-scm.org/home /data/repos/fossil-scm.fossil |
|
88
|
``` |
|
89
|
|
|
90
|
Then create a Project in the UI and link it to the file. |
|
91
|
|
|
92
|
## Production Deployment |
|
93
|
|
|
94
|
See `.env.production.example` for production settings. Key steps: |
|
95
|
|
|
96
|
1. Set a strong `DJANGO_SECRET_KEY` |
|
97
|
2. Set `DJANGO_DEBUG=false` |
|
98
|
3. Configure `DJANGO_ALLOWED_HOSTS` to your domain |
|
99
|
4. Use a proper database password |
|
100
|
5. Configure email (SES, SMTP) |
|
101
|
6. Set up HTTPS via Caddy or reverse proxy |
|
102
|
7. Configure S3 for Litestream backups (optional) |
|
103
|
|
|
104
|
## Ports |
|
105
|
|
|
106
|
| Port | Service | |
|
107
|
|------|---------| |
|
108
|
| 8000 | Django (HTTP) | |
|
109
|
| 2222 | SSH (Fossil sync) | |
|
110
|
| 5432 | PostgreSQL | |
|
111
|
| 6379 | Redis | |
|
112
|
| 1025 | Mailpit SMTP (dev) | |
|
113
|
| 8025 | Mailpit UI (dev) | |
|
114
|
|