Commit 9f7537ef authored by Vladimir Homutov's avatar Vladimir Homutov Committed by GitHub
Browse files

Merge pull request #12 from oxpa/master

cli options for the daemon and basic debian packaging
parents 3873fab8 f824aee3
Loading
Loading
Loading
Loading

debian/changelog

0 → 100644
+5 −0
Original line number Diff line number Diff line
nginx-ldap-auth (0.0.3-1) UNRELEASED; urgency=low

  * Initial release

 -- Ippolitov Igor <iippolitov@nginx.com>  Wed, 02 Nov 2016 14:32:15 +0300

debian/compat

0 → 100644
+1 −0
Original line number Diff line number Diff line
9
 No newline at end of file

debian/control

0 → 100644
+14 −0
Original line number Diff line number Diff line
Source: nginx-ldap-auth
Maintainer: Ippolitov Igor <iippolitov@nginx.com>
Section: misc
Priority: optional
Standards-Version: 3.9.7
Build-Depends: debhelper (>= 9), dh-systemd, python, dh-python, dh-exec

Package: nginx-ldap-auth
Architecture: all
Depends:  systemd, python(>=2.6), python-ldap, python-argparse
Description: a reference implementation of an authentication helper for Nginx
 This is a reference implementation of an authentication helper for Nginx. 
 It listens for incoming requests and uses parameters from headers
 to bind to a remote LDAP directory and try authenticating a person.

debian/copyright

0 → 100644
+0 −0

Empty file added.

+80 −0
Original line number Diff line number Diff line
#! /bin/sh
### BEGIN INIT INFO
# Provides:		nginx-ldap-auth
# Required-Start:	$syslog $remote_fs
# Required-Stop:	$syslog $remote_fs
# Should-Start:		$local_fs
# Should-Stop:		$local_fs
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Short-Description:	nginx-ldap-auth - nginx helper for LDAP authentication
# Description:		nginx-ldap-auth - nginx helper for LDAP authentication
### END INIT INFO


DAEMON=/usr/bin/nginx-ldap-auth-daemon
NAME=nginx-ldap-auth

test -x $DAEMON || exit 0

if [ -r /etc/default/$NAME ]
then
	. /etc/default/$NAME
fi

. /lib/lsb/init-functions

set -e

case "$1" in
  start)
	echo -n "Starting $DESC: "
	mkdir -p $RUNDIR
	touch $PIDFILE
	chown $USER:$GROUP $RUNDIR $PIDFILE
	chmod 755 $RUNDIR

	if [ -n "$ULIMIT" ]
	then
		ulimit -n $ULIMIT
	fi

    SSDOPTS="--quiet --oknodo --background --no-close --make-pidfile --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON"
    DAEMON_ARGS="$URL $BASE $BIND_DN $BIND_PASS $COOKIE $FILTER $REALM"
    
	if start-stop-daemon --start $SSDOPTS -- $DAEMON_ARGS &>$LOG 
	then
		echo "$NAME."
	else
		echo "failed"
	fi
	;;
  stop)
	echo -n "Stopping $DESC: "


	if start-stop-daemon --stop --retry forever/TERM/1 --quiet --oknodo --remove-pidfile --pidfile $PIDFILE --exec $DAEMON
	then
		echo "$NAME."
	else
		echo "failed"
	fi
	sleep 1
	;;

  restart|force-reload)
	${0} stop
	${0} start
	;;

  status)
	status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME}
	;;

  *)
	echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
	exit 1
	;;
esac

exit 0
Loading