20260914 强制 TOML 配置并完善 TA 刷新与 daemon
Some checks failed
ci / rust (push) Has been cancelled
ci / docker (push) Has been cancelled
ci / audit (push) Has been cancelled

This commit is contained in:
2026-09-14 16:58:08 +08:00
parent 6383e2c12c
commit 4975128945
48 changed files with 2795 additions and 1459 deletions

View File

@@ -47,18 +47,32 @@ fi
run_validator() {
local out="$1"
local mode="$2"
local config="$work_root/validate-$mode.toml"
cat >"$config" <<EOF
config-version = 1
mode = "validate"
out = "/output"
rrdp-state-dir = "/state"
rrdp-sync-mode = "$mode"
ccr-out = "/output/result.ccr"
http-timeout-secs = 5
http-root-cert = ["/fixture/certs/rrdp-ca.pem"]
parallel-max-repo-sync-workers-global = 2
parallel-phase2-object-workers = 2
log-level = "info"
log-format = "json"
[[anchors]]
id = "custom"
tal = "/fixture/tal/custom.tal"
ta = "/fixture/ta/custom-ta.cer"
EOF
docker run --rm --network host --user "$(id -u):$(id -g)" \
-v "$fixture:/fixture:ro" \
-v "$work_root/state:/state" \
-v "$out:/output" \
"$image" validate \
--tal /fixture/tal/custom.tal --ta /fixture/ta/custom-ta.cer \
--http-root-cert /fixture/certs/rrdp-ca.pem \
--http-timeout-secs 5 \
--parallel-max-repo-sync-workers-global 2 \
--parallel-phase2-object-workers 2 \
--rrdp-state-dir /state --rrdp-sync-mode "$mode" \
--ccr-out /output/result.ccr --out /output --log-level info --log-format json
-v "$config:/config/validate.toml:ro" \
"$image" validate --config /config/validate.toml
}
run_validator "$work_root/output-snapshot" snapshot
@@ -95,14 +109,32 @@ echo "Synthetic Docker snapshot+delta E2E passed"
mkdir "$work_root/daemon"
rm "$fixture/active"
ln -s "cases/baseline-v1/http" "$fixture/active"
daemon_config="$work_root/daemon.toml"
cat >"$daemon_config" <<EOF
config-version = 1
mode = "daemon"
state-root = "/data"
interval-secs = 2
max-runs = 3
retain-runs = 3
http-timeout-secs = 5
http-root-cert = ["/fixture/certs/rrdp-ca.pem"]
parallel-max-repo-sync-workers-global = 2
parallel-phase2-object-workers = 2
log-level = "info"
log-format = "json"
[[anchors]]
id = "custom"
tal = "/fixture/tal/custom.tal"
ta = "/fixture/ta/custom-ta.cer"
EOF
daemon_container="panda-rpki-daemon-$(basename "$work_root")"
docker run --rm --name "$daemon_container" --network host --read-only --tmpfs /tmp \
--user "$(id -u):$(id -g)" \
-v "$fixture:/fixture:ro" -v "$work_root/daemon:/data" \
"$image" daemon \
--state-root /data --max-runs 3 --interval-secs 2 --retain-runs 3 -- \
--tal /fixture/tal/custom.tal --ta /fixture/ta/custom-ta.cer \
--http-root-cert /fixture/certs/rrdp-ca.pem --log-format json \
-v "$daemon_config:/config/daemon.toml:ro" \
"$image" daemon --config /config/daemon.toml \
>"$work_root/daemon-container.log" 2>&1 &
daemon_job=$!
python3 - "$work_root/daemon" "$fixture" <<'PY'