fix: resolve 17 confirmed bash-parity drifts from port review
Adversarial parity review of every ported action against its bash source confirmed 17 real behavioral drifts (of 22 claimed); all fixed here: - tiers/chown: defaults were compositions/apex/tierN (one level too deep); now the tier roots. shared/ base reset is non-recursive again. - compose: --dry-run was swallowed by argparse.REMAINDER; now stripped. - host.write_file: rendered files land 0644 (tempfile's 0600 made fresh systemd units/crowdsec configs owner-only). - systemd.deploy_units: top-level non-hidden files only. - ufw: missing docker/host config dir exits 66; missing /etc/ufw target aborts; empty rules dir warns; dotfile .rules excluded. - sync/packages: Telegram error-trap parity and failed notify exits 1. Same notify-failure exit for backup/run and sync/repository. repository regains the node-dir guard. - tiers/useradd: no more secret-bearing .env.bak per run. - tiers/link: EOF on confirm prompt declines and continues. - extract-traefik-certs: sudo mkdir inside the notify envelope. - generate-happ-subscriptions: realpath parent-exists guards + docker check. - configure/crowdsec: bouncer install goes through install_packages. - lint-docker-compose: malformed/unreadable anchor-IP inputs are lint errors. - core compose: APEX_RESTIC_REPOSITORY now ?error; RESTIC_COMPRESSION per-node via APEX_RESTIC_COMPRESSION (default auto). - sys.service_exists line-anchored; tpl docstring corrected.
This commit is contained in:
1 parent
ad47b73928
commit
6aaef35780
20 files changed
+152
-41
No files matched your search
@@ -20,5 +20,5 @@ def run(ctx, args):
|
||||
if os.path.isfile(bouncer) and not ctx.sys.ok(
|
||||
["bash", "-c", "dpkg -l | grep -q crowdsec-firewall-bouncer-iptables"]):
|
||||
ctx.log.info("Installing crowdsec-firewall-bouncer-iptables...")
|
||||
ctx.sys.sudo(["apt-get", "install", "-y", "crowdsec-firewall-bouncer-iptables"])
|
||||
ctx.sys.install_packages(["crowdsec-firewall-bouncer-iptables"])
|
||||
ctx.log.success("Configured crowdsec.")
|
||||
@@ -13,7 +13,12 @@ def run(ctx, args):
|
||||
docker_dir = os.path.join(cfg, "docker")
|
||||
host_dir = os.path.join(cfg, "host")
|
||||
ctx.log.info("Configuring UFW rules...")
|
||||
if not os.path.isdir(docker_dir):
|
||||
# Mirrors the bash branch structure: host dir is passed unconditionally (a missing
|
||||
# one exits 66 inside apply); both dirs missing = warn + success, like bash.
|
||||
if os.path.isdir(docker_dir):
|
||||
ctx.ufw.apply(docker_dir, host_dir, dry_run=args.dry_run)
|
||||
else:
|
||||
ctx.log.warn(f"Docker rules dir not found at {docker_dir}. Skipping ufw-docker rules.")
|
||||
ctx.ufw.apply(docker_dir, host_dir if os.path.isdir(host_dir) else None, dry_run=args.dry_run)
|
||||
if os.path.isdir(host_dir):
|
||||
ctx.ufw.apply(docker_dir, host_dir, dry_run=args.dry_run)
|
||||
ctx.log.success("Configured ufw.")
|
||||
Reference in new issue
Block a user