Overview

Date: 2026-05-11

Time: 15:37

Overview

This is an FTL2 AI-loop rule that ensures Caddy reverse proxy is correctly configured on the arcade host, routing arcade.catbeez18.com to localhost:8000 with automatic TLS. It follows the observe-condition-action pattern: gather state, check if drift exists, and remediate if needed.

Usage Patterns

This rule is loaded by the FTL2 AI reconciliation loop automatically. It is not called directly by user code. The loop executes the three phases in order:

1. Observe — runs commands on arcade to collect current Caddyfile content, systemd service status, and firewall rules.

2. Condition — compares observed state against expected; returns True if any component has drifted.

3. Action — remediates by writing the correct Caddyfile, enabling firewall services, and ensuring caddy is started/enabled.


# The observe list defines what state to collect before evaluation
observe = [
    {"name": "caddyfile_content", "module": "command", "params": {"cmd": "cat /etc/caddy/Caddyfile ..."}, "host": "arcade"},
    {"name": "caddy_status", "module": "command", "params": {"cmd": "systemctl is-active caddy && ..."}, "host": "arcade"},
    {"name": "firewall_services", "module": "command", "params": {"cmd": "sudo firewall-cmd --list-services ..."}, "host": "arcade"},
]

API and Configuration

Key Behaviors

Relationships