Полный продакшн-фикс: hardened build/install, drift/firewall/wg проверки и актуализация документации
This commit is contained in:
+14
-7
@@ -31,29 +31,36 @@ nft
|
||||
Сборку лучше выполнять на отдельной build-машине с тем же целевым ABI.
|
||||
|
||||
```bash
|
||||
cargo build --release
|
||||
./tools/build.sh
|
||||
```
|
||||
|
||||
Альтернатива (ручной запуск cargo из корня репозитория):
|
||||
|
||||
```bash
|
||||
cargo build --locked --manifest-path traffic_core/Cargo.toml --release
|
||||
```
|
||||
|
||||
Проверки перед переносом:
|
||||
|
||||
```bash
|
||||
cargo fmt --check
|
||||
cargo clippy --all-targets --all-features -- -D warnings
|
||||
cargo test --release
|
||||
file target/release/awg2-harness
|
||||
ldd target/release/awg2-harness
|
||||
cargo fmt --manifest-path traffic_core/Cargo.toml --all --check
|
||||
cargo clippy --locked --manifest-path traffic_core/Cargo.toml --all-targets -- -D warnings
|
||||
cargo test --locked --manifest-path traffic_core/Cargo.toml --release
|
||||
file traffic_core/target/release/awg2-harness
|
||||
ldd traffic_core/target/release/awg2-harness
|
||||
```
|
||||
|
||||
## 3. Установка файлов
|
||||
|
||||
```bash
|
||||
install -m 0755 target/release/awg2-harness /usr/local/bin/awg2-harness
|
||||
install -m 0755 traffic_core/target/release/awg2-harness /usr/local/bin/awg2-harness
|
||||
install -d -m 0755 /etc/awg2-harness
|
||||
install -m 0644 config.toml /etc/awg2-harness/config.toml
|
||||
```
|
||||
|
||||
Важно: production-установка **не должна** автоматически копировать [`config.example.toml`](config.example.toml) как боевой конфиг.
|
||||
Если используется [`tools/build.sh`](tools/build.sh), режим `--install` завершится ошибкой при отсутствии `/etc/awg2-harness/config.toml`.
|
||||
Режим `--install` копирует только бинарь и unit, выполняет `systemctl daemon-reload`, но не делает `systemctl enable --now`.
|
||||
Сначала подготовьте осознанный production-конфиг вручную.
|
||||
|
||||
Проверка конфига:
|
||||
|
||||
Reference in New Issue
Block a user