fix(chv-muse-r11fix): authd 层 1 叶子树补 errors.py + stub __init__、层 2 seed 补三键

层 1:真实的 cloud/chv/__init__.py import executor/orphans,拷进
authd 最小叶子树(/usr/local/lib/chv-authd)会让 chv-authd 在
import 时 ModuleNotFoundError 而 crash loop——先是 errors.py
缺失,补上后又在 executor 上失败(探针 fixprobe3)。新增
chv-guest/authd_init_stub.py(仅导出 ChvFailure),build.sh 拷
errors.py + stub 作叶子树的 __init__.py,不再拷真实包 __init__;
P3_LIBS_PRESENT 条件加 errors.py;EXTRA_CONTENTS 加 errors.py 与
__init__.py;两 lockfile 脚本的 DECLARED_SOURCES 同款登记。
层 2:_seed_env_entries 把 guest-env 里的
GITEA_URL/GITEA_USER/SYNC_REPO 抄进 authd-seed(build_server
要求四键齐全,只 GITEA_TOKEN 即 ValueError);没有不补、不编
默认值。测试:seed 三键落盘/缺键不补、干跑夹具含新文件、lockfile
合成清单含新两项。
This commit is contained in:
host committed 2026-11-07 03:56:24 +00:00
1 parent b41fb67026
commit 2d12179b9a
8 files changed
+110 -13

No files matched your search

+18 -6
View File
@@ -193,10 +193,16 @@ def build_seed_user_data(private_key_text: str, public_key_text: str) -> str:
def _authd_env_entry(authd_env: dict) -> list:
"""authd-seed 的 write_files 条目行(0600 root,值经
shlex.quote 引用):只装 AUTHD_SECRET_KEYS 命中的密钥,
与 guest-env 条目并列写进同一 write_files 列表(绝不另写
一个 write_files: 键,见 _guest_env_entry 的 YAML 重复键
禁令)。"""
shlex.quote 引用):装 AUTHD_SECRET_KEYS 命中的密钥
(本期只有 GITEA_TOKEN),外加与 guest-env 同源抄进来的
三个非密钥同步变量(GITEA_URL/GITEA_USER/SYNC_REPO——
round-11 真机修复层 2:authd 的 build_server 要求 seed
里同时有这三键,只 GITEA_TOKEN 会 ValueError;探针
fixprobe3 即从 guest-env 补这三键)。三键只在调用方
guest-env 里有才抄,没有不补、不编默认值;与 guest-env
条目并列写进同一 write_files 列表(绝不另写一个
write_files: 键,见 _guest_env_entry 的 YAML 重复键禁令)。
"""
lines = [
" - path: %s" % AUTHD_SEED_PATH,
" permissions: '0600'",
@@ -296,12 +302,18 @@ def _write_seed_meta(seed_dir: str, vm_name: str) -> str:
def _seed_env_entries(merged_env: dict,
authd_env: dict | None) -> list:
"""guest-env 与 authd-seed 两路的 write_files 条目行
(皆空即空列表,不写条目)。"""
(皆空即空列表,不写条目)。authd-seed 除了密钥还抄
guest-env 里的 GITEA_URL/GITEA_USER/SYNC_REPO(层 2,
见 _authd_env_entry)——build_server 要求四键齐全。"""
extra_lines = []
if merged_env:
extra_lines += _guest_env_entry(merged_env)
if authd_env:
extra_lines += _authd_env_entry(authd_env)
seed_env = dict(authd_env)
for key in ("GITEA_URL", "GITEA_USER", "SYNC_REPO"):
if key in merged_env:
seed_env[key] = merged_env[key]
extra_lines += _authd_env_entry(seed_env)
return extra_lines