Add installer env configuration
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -66,6 +66,30 @@ git push
|
||||
|
||||
腳本會要求互動輸入 zip 密碼。這個 zip 密碼不要寫進 repo、chat 或 log;交給安裝者時用另外的安全渠道。
|
||||
|
||||
## 安裝時設定 vault-pass
|
||||
|
||||
安裝流程建議先填 repo 內的 env 檔:
|
||||
|
||||
```bash
|
||||
cd ~/projects/agent-secret-vault
|
||||
cp -n install.env.example install.env
|
||||
editor install.env
|
||||
./scripts/install-vault-pass.sh
|
||||
```
|
||||
|
||||
`install.env` 可設定:
|
||||
|
||||
- `INSTALL_VAULT_PASS_METHOD=url` + `VAULT_PASS_URL=...`
|
||||
- `INSTALL_VAULT_PASS_METHOD=archive` + `VAULT_PASS_ZIP_PASSWORD_FILE=...`
|
||||
- `INSTALL_VAULT_PASS_METHOD=manual` + `VAULT_PASS_CONTENT=...`
|
||||
- `INSTALL_VAULT_PASS_METHOD=create`
|
||||
|
||||
若 env 內含真實 secrets,不要 commit。可改用 `install.local.env`,再執行:
|
||||
|
||||
```bash
|
||||
INSTALL_ENV_FILE=install.local.env ./scripts/install-vault-pass.sh
|
||||
```
|
||||
|
||||
## 給 agent 的全自動安裝方式
|
||||
|
||||
如果目標是「AI agent 直接安裝,不要卡在互動輸入密碼」,請不要讓 agent 選互動 zip 解壓。改用環境變數指定方法:
|
||||
|
||||
Reference in New Issue
Block a user