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

+29 -5
View File
@@ -168,9 +168,10 @@ services:
- "8654:8654"
volumes:
- ./data:/app/data
- /var/lib/bzod/data:/app/data
environment:
- NX9_BZOD_DATA_DIR=/app/data
- RUST_LOG=info
```
@@ -182,6 +183,28 @@ docker compose up -d
---
# Data Directory & Configuration Precedence
BZOD requires an explicit physical data root. There is **no implicit `./data` fallback**.
Precedence:
1. **CLI `--data-dir`** (Highest)
2. **`NX9_BZOD_DATA_DIR`** environment variable
3. **`config.toml` / `bzod.toml` `data_dir`** setting
4. **Configuration Error** if no data directory is configured.
Examples:
```bash
# Via environment variable
NX9_BZOD_DATA_DIR=/var/lib/bzod/data bzod serve
# Via CLI argument
bzod migrate --data-dir=/var/lib/bzod/data --dry-run
```
---
# Native Installation
Download the latest release.
@@ -202,16 +225,16 @@ bzod --help
# Initialize
Create the administrator.
Create the administrator (specifying `--data-dir` or `NX9_BZOD_DATA_DIR`):
```bash
bzod create-admin
NX9_BZOD_DATA_DIR=/var/lib/bzod/data bzod create-admin
```
Start the server.
Start the server:
```bash
bzod serve
NX9_BZOD_DATA_DIR=/var/lib/bzod/data bzod serve
```
Default server:
@@ -234,6 +257,7 @@ After=network.target
[Service]
Environment=NX9_BZOD_DATA_DIR=/var/lib/bzod/data
ExecStart=/usr/local/bin/bzod serve
Restart=always