refactor(config): require explicit BZOD data directory
This commit is contained in:
1 parent
d398341f01
commit
c2e138f823
55 files changed
+522
-170
No files matched your search
+24
@@ -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.
|
||||
@@ -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:
|
||||
|
||||
|
||||
Reference in new issue
Block a user