Glauth
This commit is contained in:
parent
87eebbf509
commit
13af0da212
5 changed files with 97 additions and 0 deletions
33
security/glauth/Makefile
Normal file
33
security/glauth/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
PORTNAME= glauth
|
||||||
|
DISTVERSION= HEAD
|
||||||
|
PORTREVISION= 0
|
||||||
|
CATEGORIES= security
|
||||||
|
MASTER_SITES= https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/${DISTVERSIONFULL}/v2/:gomod
|
||||||
|
DISTFILES= go.mod:gomod
|
||||||
|
|
||||||
|
MAINTAINER= amigan@gmail.com
|
||||||
|
COMMENT= Simple LDAP server for developers
|
||||||
|
WWW= https://github.com/glauth/glauth
|
||||||
|
|
||||||
|
LICENSE= MIT
|
||||||
|
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||||
|
|
||||||
|
USES= go:modules
|
||||||
|
USE_GITHUB= yes
|
||||||
|
GH_ACCOUNT= glauth
|
||||||
|
USE_RC_SUBR= glauth
|
||||||
|
|
||||||
|
GO_MODULE= github.com/${GH_ACCOUNT}/${GH_PROJECT}
|
||||||
|
GO_TARGET= glauth.go:${PREFIX}/sbin/${PORTNAME}
|
||||||
|
|
||||||
|
post-extract:
|
||||||
|
mv ${WRKSRC}/v2 ${WRKSRC}old/
|
||||||
|
mv ${WRKSRC} ${WRKSRC}garbage
|
||||||
|
mv ${WRKSRC}old ${WRKSRC}
|
||||||
|
mv ${WRKSRC}garbage/LICENSE ${WRKSRC}
|
||||||
|
|
||||||
|
post-install:
|
||||||
|
${INSTALL_DATA} ${WRKSRC}/sample-simple.cfg ${STAGEDIR}${PREFIX}/etc/glauth-config.cfg.sample
|
||||||
|
|
||||||
|
.include <bsd.port.mk>
|
||||||
|
|
5
security/glauth/distinfo
Normal file
5
security/glauth/distinfo
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
TIMESTAMP = 1700110994
|
||||||
|
SHA256 (go/security_glauth/glauth-glauth-HEAD_GH0/go.mod) = d9cbe3c1fc7caee8a1d8a0bc64f912e19bc3102a9ebbde08e736bf6c5bd9ce11
|
||||||
|
SIZE (go/security_glauth/glauth-glauth-HEAD_GH0/go.mod) = 1691
|
||||||
|
SHA256 (go/security_glauth/glauth-glauth-HEAD_GH0/glauth-glauth-HEAD_GH0.tar.gz) = 4aab6038f460f20602fc176901381c49f60a71b13541209341880d40b7065bf6
|
||||||
|
SIZE (go/security_glauth/glauth-glauth-HEAD_GH0/glauth-glauth-HEAD_GH0.tar.gz) = 292889
|
54
security/glauth/files/glauth.in
Normal file
54
security/glauth/files/glauth.in
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# PROVIDE: glauth
|
||||||
|
# REQUIRE: DAEMON NETWORKING
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
#
|
||||||
|
# Add the following to /etc/rc.conf[.local] to enable this service
|
||||||
|
#
|
||||||
|
# glauth_enable (bool): Set to NO by default.
|
||||||
|
# Set it to YES to enable glauth.
|
||||||
|
# glauth_config (str): Set to /usr/local/etc/glauth-config.yml by default.
|
||||||
|
# Set it to a path to use that config file.
|
||||||
|
# glauth_user (str): Services run as root by default. Set to a user name
|
||||||
|
# to run glauth as that user. Note: non-root users
|
||||||
|
# might need permission to bind to ports.
|
||||||
|
# glauth_group (str): Set to the user's primary group by default.
|
||||||
|
# Set it to a group name for daemon file ownership.
|
||||||
|
# glauth_flags (str): Enter extra flags to append to the glauth command.
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name=glauth
|
||||||
|
rcvar=glauth_enable
|
||||||
|
|
||||||
|
load_rc_config ${name}
|
||||||
|
|
||||||
|
: ${glauth_enable:=NO}
|
||||||
|
: ${glauth_config:="%%PREFIX%%/etc/glauth-config.yml"}
|
||||||
|
: ${glauth_group:=}
|
||||||
|
: ${glauth_flags:=}
|
||||||
|
|
||||||
|
if [ -n "${glauth_user}" ] && [ -z "${glauth_group}" ]; then
|
||||||
|
# Detect the daemon user's primary group
|
||||||
|
glauth_group=$(id -gn "${glauth_user}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
pidfile="/var/run/${name}.pid"
|
||||||
|
glauth_path="%%PREFIX%%/sbin/glauth"
|
||||||
|
|
||||||
|
command="/usr/sbin/daemon"
|
||||||
|
procname="/usr/local/sbin/glauth"
|
||||||
|
command_args="-c -f -p ${pidfile} ${glauth_path} \
|
||||||
|
-c ${glauth_config} ${glauth_flags}"
|
||||||
|
|
||||||
|
start_precmd="glauth_precmd"
|
||||||
|
|
||||||
|
# Sets up a pidfile the daemon user can access
|
||||||
|
glauth_precmd()
|
||||||
|
{
|
||||||
|
install -o "${glauth_user:-root}" -g "${glauth_group:-wheel}" \
|
||||||
|
-m 0600 /dev/null "${pidfile}"
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
2
security/glauth/pkg-descr
Normal file
2
security/glauth/pkg-descr
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Fast and lightweight DNS proxy as ad-blocker for local
|
||||||
|
network with many features.
|
3
security/glauth/pkg-plist
Normal file
3
security/glauth/pkg-plist
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
@sample etc/glauth-config.cfg.sample
|
||||||
|
etc/rc.d/glauth
|
||||||
|
sbin/glauth
|
Loading…
Reference in a new issue