Skip to content

Commit

Permalink
www/authelia: Add the rc script
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.freebsd.org/ports/head@569006 35697150-7ecd-e111-bb59-0022644237b5
  • Loading branch information
yuri committed Mar 23, 2021
1 parent ce255cf commit d8e6623
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
6 changes: 5 additions & 1 deletion www/authelia/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PORTNAME= authelia
DISTVERSIONPREFIX= v
DISTVERSION= 4.27.2
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= www
MASTER_SITES= https://github.com/authelia/authelia/releases/download/v${DISTVERSION}/:public_html
DISTFILES= authelia-public_html${EXTRACT_SUFX}:public_html # html root directory needs to be built in a special way
Expand Down Expand Up @@ -87,6 +87,10 @@ GH_TUPLE= \
valyala:fasthttp:v1.22.0:valyala_fasthttp/vendor/github.com/valyala/fasthttp
GO_TARGET= ./cmd/${PORTNAME}

USER= root # 'nobody' doesn't work well because authelia attempts to remove files, etc.
SUB_LIST= USER=${USER}
USE_RC_SUBR= ${PORTNAME}

post-extract: # extract -public-html
@${RM} -r ${WRKSRC}/internal/server/public_html
@${MV} ${WRKDIR}/public_html ${WRKSRC}/internal/server
Expand Down
27 changes: 27 additions & 0 deletions www/authelia/files/authelia.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: authelia
# REQUIRE: DAEMON NETWORKING
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable authelia:
# authelia_enable : set to "YES" to enable the daemon, default is "NO"

. /etc/rc.subr

name=authelia
rcvar=authelia_enable

load_rc_config $name

authelia_enable=${authelia_enable:-"NO"}

logfile="/var/log/${name}.log"

procname=%%PREFIX%%/bin/authelia
command="/usr/sbin/daemon"
command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/authelia --config %%PREFIX%%/etc/authelia.yml"

run_rc_command "$1"

0 comments on commit d8e6623

Please sign in to comment.