Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
a0398cdc95
|
|||
414a8c256f
|
|||
8624bceba7
|
|||
039dae5bea
|
|||
9c295b812c
|
|||
835b3a6812
|
|||
b83e626832
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
/bin
|
||||
/cadmium
|
||||
/source
|
||||
/gopath
|
||||
/plugins.txt
|
||||
|
@@ -5,14 +5,18 @@ build:
|
||||
variables:
|
||||
CADDY_TAG: $CI_COMMIT_TAG
|
||||
script:
|
||||
- apt-get -yy update && apt-get -yy install patch
|
||||
- go get github.com/mitchellh/gox
|
||||
- scripts/download "$(dirname $CI_PROJECT_URL)/caddy/-/archive/${CADDY_TAG}/caddy-${CADDY_TAG}.tar.gz"
|
||||
- mkdir -p "$GOPATH/src/github.com/mholt"
|
||||
- ln -s "$(pwd)/source" "$GOPATH/src/github.com/mholt/caddy"
|
||||
- scripts/build ${CADDY_TAG}
|
||||
- ./bin/cadmium.linux_amd64 -plugins | tee plugins.txt
|
||||
artifacts:
|
||||
paths:
|
||||
- cadmium
|
||||
- source
|
||||
- bin
|
||||
- gopath
|
||||
- plugins.txt
|
||||
only:
|
||||
- tags
|
||||
- api
|
||||
|
50
patches/plugins.go
Normal file
50
patches/plugins.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package caddymain
|
||||
|
||||
import (
|
||||
// Directives / Middleware
|
||||
_ "github.com/linkonoid/caddy-dyndns"
|
||||
_ "github.com/casbin/caddy-authz"
|
||||
_ "github.com/miquella/caddy-awses"
|
||||
_ "github.com/coopernurse/caddy-awslambda"
|
||||
_ "github.com/nicolasazrak/caddy-cache"
|
||||
_ "github.com/jung-kurt/caddy-cgi"
|
||||
_ "github.com/captncraig/cors"
|
||||
_ "github.com/payintech/caddy-datadog"
|
||||
_ "github.com/epicagency/caddy-expires"
|
||||
_ "github.com/filebrowser/filebrowser/caddy/filemanager"
|
||||
_ "github.com/echocat/caddy-filter"
|
||||
_ "github.com/caddyserver/forwardproxy"
|
||||
_ "github.com/kodnaplakal/caddy-geoip"
|
||||
_ "github.com/abiosoft/caddy-git"
|
||||
_ "github.com/zikes/gopkg"
|
||||
_ "github.com/pieterlouw/caddy-grpc"
|
||||
_ "github.com/filebrowser/filebrowser/caddy/hugo"
|
||||
_ "github.com/pyed/ipfilter"
|
||||
_ "github.com/filebrowser/filebrowser/caddy/jekyll"
|
||||
_ "github.com/BTBurke/caddy-jwt"
|
||||
_ "github.com/simia-tech/caddy-locale"
|
||||
_ "github.com/tarent/loginsrv/caddy"
|
||||
_ "github.com/SchumacherFM/mailout"
|
||||
_ "github.com/hacdias/caddy-minify"
|
||||
_ "github.com/Xumeiquer/nobots"
|
||||
_ "github.com/miekg/caddy-prometheus"
|
||||
_ "github.com/mastercactapus/caddy-proxyprotocol"
|
||||
_ "github.com/xuqingfeng/caddy-rate-limit"
|
||||
_ "github.com/captncraig/caddy-realip"
|
||||
_ "github.com/freman/caddy-reauth"
|
||||
// TODO: _ "github.com/restic/caddy" fails to build
|
||||
_ "blitznote.com/src/caddy.upload"
|
||||
_ "github.com/hacdias/caddy-webdav"
|
||||
|
||||
// DNS providers (TODO)
|
||||
|
||||
// Caddyfile loaders
|
||||
_ "github.com/lucaslorentz/caddy-docker-proxy/plugin"
|
||||
|
||||
// Server types
|
||||
// TODO: DNS. Should be CoreDNS: https://github.com/coredns/coredns
|
||||
_ "github.com/pieterlouw/caddy-net/caddynet"
|
||||
|
||||
// Event hooks
|
||||
_ "github.com/hacdias/caddy-service"
|
||||
)
|
@@ -8,8 +8,11 @@ fi
|
||||
echo "Building Cadmium $1..."
|
||||
|
||||
cm="github.com/mholt/caddy/caddy/caddymain"
|
||||
go build \
|
||||
-o cadmium \
|
||||
|
||||
CGO_ENABLED=0 GOPATH="$(pwd)/gopath" gox \
|
||||
-verbose \
|
||||
-output "bin/cadmium.{{.OS}}_{{.Arch}}" \
|
||||
-os "!netbsd" \
|
||||
-ldflags "-X \"$cm.gitTag=$1\" -X \"$cm.gitNearestTag=$1\"" \
|
||||
github.com/mholt/caddy/caddy
|
||||
|
||||
|
@@ -1,24 +1,78 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "x$1" = "x" ]; then
|
||||
echo "Usage: $0 <Tarball URL>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e "source" ]; then
|
||||
echo "source/ directory already exists, remove it first"
|
||||
if [ -e "gopath" ]; then
|
||||
echo "gopath/ directory already exists, remove it first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -L "$1" | tar -xzf -
|
||||
mv caddy* source
|
||||
go_get() {
|
||||
GOPATH="$(pwd)/gopath" go get -v "$@"
|
||||
}
|
||||
|
||||
mkdir -p gopath/src/github.com/mholt/caddy
|
||||
curl -L "$1" | tar --strip-components=1 -C gopath/src/github.com/mholt/caddy -xzf -
|
||||
|
||||
# Disable telemetry in run.go and rename to Cadmium
|
||||
patch -d source -p1 <"$(pwd)/patches/run.go.diff"
|
||||
patch -d gopath/src/github.com/mholt/caddy -p1 <"$(pwd)/patches/run.go.diff"
|
||||
|
||||
# Replace telemetry with a stub
|
||||
rm -r source/telemetry
|
||||
mkdir source/telemetry
|
||||
cp patches/collection.go source/telemetry/collection.go
|
||||
rm -r gopath/src/github.com/mholt/caddy/telemetry
|
||||
mkdir gopath/src/github.com/mholt/caddy/telemetry
|
||||
cp patches/collection.go gopath/src/github.com/mholt/caddy/telemetry/collection.go
|
||||
cp patches/plugins.go gopath/src/github.com/mholt/caddy/caddy/caddymain/plugins.go
|
||||
|
||||
## Now download all the plugins ##
|
||||
|
||||
# Directives / Middleware
|
||||
go_get github.com/linkonoid/caddy-dyndns
|
||||
go_get github.com/casbin/caddy-authz
|
||||
go_get github.com/miquella/caddy-awses
|
||||
go_get github.com/coopernurse/caddy-awslambda
|
||||
go_get github.com/nicolasazrak/caddy-cache
|
||||
go_get github.com/jung-kurt/caddy-cgi
|
||||
go_get github.com/captncraig/cors
|
||||
go_get github.com/payintech/caddy-datadog
|
||||
go_get github.com/epicagency/caddy-expires
|
||||
go_get github.com/filebrowser/filebrowser/caddy/filemanager
|
||||
go_get github.com/echocat/caddy-filter
|
||||
go_get github.com/caddyserver/forwardproxy
|
||||
go_get github.com/kodnaplakal/caddy-geoip
|
||||
go_get github.com/abiosoft/caddy-git
|
||||
go_get github.com/zikes/gopkg
|
||||
go_get github.com/pieterlouw/caddy-grpc
|
||||
go_get github.com/filebrowser/filebrowser/caddy/hugo
|
||||
go_get github.com/pyed/ipfilter
|
||||
go_get github.com/filebrowser/filebrowser/caddy/jekyll
|
||||
go_get github.com/BTBurke/caddy-jwt
|
||||
go_get github.com/simia-tech/caddy-locale
|
||||
go_get github.com/tarent/loginsrv/caddy
|
||||
go_get github.com/SchumacherFM/mailout
|
||||
go_get github.com/hacdias/caddy-minify
|
||||
go_get github.com/Xumeiquer/nobots
|
||||
go_get github.com/miekg/caddy-prometheus
|
||||
go_get github.com/mastercactapus/caddy-proxyprotocol
|
||||
go_get github.com/xuqingfeng/caddy-rate-limit
|
||||
go_get github.com/captncraig/caddy-realip
|
||||
go_get github.com/freman/caddy-reauth
|
||||
# TODO: go_get github.com/restic/caddy fails to build
|
||||
go_get blitznote.com/src/caddy.upload
|
||||
go_get github.com/hacdias/caddy-webdav
|
||||
|
||||
# DNS providers (TODO)
|
||||
|
||||
# Caddyfile loaders
|
||||
go_get github.com/lucaslorentz/caddy-docker-proxy/plugin
|
||||
|
||||
# Server types
|
||||
# TODO: DNS. Should be CoreDNS: https://github.com/coredns/coredns
|
||||
go_get github.com/pieterlouw/caddy-net/caddynet
|
||||
|
||||
# Event hooks
|
||||
go_get github.com/hacdias/caddy-service
|
||||
|
Reference in New Issue
Block a user