Skip to content

Commit 3873fab

Browse files
authored
Merge pull request #11 from thresheek/master
Added systemd service file and rpm spec file
2 parents 40fc2ef + 6cd0188 commit 3873fab

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

nginx-ldap-auth.service

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=LDAP authentication helper for Nginx
3+
After=network.target network-online.target
4+
5+
[Service]
6+
Type=simple
7+
User=nobody
8+
Group=nobody
9+
WorkingDirectory=/var/run
10+
PIDFile=/run/nginx-ldap-auth/nginx-ldap-auth.pid
11+
ExecStart=/usr/bin/nginx-ldap-auth-daemon
12+
KillMode=process
13+
KillSignal=SIGINT
14+
Restart=on-failure
15+
16+
[Install]
17+
WantedBy=multi-user.target

rpm/nginx-ldap-auth.spec

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Name: nginx-ldap-auth
2+
Version: 0.0.3
3+
Release: 1%{?dist}
4+
Summary: NGINX Plus LDAP authentication daemon
5+
6+
Group: System Environment/Daemons
7+
License: 2-clause BSD-like license
8+
URL: https://github.com/nginxinc/nginx-ldap-auth
9+
Source0: nginx-ldap-auth-release-%{version}.tar.gz
10+
11+
BuildRequires: systemd
12+
Requires: systemd
13+
Requires: python-ldap
14+
15+
%description
16+
Reference implementation of method for authenticating users on behalf of
17+
servers proxied by NGINX or NGINX Plus.
18+
19+
%prep
20+
%setup -q
21+
22+
%install
23+
mkdir -p %buildroot%_bindir
24+
install -m755 nginx-ldap-auth-daemon.py %buildroot%_bindir/nginx-ldap-auth-daemon
25+
mkdir -p %buildroot%_unitdir
26+
install -m644 nginx-ldap-auth.service %buildroot%_unitdir/
27+
28+
%files
29+
%doc README.md nginx-ldap-auth.conf backend-sample-app.py LICENSE
30+
%_bindir/nginx-ldap-auth-daemon
31+
%_unitdir/nginx-ldap-auth.service
32+
33+
%post
34+
/usr/bin/systemctl preset nginx-ldap-auth.service
35+
36+
%preun
37+
/usr/bin/systemctl --no-reload disable nginx-ldap-auth.service >/dev/null 2>&1 ||:
38+
/usr/bin/systemctl stop nginx-ldap-auth.service >/dev/null 2>&1 ||:
39+
40+
%postun
41+
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 ||:
42+
43+
%changelog
44+
* Wed Nov 02 2016 Konstantin Pavlov <thresh@nginx.com> 0.0.3-1
45+
- Initial release

0 commit comments

Comments
 (0)