Commit Graph

182 Commits

Author SHA1 Message Date
fbfa32ca2a fix(ci): poll on-host bootstrap logs across ssh reconnects 2026-06-25 20:48:20 +08:00
cd630c45d5 fix(bootstrap): allow online fallback after offline installer failure 2026-06-25 19:57:46 +08:00
12d9bb327f refactor(ci): 将 render_backend_tf.py 移至 ai-workspace-infra vultr-vps/scripts/
脚本从 xworkspace-console/scripts/ 移入 ai-workspace-infra 的
vultr-vps/scripts/,通过已有的 Checkout iac_modules 步骤引用,
无需额外 self-checkout xw-console;workflow 和 CLAUDE.md 同步更新路径。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 12:02:48 +08:00
9b3687e189 fix(ci): 消除 workflow 所有 heredoc,改为外置脚本调用
- 删除 Configure remote backend 步骤的 shell heredoc(导致 YAML L191 语法错误)
- 新增 scripts/render_backend_tf.py 外置脚本,接受 TF_STATE_ENDPOINT env 渲染 backend.tf
- provision job 新增 Checkout xworkspace-console 步骤,确保 scripts/ 在 runner 可用
- 新增 CLAUDE.md,明确禁止 workflow 内嵌 heredoc(shell/python),要求外置脚本

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:48:47 +08:00
f636366699 fix(ci): 还原 backend.tf 为 shell heredoc,修复 Jinja2 内联 Python 导致的 YAML 语法错误
Python 内联脚本(python3 - <<'PYEOF'...PYEOF)的代码行从列 1 开始,
超出 YAML literal block 的缩进范围,导致整个 workflow 文件 YAML 解析失败,
GitHub 丢失 workflow_dispatch 触发器。

还原为 shell heredoc(<<TFEOF,非引号,允许变量展开),
保留 force_path_style → use_path_style 升级。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:45:44 +08:00
4a6057d58b fix(ci): 改用 Jinja2 渲染 backend.tf + 更新 force_path_style → use_path_style
- 将 Configure remote backend 步骤从 shell heredoc 改为 Python Jinja2 渲染,
  避免 shell 引号/转义问题,与 generate.py 保持一致的渲染风格
- force_path_style 已在 Terraform 1.9 废弃,改为 use_path_style

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:37:25 +08:00
b4c051e6c0 fix(ci): 将 R2 endpoint 写入 backend.tf HCL 而非 -backend-config flag
Terraform S3 backend 的 endpoints 块只能在 HCL 配置里指定,
无法通过 -backend-config 命令行参数传递(endpoints={s3=...} 和
endpoints.s3=... 两种写法均被 Terraform 拒绝)。

改为:Configure remote backend 步骤用非引号 heredoc 将
TF_STATE_ENDPOINT 展开写入 backend.tf,terraform init 只通过
-backend-config 传 bucket/key/region。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:29:35 +08:00
b9ec7a2e45 fix(ci): 修复 R2 TF state backend endpoint 语法 + 补全前置条件文档
- 将 terraform init -backend-config 中的 endpoints={s3="..."} HCL map
  语法改为 endpoints.s3=... 点号语法(前者在 -backend-config flag 中无效,
  导致 R2 endpoint 未被传递,Terraform 回退 AWS 默认 endpoint 签名失败)
- 补全 workflow 顶部 TLDR 前置条件注释(6 项)
- 新增 docs/operations/iac-prerequisites.md(前置条件完整指南含 R2 搭建)
- vault-github-actions.md 补充 §7 交叉引用

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:13:16 +08:00
d225ff74e2 fix(ci): fix terraform s3 backend SignatureDoesNotMatch error in dynamically generated backend config
- Add skip_s3_checksum = true and skip_metadata_api_check = true to s3 backend config
- Use endpoints = { s3 = ... } instead of deprecated endpoint parameter in terraform init
2026-06-25 10:46:01 +08:00
4b1f809937 ci: checkout playbooks and iac_modules from public repos
- Stop checking out the old private mono-repo `ai-workspace-infra`.
- Checkout the split public repositories `ai-workspace-infra/playbooks` and `ai-workspace-infra/iac_modules` separately.
- Remove `CODEX_GITHUB_PERSONAL_ACCESS_TOKEN` (`INFRA_REPO_TOKEN`) dependency from vault as it's no longer needed for public repos.
2026-06-25 10:14:15 +08:00
4231afc399 docs: refine latest verification (FQDN hostname both, litellm up on debian13, remaining items)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 22:00:03 +08:00
6df0990014 docs(operations): record acp-retry/litellm-uv/FQDN/non-empty fixes + verification status
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:58:21 +08:00
d3356a0ef0 docs(operations): end-to-end IaC<->Ansible dynamic-inventory workflow
Documents the YAML->generate.py->terraform->cmdb.json->ansible flow, the FQDN
inventory_hostname contract, the two execution models, the Vault-OIDC pipeline,
the non-empty/fail-fast checks, and the key fixes that make it work end to end.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:51:54 +08:00
c2cd3035a4 ci(deploy-iac): fail fast on missing required Vault secrets
Add a 'Validate required secrets' run-step after each job's Vault OIDC
load step. It checks REQUIRED steps.vault.outputs.* are non-empty via
env: mapping (never echoes secret values), and on any empty key prints a
::error:: naming the key + its Vault path then exit 1. The deploy job
requires at least one of ANSIBLE_SSH_KEY_B64 / ANSIBLE_SSH_KEY. Optional
keys (INFRA_REPO_TOKEN, TF_STATE_*) are not validated. Vault path strings
in error messages reference the env.VAULT_KV[_OPENCLAW] vars rather than
hardcoded literals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:46:30 +08:00
fa808eae80 fix(bootstrap): inventory_hostname from FQDN, not hardcoded 127.0.0.1
On-host ansible-playbook -c local now uses XWORKMATE_BRIDGE_DOMAIN (sourced from
CMDB service_domains via the pipeline) or the host FQDN as inventory_hostname,
falling back to 127.0.0.1 only when no valid FQDN exists. Keeps -c local.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:42:27 +08:00
fe479bc4b4 ci(deploy-iac): pass XWORKMATE_BRIDGE_DOMAIN (override or CMDB service_domains) to on-host bootstrap
New optional 'bridge_domain' input overrides; otherwise derive from each host's
cmdb.json host_vars.service_domains (first entry) and inject as
XWORKMATE_BRIDGE_DOMAIN so the host sets /etc/hostname + xworkmate-bridge.caddy
from it (on-host model has no inventory hostvars).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:56:45 +08:00
607c995a9a ci+docs(vault): read LLM keys from kv/openclaw, SSH/infra/cloudflare from kv/CICD
DEEPSEEK/NVIDIA/OLLAMA_API_KEY live in kv/data/openclaw (not CICD); vault-action
reads them from that path in the same step. Policy grants read on both
kv/data/CICD and kv/data/openclaw.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:35:25 +08:00
dba85dad04 docs(ci): fix header comment to kv/CICD + actual key names
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:31:30 +08:00
5d852e0285 ci+docs(vault): read shared kv/CICD with existing key names
- VAULT_KV -> kv/data/CICD (shared CICD secrets), map existing keys to outputs:
  CODEX_GITHUB_PERSONAL_ACCESS_TOKEN->INFRA_REPO_TOKEN,
  SSH_PRIVATE_DEPLOY_KEY[_B64]->ANSIBLE_SSH_KEY[_B64],
  CLOUDFLARE_DNS_API_TOKEN direct; VULTR_API_KEY/LLM keys same name.
- docs: policy reads kv/data/CICD; field table maps existing keys; note the
  three LLM keys still need to be added to kv/CICD, and SSH_PUBLIC_DEPLOY_KEY
  must match hosts.yaml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:31:00 +08:00
04d349073e ci+docs(vault): SSH key B64-preferred pattern + xworkspace-console Vault setup
- deploy job: read ANSIBLE_SSH_KEY_B64 (preferred) + ANSIBLE_SSH_KEY (fallback)
  from Vault, decode/write ~/.ssh/id_deploy and ssh-keygen -y self-check —
  matches the org SSH-deploy runbook (avoids multiline-key libcrypto errors).
- docs/operations/vault-github-actions.md: full Vault role/policy/jwt/KV setup
  for github-actions-xworkspace-console, mirroring the existing org records.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:21:01 +08:00
75d3098d1c ci(deploy-iac): fetch secrets from Vault KV via GitHub OIDC
Replace GitHub Actions Secrets with HashiCorp Vault (https://vault.svc.plus):
- permissions: id-token: write; auth via hashicorp/vault-action@v2 (method=jwt,
  role=github-actions-xworkspace-console, audience=vault) — no static token.
- Each job loads only the keys it needs from kv/data/github-actions/xworkspace-console
  (VULTR_API_KEY, INFRA_REPO_TOKEN, ANSIBLE_SSH_KEY, CLOUDFLARE_API_TOKEN,
  DEEPSEEK/NVIDIA/OLLAMA_API_KEY, optional TF_STATE_*).
- Backend gating now keys off the Vault output (steps.vault.outputs.TF_STATE_BUCKET).
- Drop unused 'playbook' input (deploy is on-host bootstrap).

Pattern mirrors xworkmate-app/.github/workflows/build-and-release.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:17:46 +08:00
e74f2334e3 docs(setup): complete optional-parameters manual for curl|bash bootstrap
Expand the all-in-one setup guide (zh+en) into a full reference of the
bootstrap script's supported options, grouped by purpose: subcommands
(uninstall/--purge), public-exposure & security, unified auth-token chain,
runtime modes, offline package, performance/locks, source/version overrides.
Fix the inaccurate TOKEN var -> AI_WORKSPACE_AUTH_TOKEN (the real precedence
chain). Sourced from scripts/setup-ai-workspace-all-in-one.sh.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:26:01 +08:00
b2c8c5d875 ci+docs: on-host bootstrap deploy job + console serving/verification updates
- deploy-ai-workspace-iac.yaml: deploy job now ssh-es to each host and runs
  the official curl|bash bootstrap locally (host-side ansible -c local,
  offline-accelerated), instead of running all-in-one from the runner (which
  breaks on roles/agent_skills delegate_to: localhost). provision job kept as
  the batch-provision mode.
- docs/operations: record final console fix (local python static backend),
  caddy/public-access architecture, and debian13/ubuntu26.04/macOS verification.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 09:44:22 +08:00
e47b15a5f0 docs(operations): IaC + Ansible dynamic-inventory deploy verification & fixes
Records the IaC->inventory->deploy linkage, offline-package linkage
verification, the local-on-host execution finding, the 5 fixes applied to
playbooks, and the remaining console static-serve + pipeline TODOs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 03:02:59 +08:00
b039a36a69 ci: align deploy pipeline with shared scripts/templates layout
generate.py moved to vultr-vps/scripts/ and provider/variables/cloud-init to
templates/; run render/inventory from VPS_ROOT via scripts/generate.py, keep
terraform -chdir in the env workdir.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:23:48 +08:00
7c46dffde2 ci: add IaC + Ansible + Cloudflare matrix deploy pipeline
Matrix pipeline that provisions Vultr hosts via iac_modules vultr-vps
ai-workspace env (Terraform), derives the deploy matrix from the rendered
CMDB, deploys per-host with Ansible all-in-one, then syncs Cloudflare DNS.
Pipelining off + PYTHONWARNINGS=ignore for Python 3.13 targets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 21:02:32 +08:00
0f289383e2
Update README.md 2026-06-23 14:53:35 +08:00
2832716076
Revise model names in README for accuracy
Updated model names for clarity and consistency.
2026-06-23 14:52:35 +08:00
15aa1d2c25
Fix model names in registration instructions
Updated model registration instructions and corrected names.
2026-06-23 14:52:04 +08:00
2681ce5faf
Fix spacing in README.zh.md
Corrected spacing in the Chinese README file.
2026-06-23 14:49:17 +08:00
f61fb1ac02
Update README.zh.md 2026-06-23 14:49:03 +08:00
2a227deddc docs: restructure docs to support full en/zh bilingual versions with language toggles 2026-06-23 14:43:54 +08:00
fa49b2fda1 docs: add version compatibility matrix and reference in README 2026-06-23 14:20:50 +08:00
df282ae735 feat: support specifying local offline package path via AI_WORKSPACE_OFFLINE_PACKAGE 2026-06-23 14:05:08 +08:00
4a36b22bf0 fix(script): prevent ansible from splitting api exec string by spaces 2026-06-23 13:21:45 +08:00
61055887f8 docs: add official register_mainstream_models documentation with new routing design 2026-06-23 12:55:07 +08:00
3905f1ac6a docs: add openclaw litellm compat plan 2026-06-23 12:42:27 +08:00
d18897d6ad chore(setup): update setup script for ai workspace models 2026-06-23 11:04:38 +08:00
fd1fb5710c ci(console-runtime): publish moving latest-runtime release
The ai-workspace role's final-deployment step downloads the console runtime
from a stable latest-runtime release (matching the bridge/qmd/litellm
convention). Have the publish job refresh a moving `latest-runtime` release
alongside the immutable `runtime-<sha>` one, carrying the same cross-compiled
assets (darwin-arm64, linux-amd64, linux-arm64) + SHA256SUMS, so consumers get
a predictable URL:
  releases/download/latest-runtime/xworkspace-console-runtime-<os>-<arch>.tar.gz

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:05:20 +08:00
9b2b3953af feat(dashboard): enforce token authentication by default and always enable logout 2026-06-22 15:14:44 +08:00
e086403c2d fix(dashboard): fix logout button behavior by adding page reload and hiding button when auth is not required 2026-06-22 14:43:08 +08:00
54df83dc9e chore(macos-patch): resilient litellm install + idempotent OpenClaw guards
Inject pip --retries/--resume-retries into the cloned litellm install task,
tolerate empty version-probe stdout via default('{}', true), and guard the
OpenClaw download/extract patches so a second pass cannot append a duplicate
`when:` (invalid YAML). Ignore scripts/__pycache__.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 13:25:12 +08:00
7fd48bbf74 docs(macos): record TC-MAC-028..033 and refresh delivery plan
Document the six macOS issues found and fixed during end-to-end
verification of the all-in-one install: litellm dependency version-probe
SyntaxError (TC-028), prisma generator PATH (TC-029), QMD plist undefined
nodejs_version (TC-030), QMD better-sqlite3 Node ABI mismatch (TC-031),
XFCE/XRDP apt-on-macOS (TC-032), and litellm DATABASE_URL password
percent-encoding / P1013 (TC-033), each with its playbooks commit. Update
the fix-dimension summary and the runtime delivery plan status.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 13:25:12 +08:00
d0d5a79be8 feat(uninstall): print teardown plan and purge path status
`uninstall` / `uninstall --purge` previously removed services and (on
purge) `rm -rf`'d a hand-maintained list of paths with no output, so users
could not see what would be — or had been — deleted (TC-MAC-026).

Add a pre-flight `print_uninstall_summary` that lists the apps/services to
be removed (launchd agents on macOS; systemd units + docker containers on
Linux) and, when --purge is set, every target path with its current
[present]/[absent] status. Centralize the purge paths into a single
source-of-truth inventory and route deletions through a `purge_path`
helper that prints `removed:` / `absent (skipped):` per path. Document the
subcommands in the usage header. Behavior is otherwise unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 12:37:59 +08:00
51f2776840 fix(macos-patch): tolerate empty litellm version-probe stdout
Mirror the playbooks fix for the curl|bash clone path: rewrite
default('{}') | from_json to default('{}', true) | from_json so an empty
probe stdout no longer crashes the install-decision set_fact.
2026-06-22 03:18:59 +00:00
b1b22bc447 docs(macos): update delivery plan and macOS compatibility test cases 2026-06-22 02:43:54 +00:00
578e5e7604 refactor(bootstrap): drop unused local portal config writer
macOS deploys via the ansible path, so write_local_portal_config and the AI_WORKSPACE_DARWIN_MODE doc line are dead code. Ignore scripts/__pycache__.
2026-06-22 02:43:54 +00:00
42c769202b fix(macos-patch): idempotent OpenClaw guards + resilient litellm install
- OpenClaw download sub-patch re-applied on a 2nd pass produced a duplicate when: key (invalid YAML); guard against the already-patched form.
- OpenClaw extract_old drifted from upstream (missing creates:, notify now a list) so the Darwin guard silently never applied and the task tried to unarchive a tarball never downloaded on macOS; realign + idempotent guard.
- Inject pip --retries/--resume-retries + longer timeout into the LiteLLM dependency install for the curl|bash clone path.
2026-06-22 02:42:51 +00:00
Haitao Pan
d24a4dc0fe refactor(deploy): extract python playbook patches into an external script 2026-06-21 19:19:40 +08:00
Haitao Pan
bf1762a912 fix(macOS): update ansible setup patching logic to match the newly unified 'Restart openclaw' listen topic 2026-06-21 19:12:42 +08:00