refactor(config): require explicit BZOD data directory
Rust CI / Test & Quality Checks (push) Canceled after 0s
Rust CI / Build Docker Image (push) Canceled after 0s

This commit is contained in:
thakares committed 2026-08-27 15:06:05 +05:30
1 parent d398341f01
commit c2e138f823
55 files changed
+522 -170

No files matched your search

+24
View File
@@ -284,3 +284,27 @@ bzod doctor
* SECURITY.md
* API.md
* ARCHITECTURE.md
---
# Data Directory Configuration
BZOD requires an explicit physical data directory root. There is **no implicit `./data` fallback**.
### Configuration Precedence
1. **CLI `--data-dir`** (Highest priority)
```bash
bzod serve --data-dir /var/lib/bzod/data
bzod migrate --data-dir=/var/lib/bzod/data --dry-run
```
2. **Environment Variable `NX9_BZOD_DATA_DIR`**
```bash
export NX9_BZOD_DATA_DIR=/var/lib/bzod/data
bzod serve
```
3. **Configuration File (`bzod.toml` / `config.toml`)**
```toml
data_dir = "/var/lib/bzod/data"
```
4. **Error**: If no data directory is provided via CLI, `NX9_BZOD_DATA_DIR`, or config file, BZOD terminates with an actionable error.
+8 -8
View File
@@ -100,7 +100,7 @@ services:
environment:
HOST: 0.0.0.0
PORT: 8654
DATA_DIR: /app/data
NX9_BZOD_DATA_DIR: /app/data
COOKIE_SECURE: "false"
healthcheck:
@@ -204,13 +204,13 @@ BZOD Docker Container
# Environment Variables
| Variable | Description | Default |
| ------------- | ------------------ | --------- |
| HOST | Bind address | 0.0.0.0 |
| PORT | Listen port | 8654 |
| DATA_DIR | Database directory | /app/data |
| COOKIE_SECURE | Secure cookies | false |
| RUST_LOG | Logging level | info |
| Variable | Description | Default |
| ----------------- | ------------------ | ------------- |
| HOST | Bind address | 0.0.0.0 |
| PORT | Listen port | 8654 |
| NX9_BZOD_DATA_DIR | Database directory | (required) |
| COOKIE_SECURE | Secure cookies | false |
| RUST_LOG | Logging level | info |
Production recommendation: