This commit is contained in:
Brian Zalewski 2024-05-18 06:09:14 +00:00
parent ed1a4b5292
commit 4bc8eb2473

View file

@ -48,7 +48,7 @@ if command -v cloudflared > /dev/null; then
sudo ln -s /usr/local/etc/cloudflared /etc/cloudflared sudo ln -s /usr/local/etc/cloudflared /etc/cloudflared
else else
if [ ! -L /etc/cloudflared ]; then if [ ! -L /etc/cloudflared ]; then
logg info '/etc/cloudflared is present (and not symlinked) but files are being modified in /usr/local/etc/cloudflared' logg warn '/etc/cloudflared is present as a regular directory (not symlinked) but files are being modified in /usr/local/etc/cloudflared'
fi fi
fi fi
@ -60,11 +60,11 @@ if command -v cloudflared > /dev/null; then
logg info "Setting up $DOMAIN for access through cloudflared" logg info "Setting up $DOMAIN for access through cloudflared"
sudo cloudflared tunnel route dns -f "$TUNNEL_ID" "$DOMAIN" && logg success "Successfully routed $DOMAIN to this machine's cloudflared Argo tunnel" sudo cloudflared tunnel route dns -f "$TUNNEL_ID" "$DOMAIN" && logg success "Successfully routed $DOMAIN to this machine's cloudflared Argo tunnel"
fi fi
done< <(yq '.ingress[].hostname' /usr/local/etc/config.yml) done< <(yq '.ingress[].hostname' /usr/local/etc/cloudflared/config.yml)
### Update config.yml ### Update /usr/local/etc/cloudflared/config.yml
logg info 'Updating /usr/local/etc/config.yml to reference tunnel ID' logg info 'Updating /usr/local/etc/cloudflared/config.yml to reference tunnel ID'
sudo yq eval -i ".tunnel = \"$HOSTNAME_LOWER\"" config.yml sudo yq eval -i ".tunnel = \"$HOSTNAME_LOWER\"" /usr/local/etc/cloudflared/config.yml
### Set up service ### Set up service
if [ -d /Applications ] && [ -d /System ]; then if [ -d /Applications ] && [ -d /System ]; then