diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2021-01-29 13:35:49 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2021-01-29 13:35:49 +0000 |
commit | f6f36be196f3be50b6b320cb7099a54ed73f90a4 (patch) | |
tree | 32c477293905b4d165710c70fec4c5e1a0b8c363 /www/web2ldap/files | |
parent | databases/pspg: Update to 4.1.0 (diff) |
- Resurrect and update to version 1.5.112
- Actualize dependencies and pkg-message
Diffstat (limited to 'www/web2ldap/files')
-rw-r--r-- | www/web2ldap/files/patch-web2ldap_app_core.py | 29 | ||||
-rw-r--r-- | www/web2ldap/files/pkg-message.in | 21 | ||||
-rw-r--r-- | www/web2ldap/files/web2ldap.in | 40 |
3 files changed, 90 insertions, 0 deletions
diff --git a/www/web2ldap/files/patch-web2ldap_app_core.py b/www/web2ldap/files/patch-web2ldap_app_core.py new file mode 100644 index 000000000000..128dc349ed74 --- /dev/null +++ b/www/web2ldap/files/patch-web2ldap_app_core.py @@ -0,0 +1,29 @@ +--- web2ldap/app/core.py.orig 2020-05-04 11:51:59 UTC ++++ web2ldap/app/core.py +@@ -19,12 +19,6 @@ import time + import web2ldap.__about__ + from web2ldap.log import logger + +-# prefixes considered to indicate system-wide installation outside a venv +-OS_SYS_PREFIXES = { +- '/usr', +- '/usr/local', +-} +- + logger.info('Starting web2ldap %s', web2ldap.__about__.__version__) + # this has to be done before import module package ldap0 + os.environ['LDAPNOINIT'] = '1' +@@ -39,11 +33,9 @@ check_inst() + if 'WEB2LDAP_HOME' in os.environ: + # env var points to web2ldap root directory + etc_dir = os.path.join(os.environ['WEB2LDAP_HOME'], 'etc', 'web2ldap') +-elif os.name == 'posix' and sys.prefix in OS_SYS_PREFIXES: +- # assume OS-wide installation on POSIX platform (Linux, BSD, etc.) +- etc_dir = '/etc/web2ldap' + else: +- # virtual env ++ # assume OS-wide installation on POSIX platform (Linux, BSD, etc.) ++ # or virtual env + etc_dir = os.path.join(sys.prefix, 'etc', 'web2ldap') + + # Default directory for [web2ldap]/etc/web2ldap/templates diff --git a/www/web2ldap/files/pkg-message.in b/www/web2ldap/files/pkg-message.in new file mode 100644 index 000000000000..85a83325de91 --- /dev/null +++ b/www/web2ldap/files/pkg-message.in @@ -0,0 +1,21 @@ +[ +{ type: install + message: <<EOM +Run: + + service web2ldap onestart + +to start the standalone version of web2ldap. By default it only accepts +connections from localhost, this can be changed by editing configuration +option ``access_allowed'' in the file: + + %%ETCDIR%%/web2ldapcnf/__init__.py + +For configuration suggestions on installing the WSGI version of web2ldap using +apache *instead of the standalone version*, please look at the enclosed +documentation in: + + https://fossies.org/linux/web2ldap/etc/apache2/sample-mod_wsgi.conf +EOM +} +] diff --git a/www/web2ldap/files/web2ldap.in b/www/web2ldap/files/web2ldap.in new file mode 100644 index 000000000000..6c2f06237475 --- /dev/null +++ b/www/web2ldap/files/web2ldap.in @@ -0,0 +1,40 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: web2ldap +# REQUIRE: DAEMON NETWORKING +# BEFORE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable web2ldap: +# web2ldap_enable="NO" +# +# web2ldap_enable (bool): Set to YES to enable web2ldap +# Default: NO +# web2ldap_user (str): web2ldap daemon user +# Default: nobody +# web2ldap_group (str): web2ldap daemon group +# Default: nogroup +. /etc/rc.subr + +name="web2ldap" +rcvar=web2ldap_enable + +: ${web2ldap_enable:="NO"} +: ${web2ldap_user:="nobody"} +: ${web2ldap_group:="nogroup"} + +# daemon +pidfile="/var/run/${name}.pid" +command=/usr/sbin/daemon +procname="daemon" +command_args=" -c -f -P ${pidfile} %%PREFIX%%/bin/${name}" +start_precmd="web2ldap_precmd" + +web2ldap_precmd() +{ + install -o ${web2ldap_user} /dev/null ${pidfile} +} + +load_rc_config $name +run_rc_command "$1" |