fix silent fail of loading policy with panic, and bogus fallback logic

This commit is contained in:
2025-11-24 20:24:51 +00:00
parent da058c37c0
commit 6e4f24329e
6 changed files with 653 additions and 25 deletions

25
enable-policy.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
# Enable ORLY policy system
set -e
echo "Enabling ORLY policy system..."
# Backup the current service file
sudo cp /etc/systemd/system/orly.service /etc/systemd/system/orly.service.backup
# Add ORLY_POLICY_ENABLED=true to the service file
sudo sed -i '/SyslogIdentifier=orly/a\\n# Policy system\nEnvironment="ORLY_POLICY_ENABLED=true"' /etc/systemd/system/orly.service
# Reload systemd
sudo systemctl daemon-reload
echo "✓ Policy system enabled in systemd service"
echo "✓ Daemon reloaded"
echo ""
echo "Next steps:"
echo "1. Restart the relay: sudo systemctl restart orly"
echo "2. Verify policy is active: journalctl -u orly -f | grep policy"
echo ""
echo "Your policy configuration (~/.config/ORLY/policy.json):"
cat ~/.config/ORLY/policy.json