all repos — flynet @ 074d78dd1f7c2963b455560eb223250ec76fafa5

ersatz CDN on fly.io

add script to check if hostnames are provisioned on fly

Alin
commit

074d78dd1f7c2963b455560eb223250ec76fafa5

parent

a6bedb4945e23fb4c395d9c4a3b4cc6d3d0c9fce

1 file changed, 31 insertions(+), 0 deletions(-)

changed files
A check-hostnames
@@ -0,0 +1,31 @@
+#!/usr/bin/env fish +set --local to_provision $( + join -v1 \ + (awk ' + /^[a-z]/ { + gsub(/, /, " "); + gsub(/ {/, ""); + gsub(/[[:space:]]+/, "\n"); + if ($1 !~ /fly\.dev/) { + print + } + } + ' Caddyfile | sort | psub) \ + (fly certs list --json | fx @.hostname list | sort | psub) +) + +if set --query to_provision[1] + echo "Setup required for hostnames: $to_provision" + echo + + for name in $to_provision + if test -z (kdig +short TXT _fly-ownership.$name) + fly certs add $name + else + echo Add the hostname to DNS, then run + echo fly certs add $name + end + + echo + end +end