updates
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-14 09:28:30 +11:00
parent ffe0c01fd7
commit 7400e08c54
35 changed files with 731 additions and 357 deletions

View File

@@ -28,27 +28,37 @@ Run `templ generate -path ./components` to generate code based on template files
## Documentation
Run `swag init --exclude "pkg.mod,pkg.build,pkg.tools" -o server/router/docs`
#### Settings File
Configuration now lives in the YAML settings file. By default the service reads
`/etc/dtms/vctp.yml`, or you can override it with the `-settings` flag.
```shell
vctp -settings /path/to/vctp.yml
```
#### Database Configuration
By default the app uses SQLite and creates/opens `db.sqlite3`. You can opt into PostgreSQL
by setting environment variables:
by updating the settings file:
- `DB_DRIVER`: `sqlite` (default) or `postgres`
- `DB_URL`: SQLite file path/DSN or PostgreSQL DSN
- `settings.database_driver`: `sqlite` (default) or `postgres`
- `settings.database_url`: SQLite file path/DSN or PostgreSQL DSN
Examples:
```shell
# SQLite (default)
DB_DRIVER=sqlite DB_URL=./db.sqlite3
```yaml
settings:
database_driver: sqlite
database_url: ./db.sqlite3
# PostgreSQL
DB_DRIVER=postgres DB_URL=postgres://user:pass@localhost:5432/vctp?sslmode=disable
settings:
database_driver: postgres
database_url: postgres://user:pass@localhost:5432/vctp?sslmode=disable
```
PostgreSQL migrations live in `db/migrations_postgres`, while SQLite migrations remain in
`db/migrations`.
#### Snapshot Retention
Hourly and daily snapshot table retention can be configured with environment variables:
Hourly and daily snapshot table retention can be configured in the settings file:
- `HOURLY_SNAPSHOT_MAX_AGE_DAYS` (default: 60)
- `DAILY_SNAPSHOT_MAX_AGE_MONTHS` (default: 12)
- `settings.hourly_snapshot_max_age_days` (default: 60)
- `settings.daily_snapshot_max_age_months` (default: 12)