New port: net/traefik2 High availability reverse proxy and load balancer 2.x

Traefik (pronounced like traffic) is a modern HTTP reverse proxy and load
balancer made to deploy microservices with ease. It supports several backends
(Docker, Swarm mode, Kubernetes, Marathon, Consul, Etcd, Rancher, Amazon ECS,
and a lot more) to manage its configuration automatically and dynamically.

WWW: https://traefik.io/

PR:		244913
Submitted by:	Christopher Beppler <freebsd@funzi.org>
This commit is contained in:
Kurt Jaeger 2020-03-21 12:54:54 +00:00
parent cc06b3172e
commit 5aaf1f97cf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=528852
6 changed files with 129 additions and 0 deletions

View file

@ -1469,6 +1469,7 @@
SUBDIR += toonel
SUBDIR += torsocks
SUBDIR += traefik
SUBDIR += traefik2
SUBDIR += traff
SUBDIR += trafshow
SUBDIR += trafshow3

45
net/traefik2/Makefile Normal file
View file

@ -0,0 +1,45 @@
# $FreeBSD$
PORTNAME= traefik2
DISTVERSIONPREFIX= v
DISTVERSION= 2.1.8
DISTVERSIONSUFFIX= -vendor
CATEGORIES= net
MAINTAINER= freebsd@funzi.org
COMMENT= High availability reverse proxy and load balancer
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE.md
USES= go:modules
USE_GITHUB= yes
GH_ACCOUNT= Funzinator
GH_PROJECT= traefik
GH_SUBDIR= src/github.com/containous/traefik
USE_RC_SUBR= traefik
GO_BUILDFLAGS= -ldflags "-s -w \
-X github.com/containous/traefik/version.Version=${DISTVERSION} \
-X github.com/containous/traefik/version.BuildDate=`date -u '+%Y-%m-%d_%I:%M:%S%p'`"
GO_TARGET= ./cmd/traefik
CGO_ENABLED= 0
USERS= traefik
GROUPS= traefik
PLIST_FILES= bin/traefik \
"@sample etc/traefik.toml.sample"
post-patch:
# Install a sample configuration file which works by default
# without manual tweaking
${REINPLACE_CMD} -e 's|:80|:8088|' -e 's|:443|:8443|' \
-e 's|\[docker|# \[docker|' ${WRKSRC}/traefik.sample.toml
post-install:
${INSTALL_DATA} ${WRKSRC}/traefik.sample.toml ${STAGEDIR}${PREFIX}/etc/traefik.toml.sample
.include <bsd.port.mk>

3
net/traefik2/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1584705603
SHA256 (Funzinator-traefik-v2.1.8-vendor_GH0.tar.gz) = b18397fbec5fd1948a3ecf3b111b25ca2712683298792ed2aebd4cfbfe5c21ab
SIZE (Funzinator-traefik-v2.1.8-vendor_GH0.tar.gz) = 19161792

View file

@ -0,0 +1,53 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: traefik
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# traefik_enable (bool): Set to NO by default.
# Set it to YES to enable traefik.
# traefik_user (user): Set user to run traefik.
# Default is "traefik".
# traefik_group (group): Set group to run traefik.
# Default is "traefik".
# traefik_conf (path): Path to traefik configuration file.
# Default is %%PREFIX%%/etc/traefik.toml
# traefik_env (vars): Set environment variables used with traefik
# Default is "".
# These are necessary for ACME (Let's Encrypt)
# configuration, see
# https://docs.traefik.io/configuration/acme/
. /etc/rc.subr
name=traefik
rcvar=traefik_enable
load_rc_config $name
: ${traefik_enable:="NO"}
: ${traefik_user:="traefik"}
: ${traefik_group:="traefik"}
: ${traefik_conf:="%%PREFIX%%/etc/traefik.toml"}
: ${traefik_env:=""}
pidfile=/var/run/traefik.pid
procname="%%PREFIX%%/bin/traefik"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} /usr/bin/env ${traefik_env} ${procname} --configFile=${traefik_conf} ${traefik_args}"
start_precmd=traefik_startprecmd
traefik_startprecmd()
{
if [ ! -e ${pidfile} ]; then
install -o ${traefik_user} -g ${traefik_group} /dev/null ${pidfile};
fi
}
run_rc_command "$1"

6
net/traefik2/pkg-descr Normal file
View file

@ -0,0 +1,6 @@
Traefik (pronounced like traffic) is a modern HTTP reverse proxy and load
balancer made to deploy microservices with ease. It supports several backends
(Docker, Swarm mode, Kubernetes, Marathon, Consul, Etcd, Rancher, Amazon ECS,
and a lot more) to manage its configuration automatically and dynamically.
WWW: https://traefik.io/

21
net/traefik2/pkg-message Normal file
View file

@ -0,0 +1,21 @@
[
{ type: install
message: <<EOM
Note that traefik starts as unprivileged user. Thus, it cannot
bind to privileged ports (by default, ports below 1024) and
will exit when configured to do so.
If traefik should serve ports in the privileged range, there
are options to achieve this:
- Have traffic bind to an unprivileged port and use the
packet filter configuration to redirect requests to the
desired privileged port to the unprivileged port in
traefik's configuration file e.g. the rdr rules in pf(4).
- The mac_portacl kernel module allows unprivileged processes
to bind to privileged ports.
Note: If you are upgrading from traefik 1.x keep in mind that
the configuration is not compatible.
EOM
}
]