template-monorepo/deploy/zitadel/README.md

53 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ZITADELdev / k6
本機跑 k6 測試用的 ZITADEL stackdocker-compose `profile: k6`)。
## 啟動
```bash
make k6-up
```
會啟動 mongo / redis / mailhog / postgres / zitadel。
ZITADEL 首次啟動會 init Postgres schema 並執行 [steps.yaml](steps.yaml) 預載:
- Instance 名稱:`ZITADEL`
- Org`GatewayDev`
- Admin 使用者:`zitadel-admin@zitadel.localhost` / `Password1!`
- Service Account`zitadel-admin-sa`(產生 PAT 寫到 `machinekey/zitadel-admin-sa.token`
完成需 30~90 秒,可用 `make k6-wait` 等到 `/debug/healthz` 200。
## PAT 取用
```bash
cat deploy/zitadel/machinekey/zitadel-admin-sa.token
```
把這個值塞進 `etc/gateway.k6.yaml``Zitadel.ServiceUserToken`,或用環境變數:
```bash
export ZITADEL_SERVICE_TOKEN=$(cat deploy/zitadel/machinekey/zitadel-admin-sa.token)
```
`make k6-gateway` 會自動做這件事。
## 重設
```bash
make k6-down # 停容器(保留 volume
docker volume rm template-monorepo_postgres_data # 清 ZITADEL 資料
rm deploy/zitadel/machinekey/zitadel-admin-sa.* # 清 PAT
```
## 端點
- Console UIhttp://localhost:8080/ui/console
- OIDC issuerhttp://localhost:8080
- Management APIhttp://localhost:8080/management/v1
- Healthhttp://localhost:8080/debug/healthz
## 不可帶上 prod
`MasterkeyNeedsToHave32Characters` 與 [steps.yaml](steps.yaml) 內的密碼都是固定 dev 值,**只能**本機用。