Merge branch 'feature/orchestrator-firewall' into unify/skills-20261112-night

# Conflicts:
#	orchestrator/Dockerfile
#	orchestrator/kvb_orchestrator/view.py
#	orchestrator/templates/index.html.j2
#	orchestrator/templates/page-cleanup.js
#	scripts/orchestrator.sh
This commit is contained in:
Kevin Veen-Birkenbach committed 2026-11-13 18:18:54 +00:00
commit d364cfe55f
48 files changed
+3438 -106

No files matched your search

+24 -4
View File
@@ -5,9 +5,9 @@
# server for Claude Code, build pkgmgr from the newest signed tag of
# PKGMGR_REPO and enable the tree timer and the cleanup path unit,
# enable the sessions timer and the offices path unit, enable the
# resources timer; re-enable the runner and re-register
# the hook when the migration took them over; an enabled runner gets
# the fresh unit and a restart
# resources timer, the firewall path unit and timer; re-enable the
# runner and re-register the hook when the migration took them over;
# an enabled runner gets the fresh unit and a restart
# migrate move every trace of the earlier name to the kvb-orchestrator names
# once: container, image, code, state, approvals, pinned keys, MCP
# server, PermissionRequest hook, runner unit; a second run changes
@@ -42,6 +42,7 @@ CLEANUP_UNIT="${NAME}-cleanup"
OFFICES_UNIT="${NAME}-offices"
SESSIONS_UNIT="${NAME}-sessions"
RESOURCES_UNIT="${NAME}-resources"
FIREWALL_UNIT="${NAME}-firewall"
INSTALLED_SKILLS="${HOME}/.claude/skills"
HOST_SCRIPTS=(kvb-org-organize/scripts/council.py kvb-org-organize/scripts/nofollow.py kvb-org-rasci/scripts/rasci.py kvb-org-operator/scripts/operator.py kvb-org-radio/scripts/radio.py)
TREE_DIR="${HOME}/.local/state/pkgmgr/tree"
@@ -157,7 +158,7 @@ install_hub() {
cp -a "${REPO_ROOT}/orchestrator/." "${HUB}/"
# Python loads a cached .pyc whose header matches the source mtime and size, and cp -a keeps the mtime: one planted in the sandbox-writable tree would run on the host
find -H "${HUB}" \( -name __pycache__ -o -name '*.py[co]' \) -prune -exec rm -rf {} +
chmod +x "${HUB}/client/permission_hook.py" "${HUB}/client/runner.py" "${HUB}/client/approval.py" "${HUB}/client/cleanup.py" "${HUB}/client/offices.py" "${HUB}/client/sessions.py" "${HUB}/client/resources.py"
chmod +x "${HUB}/client/permission_hook.py" "${HUB}/client/runner.py" "${HUB}/client/approval.py" "${HUB}/client/cleanup.py" "${HUB}/client/offices.py" "${HUB}/client/sessions.py" "${HUB}/client/resources.py" "${HUB}/client/settings_writer.py"
log "skills: the PermissionRequest hook client is ${HUB}/client/permission_hook.py"
log "skills: approvals need a pinned passkey: settings, 'Passkey registrieren', then 'make orchestrator-pin CREDENTIAL=<blob>'; until then every executor refuses"
printf 'KVB_ORCHESTRATOR_USER=%s:%s\nKVB_ORCHESTRATOR_STATE=%s\nKVB_ORCHESTRATOR_COUNCIL=%s\nKVB_ORCHESTRATOR_SKILLS=%s\nKVB_ORCHESTRATOR_PROJECTS=%s\nKVB_ORCHESTRATOR_TREE=%s\nKVB_ORCHESTRATOR_TIMERS=%s\nKVB_ORCHESTRATOR_APPROVERS=%s\nKVB_ORCHESTRATOR_KEPT=%s\n' \
@@ -257,6 +258,19 @@ resources_timer() {
log "skills: ${RESOURCES_UNIT}.timer samples the host and counts the transcripts' tokens into ${HOME}/.local/state/agents-council/resources every minute"
}
firewall_unit() {
if ! has_systemd; then
warn "skills: no systemd user session; the Firewall shows no settings and signed settings changes wait."
return 0
fi
cp -f "${HUB}/systemd/${FIREWALL_UNIT}.service" "${HUB}/systemd/${FIREWALL_UNIT}.path" "${HUB}/systemd/${FIREWALL_UNIT}.timer" "${UNITS}/"
systemctl --user daemon-reload
systemctl --user enable --now "${FIREWALL_UNIT}.path"
systemctl --user enable --now "${FIREWALL_UNIT}.timer"
systemctl --user restart "${FIREWALL_UNIT}.timer"
log "skills: ${FIREWALL_UNIT}.path writes the settings changes the operator signs in the Firewall; ${FIREWALL_UNIT}.timer refreshes the settings view every minute"
}
skills_current() {
local script
for script in "${HOST_SCRIPTS[@]}"; do
@@ -286,6 +300,7 @@ install_all() {
tree_timer
sessions_timer
resources_timer
firewall_unit
offices_unit
if ((TOOK_RUNNER)) || runner_enabled; then runner || true; fi
if ((TOOK_HOOK)); then
@@ -374,6 +389,11 @@ check() {
else
todo "${RESOURCES_UNIT}.timer off: the Resources view waits for make orchestrator-install"
fi
if [[ "$(systemctl --user is-active "${FIREWALL_UNIT}.path" 2>/dev/null || true)" == "active" ]]; then
ok "${FIREWALL_UNIT}.path active"
else
todo "${FIREWALL_UNIT}.path off: Firewall settings changes wait for make orchestrator-install"
fi
if [[ "$(systemctl --user is-active "${OFFICES_UNIT}.path" 2>/dev/null || true)" == "active" ]]; then
ok "${OFFICES_UNIT}.path active"
else