-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaddy.sh
executable file
·52 lines (44 loc) · 1.85 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
#!/bin/bash
#
# Copy to server
# bash caddy.sh latest
# bash caddy.sh branch-name
# bash caddy.sh sha
set -e
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}"
go_version=$(curl https://go.dev/VERSION?m=text | head -n1)
wget "https://dl.google.com/go/$go_version.linux-$arch.tar.gz"
rm -rf /usr/local/go
tar -C /usr/local -xzf ${go_version}.linux-$arch.tar.gz
rm ${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
./xcaddy build ${1:-latest} \
--with github.com/caddy-dns/alidns \
--with github.com/caddy-dns/azure \
--with github.com/caddy-dns/bunny \
--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/linode \
--with github.com/caddy-dns/namecheap \
--with github.com/caddy-dns/ovh \
--with github.com/caddy-dns/porkbun \
--with github.com/caddy-dns/route53 \
--with github.com/caddy-dns/scaleway \
--with github.com/caddy-dns/vultr \
--with github.com/caddy-dns/godaddy \
--with github.com/caddy-dns/googleclouddns \
--with github.com/Wafris/wafris-caddy
rm xcaddy