Skip to content

Commit

Permalink
feat(chezmoi/Taskfile): add tasks for Cloudflare Tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Sep 27, 2023
1 parent 789fe10 commit e1b0d09
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chezmoi/Taskfile.dist.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,24 @@ tasks:
cmds:
- cp {{ .cloudflared.config_template }} {{ .cloudflared.config_file }}

cloudflared-create-dns-record:
desc: Create a DNS record for the Cloudflare Tunnel
cmds:
- cloudflared tunnel route dns $CLOUDFLARED_TUNNEL_NAME $CLOUDFLARED_TUNNEL_HOSTNAME
env:
CLOUDFLARED_TUNNEL_NAME: {{ .cloudflared.tunnel_name }}
CLOUDFLARED_TUNNEL_HOSTNAME: {{ .cloudflared.tunnel_hostname }}

cloudflared-tunnel-run:
desc: Run the Cloudflare Tunnel
cmds:
- cloudflared tunnel run $CLOUDFLARED_TUNNEL_NAME
env:
CLOUDFLARED_TUNNEL_NAME: {{ .cloudflared.tunnel_name }}

cloudflared-service-install:
desc: Install the Cloudflare Tunnel as a systemd service (cloudflared should be installed at the system level.)
cmds:
- cloudflared --config {{ .cloudflared.config_file }} service install

{{- end }}

0 comments on commit e1b0d09

Please sign in to comment.