This commit is contained in:
Jérôme Schneider 2023-03-07 10:42:30 +01:00 committed by GitHub
commit 5a665368c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 9 deletions

View File

@ -1,4 +1,4 @@
ARG PYTHON_VERSION=2
ARG PYTHON_VERSION=3
FROM python:${PYTHON_VERSION}-alpine
COPY nginx-ldap-auth-daemon.py /usr/src/app/
@ -9,9 +9,9 @@ WORKDIR /usr/src/app/
RUN \
apk --no-cache add openldap-dev && \
apk --no-cache add --virtual build-dependencies build-base && \
pip install python-ldap && \
pip3 install python-ldap && \
apk del build-dependencies
EXPOSE 8888
CMD ["python", "/usr/src/app/nginx-ldap-auth-daemon.py", "--host", "0.0.0.0", "--port", "8888"]
CMD ["python3", "/usr/src/app/nginx-ldap-auth-daemon.py", "--host", "0.0.0.0", "--port", "8888"]

4
debian/control vendored
View File

@ -3,11 +3,11 @@ 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
Build-Depends: debhelper (>= 9), dh-systemd, python3, dh-python, dh-exec
Package: nginx-ldap-auth
Architecture: all
Depends: systemd, python(>=2.6), python-ldap, python-argparse
Depends: systemd, python3(>=3.7), python3-ldap
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

2
debian/rules vendored
View File

@ -1,3 +1,3 @@
#!/usr/bin/make -f
%:
dh $@ --with python2 --with systemd
dh $@ --with python3 --with systemd

View File

@ -1,6 +1,6 @@
#!/bin/sh
''''[ -z $LOG ] && export LOG=/dev/stdout # '''
''''which python >/dev/null && exec python -u "$0" "$@" >> $LOG 2>&1 # '''
''''which python3 >/dev/null && exec python3 -u "$0" "$@" >> $LOG 2>&1 # '''
# Copyright (C) 2014-2022 Nginx, Inc.

View File

@ -12,8 +12,7 @@ Source0: nginx-ldap-auth-release-%{version}.tar.gz
BuildRequires: systemd
Requires: systemd
Requires: python-ldap
Requires: python-argparse
Requires: python3-ldap
Requires: logrotate
%description