From fe3b441727e6a985c1afd7a3d545b2330ebe0470 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Wed, 2 Nov 2016 17:31:29 +0300 Subject: [PATCH 1/2] Added systemd service file for nginx-ldap-auth-daemon. This service file assumes nginx-ldap-auth-daemon.py was installed to /usr/bin under the name of nginx-ldap-auth-daemon. --- nginx-ldap-auth.service | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nginx-ldap-auth.service diff --git a/nginx-ldap-auth.service b/nginx-ldap-auth.service new file mode 100644 index 0000000..04bd838 --- /dev/null +++ b/nginx-ldap-auth.service @@ -0,0 +1,17 @@ +[Unit] +Description=LDAP authentication helper for Nginx +After=network.target network-online.target + +[Service] +Type=simple +User=nobody +Group=nobody +WorkingDirectory=/var/run +PIDFile=/run/nginx-ldap-auth/nginx-ldap-auth.pid +ExecStart=/usr/bin/nginx-ldap-auth-daemon +KillMode=process +KillSignal=SIGINT +Restart=on-failure + +[Install] +WantedBy=multi-user.target From 6cd01885aa71f503bd6aae91f3e0b8e0a4d1c0ef Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Wed, 2 Nov 2016 17:37:28 +0300 Subject: [PATCH 2/2] Added RPM spec file. --- rpm/nginx-ldap-auth.spec | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 rpm/nginx-ldap-auth.spec diff --git a/rpm/nginx-ldap-auth.spec b/rpm/nginx-ldap-auth.spec new file mode 100644 index 0000000..65a2279 --- /dev/null +++ b/rpm/nginx-ldap-auth.spec @@ -0,0 +1,45 @@ +Name: nginx-ldap-auth +Version: 0.0.3 +Release: 1%{?dist} +Summary: NGINX Plus LDAP authentication daemon + +Group: System Environment/Daemons +License: 2-clause BSD-like license +URL: https://github.com/nginxinc/nginx-ldap-auth +Source0: nginx-ldap-auth-release-%{version}.tar.gz + +BuildRequires: systemd +Requires: systemd +Requires: python-ldap + +%description +Reference implementation of method for authenticating users on behalf of +servers proxied by NGINX or NGINX Plus. + +%prep +%setup -q + +%install +mkdir -p %buildroot%_bindir +install -m755 nginx-ldap-auth-daemon.py %buildroot%_bindir/nginx-ldap-auth-daemon +mkdir -p %buildroot%_unitdir +install -m644 nginx-ldap-auth.service %buildroot%_unitdir/ + +%files +%doc README.md nginx-ldap-auth.conf backend-sample-app.py LICENSE +%_bindir/nginx-ldap-auth-daemon +%_unitdir/nginx-ldap-auth.service + +%post +/usr/bin/systemctl preset nginx-ldap-auth.service + +%preun +/usr/bin/systemctl --no-reload disable nginx-ldap-auth.service >/dev/null 2>&1 ||: +/usr/bin/systemctl stop nginx-ldap-auth.service >/dev/null 2>&1 ||: + +%postun +/usr/bin/systemctl daemon-reload >/dev/null 2>&1 ||: + +%changelog +* Wed Nov 02 2016 Konstantin Pavlov 0.0.3-1 +- Initial release