返回 CodeWhale
README.md
1 # CNB Deploy Templates
2
3 The root `.cnb.yml` is intentionally source-controlled in GitHub because CNB is
4 a one-way mirror from GitHub. Do not add or edit `.cnb.yml` only on the CNB
5 side; the next GitHub sync will overwrite it.
6
7 The active root `.cnb.yml` does two things:
8
9 - runs Feishu bridge and version-drift checks when CNB receives `main`;
10 - builds Linux x64 release assets from `v*` tags, creates the CNB release, and
11 uploads the current `codewhale-linux-x64` and `codew-linux-x64` commands,
12 the compatibility-only `codewhale-tui-linux-x64` release filename, and
13 `codewhale-artifacts-sha256.txt`.
14
15 The files in this directory are retained as deploy-button templates for Tencent
16 Lighthouse. Copy only the deploy environment file after the Lighthouse instance
17 is already working manually:
18
19 ```bash
20 mkdir -p .cnb
21 cp deploy/tencent-lighthouse/cnb/tag_deploy.yml.example .cnb/tag_deploy.yml
22 ```
23
24 If you also need to customize `.cnb.yml`, edit the root file in GitHub and let
25 the one-way mirror carry it to CNB.
26
27 ## Required CNB Secrets
28
29 Configure these as protected CNB environment variables or secrets:
30
31 - `LIGHTHOUSE_HOST`: public IP or DNS name of the Lighthouse instance
32 - `LIGHTHOUSE_SSH_TARGET`: SSH target, for example `ubuntu@203.0.113.10`
33 - `LIGHTHOUSE_SSH_PRIVATE_KEY`: private deploy key allowed to update the server
34 - `CODEWHALE_REPO_BRANCH`: branch or tag to deploy, for example `main`
35
36 Optional:
37
38 - `CODEWHALE_REPO_URL`: defaults to the CNB mirror URL
39 - `LIGHTHOUSE_SSH_PORT`: defaults to `22`
40
41 The server side should already have the runtime checkout, environment files,
42 and systemd services installed by the maintainer-owned server setup process.
43
44 ## Safety Notes
45
46 - Do not store Feishu App Secret or provider API keys in CNB. They belong in
47 `/etc/codewhale/*.env` on Lighthouse.
48 - Do not expose `127.0.0.1:7878` through EdgeOne, a security group, or a public
49 reverse proxy.
50 - Start with a manual deploy button. Automatic deploy on every `main` push is
51 convenient later, but it can consume CNB quota and restart the phone bridge
52 while a turn is active.
53
53 lines MARKDOWN