Add installer env configuration

This commit is contained in:
2026-05-14 17:29:29 +08:00
parent 1cd0bfb9f2
commit 525161dd0c
7 changed files with 139 additions and 2 deletions

View File

@@ -56,6 +56,43 @@ PLACEHOLDER
然後回報人類:需要把此 agent / 機器的 SSH public key 加到 Gitea 或 deploy key。
## 2.5 設定 installer env
Repo 內提供兩個 env 檔:
```text
install.env.example # 範本
install.env # 安裝用 placeholder
```
安裝前先設定 `install.env`
```bash
cd ~/projects/agent-secret-vault
cp -n install.env.example install.env
editor install.env
```
常用設定:
```bash
# 一次性 URL 下載 vault-pass.txt
INSTALL_VAULT_PASS_METHOD="url"
VAULT_PASS_URL="https://example.com/one-time/vault-pass.txt"
# 或zip 密碼放在本機安全檔案
INSTALL_VAULT_PASS_METHOD="archive"
VAULT_PASS_ZIP_PASSWORD_FILE="/secure/path/zip-password.txt"
```
若需要使用另一個 env 檔:
```bash
INSTALL_ENV_FILE=install.local.env ./scripts/install-vault-pass.sh
```
不要把含真實密碼/token 的 env 檔 commit。
## 3. 安裝 vault password file
標準位置:
@@ -123,7 +160,7 @@ export VAULT_PASS_FILE=/path/to/vault-pass.txt
### Agent 全自動安裝(避免卡在互動密碼)
若安裝由 AI agent / CI 執行,不要走互動 prompt。用以下任一非互動方式
若安裝由 AI agent / CI 執行,不要走互動 prompt。優先把設定寫進 `install.env``install.local.env`,也可用以下任一非互動方式:
```bash
# 方式 A從安全 URL 下載 vault-pass.txt