update readme with proposed config changes

This commit is contained in:
Keiran 2025-08-07 18:34:16 +01:00
parent 9c78413bb9
commit 1aadd25640

View File

@ -5,19 +5,34 @@ A simple file storage service with user buckets and usage limits.
## Setup
1. Set up PostgreSQL database and run the schema:
```bash
psql -d termcloud -f internal/db/schema.sql
```
2. Set environment variables:
2. Configure environment variables (copy `.env.example` to `.env` and customize):
```bash
# .env.example
DATABASE_URL="postgres://user:password@localhost/termcloud"
PORT="8080"
cp .env.example .env
# Edit .env with your settings
```
### Configuration Options
| Variable | Default | Description |
|----------|---------|-------------|
| `DATABASE_URL` | - | PostgreSQL connection string |
| `PORT` | 8080 | Server port |
| `STORAGE_DIR` | storage | Directory for file storage |
| `MAX_FILE_SIZE_MB` | 100 | Maximum file size in MB |
| `RATE_LIMIT` | 20.0 | Requests per second limit |
| `CORS_ORIGINS` | * | Allowed CORS origins |
| `GZIP_LEVEL` | 5 | Gzip compression level (1-9) |
| `DB_MAX_CONNECTIONS` | 100 | Maximum database connections |
| `DB_MIN_CONNECTIONS` | 10 | Minimum database connections |
| `DB_CONN_LIFETIME` | 1h | Connection lifetime |
| `DB_CONN_IDLE_TIME` | 1m | Connection idle timeout |
| `DB_HEALTH_CHECK_PERIOD` | 5s | Health check interval |
| `DEFAULT_STORAGE_LIMIT_GB` | 1 | Default user storage limit |
3. Build and run:
```bash