diff options
author | Kurt Jaeger <pi@FreeBSD.org> | 2020-03-21 12:54:54 +0000 |
---|---|---|
committer | Kurt Jaeger <pi@FreeBSD.org> | 2020-03-21 12:54:54 +0000 |
commit | 5aaf1f97cfcb9d33e4b67e6c0f64033fed50281d (patch) | |
tree | 0d1a177a225281d42f49a90e3fa13f27e003a606 /net/traefik2/files/traefik.in | |
parent | converters/pdf2djvu: update to 0.9.17 (diff) |
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>
Diffstat (limited to 'net/traefik2/files/traefik.in')
-rw-r--r-- | net/traefik2/files/traefik.in | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/net/traefik2/files/traefik.in b/net/traefik2/files/traefik.in new file mode 100644 index 000000000000..c27eb6a04d4d --- /dev/null +++ b/net/traefik2/files/traefik.in @@ -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" |