diff options
-rw-r--r-- | testing/traefik/APKBUILD | 64 | ||||
-rw-r--r-- | testing/traefik/traefik.confd | 6 | ||||
-rw-r--r-- | testing/traefik/traefik.initd | 16 | ||||
-rw-r--r-- | testing/traefik/traefik.pre-install | 6 | ||||
-rw-r--r-- | testing/traefik/traefik.toml | 38 |
5 files changed, 130 insertions, 0 deletions
diff --git a/testing/traefik/APKBUILD b/testing/traefik/APKBUILD new file mode 100644 index 0000000000..5287e87b6e --- /dev/null +++ b/testing/traefik/APKBUILD @@ -0,0 +1,64 @@ +# Contributor: Joe Holden <jwh@zorins.us> +# Maintainer: Joe Holden <jwh@zorins.us> +pkgname=traefik +pkgver=1.7.5 +pkgrel=0 +pkgdesc="The Cloud Native Edge Router" +url="https://traefik.io" +arch="all" +license="MIT" +makedepends="go go-bindata" +install="$pkgname.pre-install" +options="!check" # [no test files] +pkgusers="$pkgname" +pkggroups="$pkgname" +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://github.com/containous/traefik/archive/v$pkgver.tar.gz + traefik.initd + traefik.confd + traefik.toml" + +builddir="$srcdir/src/github.com/containous/$pkgname" + +prepare() { + default_prepare + mkdir -p "$srcdir/src/github.com/containous" + mv "$srcdir"/$pkgname-$pkgver "$builddir"/ +} + +build() { + cd "$builddir" + GOPATH="$srcdir" go generate + GOPATH="$srcdir" go build -v -o bin/$pkgname ./cmd/$pkgname +} + +check() { + cd "$builddir" + GOPATH="$srcdir" go test +} + +package() { + cd "$builddir" + + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname + + install -m750 -o $pkgname -g $pkgname \ + -D bin/$pkgname \ + "$pkgdir"/usr/sbin/$pkgname + + setcap cap_net_bind_service=+ep \ + "$pkgdir"/usr/sbin/$pkgname + + install -m750 -o $pkgname -g $pkgname -d "$pkgdir"/etc/$pkgname + install -m644 -o $pkgname -g $pkgname "$srcdir"/traefik.toml \ + "$pkgdir"/etc/$pkgname/$pkgname.toml + +} +sha512sums="05309a1c45edc8e86c6dffb5c7b61dd8d6ee7c089f4edc719b3a7e69dcf809b85734fa8b85ced45d89f787617b28a6da47728156e4b41d7f39f244d22954e329 traefik-1.7.5.tar.gz +2fe42052cdb035b202c7c0a1acd5cfe9ed1800ca067f2f5588d54e6ffbdd672d7c46cfd57fcfc219cadaa24d64a0e038a20d092eb1e4c04b67b8eb83c0af74fd traefik.initd +1519c2f446c4bc3af8407eb367a05e5ec0491f28d56d5385b12a550c84606d84e2424aadd5d72e56e628fd1da3f0f194ab3c077e6da85ead75a256f8e8069751 traefik.confd +140904e2358bc6dadbfb0f2c3cd83cd7aabeae1a54cd7424bbb50f941bde3273046c402352a2b888425ba74dda27d0a6e2197c2855b4fd6ad522eb9c4eaebd61 traefik.toml" diff --git a/testing/traefik/traefik.confd b/testing/traefik/traefik.confd new file mode 100644 index 0000000000..c9e20672aa --- /dev/null +++ b/testing/traefik/traefik.confd @@ -0,0 +1,6 @@ +# Options that are appended unconditionally +traefik_opts="--configFile=/etc/traefik/traefik.toml" + +# Examples +CLOUDFLARE_EMAIL= +CLOUDFLARE_API_KEY= diff --git a/testing/traefik/traefik.initd b/testing/traefik/traefik.initd new file mode 100644 index 0000000000..f0e8d8f05a --- /dev/null +++ b/testing/traefik/traefik.initd @@ -0,0 +1,16 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon + +name=Traefik +description="Traefik - a modern reverse proxy" + +command=/usr/sbin/traefik +command_args="${traefik_opts}" +command_user="traefik:traefik" +pidfile=/run/${RC_SVCNAME}.pid + +healthcheck_timer=60 + +healthcheck() { + $command healthcheck >/dev/null +} diff --git a/testing/traefik/traefik.pre-install b/testing/traefik/traefik.pre-install new file mode 100644 index 0000000000..fedbdf6067 --- /dev/null +++ b/testing/traefik/traefik.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S traefik 2>/dev/null +adduser -S -D -h /var/empty -s /sbin/nologin -G traefik -g traefik traefik 2>/dev/null + +exit 0 diff --git a/testing/traefik/traefik.toml b/testing/traefik/traefik.toml new file mode 100644 index 0000000000..daadba0af9 --- /dev/null +++ b/testing/traefik/traefik.toml @@ -0,0 +1,38 @@ +debug = false + +defaultEntryPoints = ["http", "https"] + +[entryPoints] + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + entryPoint = "https" + [entryPoints.https] + address = ":443" + [entryPoints.https.tls] + +[api] + +[ping] + +#[consul] +# endpoint = "" +# watch = true + +#[consulCatalog] +# endpoint = "" +# domain = "" + +#[acme] +# email = "" +# storage = "traefik/acme/account" +# entryPoint = "https" +# onDemand = true +# onHostRule = true +# acmeLogging = true +# [acme.dnsChallenge] +# provider = "cloudflare" +# delayBeforeCheck = 10 + +[rest] + entryPoint = "traefik" |