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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user