revert(cistech-tunnel): restore to working state at 5d54ed6
Some checks failed
Test / test (push) Has been cancelled

- Removed build/ folder
- Restored source/ folder with original Dockerfile and entrypoint.sh
- Reverted config files to original working state
- Cleaned up shared/ to only contain host routing scripts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 11:28:10 +00:00
parent 274125e862
commit f410510a7f
15 changed files with 356 additions and 548 deletions

View File

@@ -1,55 +1,68 @@
#!/usr/bin/env bash
#
# Install host-side systemd services for rego-tunnel
# Run this ONCE on the host after installing the app in Runtipi
# Install host-side systemd services for cistech-tunnel
# Run this ONCE on the host after app install
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
APP_DATA_DIR="/etc/runtipi/app-data/runtipi/rego-tunnel"
APP_DATA_DIR="/etc/runtipi/app-data/runtipi/cistech-tunnel"
echo "Installing rego-tunnel host services..."
echo "Installing cistech-tunnel host services..."
# Create the path watcher unit
cat << 'EOF' | sudo tee /etc/systemd/system/rego-routing-watcher.path
# Create app-data directory for trigger file
sudo mkdir -p "$APP_DATA_DIR"
# Create the path unit (watches for trigger file)
sudo tee /etc/systemd/system/cistech-routing-watcher.path > /dev/null << EOF
[Unit]
Description=Watch for rego-tunnel routing trigger
Description=Watch for cistech-tunnel routing trigger
[Path]
PathExists=/etc/runtipi/app-data/runtipi/rego-tunnel/restart-routing
Unit=rego-routing-watcher.service
PathExists=$APP_DATA_DIR/restart-routing
Unit=cistech-routing-watcher.service
[Install]
WantedBy=multi-user.target
EOF
# Create the service unit
cat << EOF | sudo tee /etc/systemd/system/rego-routing-watcher.service
# Create the service unit (applies routes when triggered)
sudo tee /etc/systemd/system/cistech-routing-watcher.service > /dev/null << EOF
[Unit]
Description=Apply rego-tunnel routing rules
Description=Apply cistech-tunnel routing rules
After=docker.service
[Service]
Type=oneshot
ExecStart=${SCRIPT_DIR}/host-routing.sh restart
ExecStartPost=/bin/rm -f ${APP_DATA_DIR}/restart-routing
ExecStartPost=/bin/bash -c 'echo "trigger cleared at \$(date)" >> ${APP_DATA_DIR}/watcher.log'
ExecStart=$SCRIPT_DIR/host-routing.sh restart
ExecStartPost=/bin/rm -f $APP_DATA_DIR/restart-routing
ExecStartPost=/bin/bash -c 'echo "trigger cleared at \$(date)" >> $APP_DATA_DIR/watcher.log'
EOF
# Make host-routing.sh executable
sudo chmod +x "${SCRIPT_DIR}/host-routing.sh"
chmod +x "$SCRIPT_DIR/host-routing.sh"
# Reload systemd and enable the watcher
sudo systemctl daemon-reload
sudo systemctl enable --now rego-routing-watcher.path
sudo systemctl enable cistech-routing-watcher.path
sudo systemctl start cistech-routing-watcher.path
# Disable the old boot-only service if it exists
if systemctl is-enabled cistech-routing.service &>/dev/null; then
echo "Disabling old cistech-routing.service (replaced by watcher)..."
sudo systemctl stop cistech-routing.service 2>/dev/null || true
sudo systemctl disable cistech-routing.service 2>/dev/null || true
fi
# Apply routes now
echo "Applying initial routes..."
sudo "$SCRIPT_DIR/host-routing.sh" start
echo ""
echo "Done! Services installed:"
echo " - rego-routing-watcher.path (watches for trigger file)"
echo " - rego-routing-watcher.service (applies routing rules)"
echo "Done! Watcher installed and routes applied."
echo ""
echo "To check status:"
echo " systemctl status rego-routing-watcher.path"
echo "To trigger route refresh from container:"
echo " touch /runtime/restart-routing"
echo ""
echo "To manually trigger routing:"
echo " touch ${APP_DATA_DIR}/restart-routing"
echo "To check watcher status:"
echo " systemctl status cistech-routing-watcher.path"