Last active
June 11, 2019 13:07
-
-
Save adamfeldman/8948a76879ff6caed16941e0218a0ede to your computer and use it in GitHub Desktop.
Parameterized systemd service to support multiple `cloudflared tunnel`
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
# /lib/systemd/system/cloudflared@.service | |
[Unit] | |
Description=Cloudflare Tunnels (%I) | |
After=network.target | |
[Service] | |
Type=simple | |
User=cloudflared | |
ExecStart=/usr/local/bin/cloudflared tunnel --config /etc/cloudflared/%i.yml | |
Restart=on-failure | |
RestartSec=10 | |
KillMode=process | |
[Install] | |
WantedBy=multi-user.target |
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
# Enable and start the service | |
systemctl enable cloudflared@config-ha | |
systemctl start cloudflared@config-ha |
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
# /etc/cloudflared/config-ha.yml | |
hostname: {homeassistant.MYDOMAIN.COM} | |
url: https://{INTERNAL_IP}:8123 | |
no-tls-verify: true | |
logfile: /var/log/cloudflared-ha.log | |
origincert: /etc/cloudflared/cert.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment