Created
September 18, 2022 21:10
-
-
Save maesoser/2b80738b9e8248ef6ba9e859a284e4af to your computer and use it in GitHub Desktop.
Cloudflare tunnel service for openwrt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh /etc/rc.common | |
USE_PROCD=1 | |
START=30 | |
TOKEN="ey000...0000" | |
COLO="nyc" | |
stop_service() { | |
echo "Stopping cloudflared tunnel" | |
} | |
start_service() { | |
procd_open_instance | |
procd_set_param command /bin/cloudflared | |
procd_append_param command --pidfile /var/run/cloudflared.pid | |
procd_append_param command --logfile /var/log/cloudflared.log | |
procd_append_param command --loglevel info | |
procd_append_param command --autoupdate-freq 48h0m0s | |
procd_append_param command --metrics 127.0.0.1:9300 | |
procd_append_param command tunnel | |
procd_append_param command --protocol quic | |
procd_append_param command --compression-quality 3 | |
procd_append_param command --tag colo=$COLO | |
procd_append_param command run | |
procd_append_param command --token $TOKEN | |
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-10} ${respawn_retry:-0} | |
procd_set_param stdout 1 | |
procd_set_param stderr 1 | |
procd_close_instance | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment