-
Notifications
You must be signed in to change notification settings - Fork 0
/
caddy.sh
executable file
·55 lines (46 loc) · 2.1 KB
/
caddy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# Copy to server
# bash caddy.sh latest
# bash caddy.sh branch-name
# bash caddy.sh sha
set -e
go_version="${GOLANG_VERSION:-1.22.3}"
arch=$(dpkg --print-architecture)
tag=$(curl -H "Accept: application/json" -sL 'https://github.com/caddyserver/xcaddy/releases/latest' | python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
version="${tag:1}"
wget https://go.dev/dl/go${go_version}.linux-$arch.tar.gz
rm -rf /usr/local/go
tar -C /usr/local -xzf go${go_version}.linux-$arch.tar.gz
rm go${go_version}.linux-$arch.tar.gz
export PATH=$PATH:/usr/local/go/bin
wget https://github.com/caddyserver/xcaddy/releases/download/${tag}/xcaddy_${version}_linux_$arch.tar.gz
tar -xvf xcaddy_${version}_linux_$arch.tar.gz
rm xcaddy_${version}_linux_$arch.tar.gz
# Godaddy fails to compile if it's listed in alphabetical order
# panic: internal error: can't find reason for requirement on google.golang.org/[email protected]
# panic: internal error: can't find reason for requirement on google.golang.org/pprof
# DNS packages that don't currently work:
# # github.com/libdns/netlify
# /root/go/pkg/mod/github.com/libdns/[email protected]/models.go:25:13: cannot use int(r.Priority) (value of type int) as uint value in struct literal
# github.com/libdns/porkbun
# /root/go/pkg/mod/github.com/libdns/[email protected]/models.go:51:13: cannot use priority (variable of type int) as uint value in struct literal
./xcaddy build ${1:-latest} \
--with github.com/caddy-dns/alidns \
--with github.com/caddy-dns/azure \
--with github.com/caddy-dns/cloudflare \
--with github.com/caddy-dns/digitalocean \
--with github.com/caddy-dns/dnsimple \
--with github.com/caddy-dns/dnspod \
--with github.com/caddy-dns/duckdns \
--with github.com/caddy-dns/gandi \
--with github.com/caddy-dns/hetzner \
--with github.com/caddy-dns/namecheap \
--with github.com/caddy-dns/ovh \
--with github.com/caddy-dns/route53 \
--with github.com/caddy-dns/scaleway \
--with github.com/caddy-dns/vercel \
--with github.com/caddy-dns/vultr \
--with github.com/caddy-dns/godaddy \
--with github.com/caddy-dns/googleclouddns
rm xcaddy