diff --git a/Dockerfile b/Dockerfile index 980de92..9a0a161 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/debian/control b/debian/control index 3e46d83..522a819 100644 --- a/debian/control +++ b/debian/control @@ -3,11 +3,11 @@ Maintainer: Ippolitov Igor 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 diff --git a/debian/rules b/debian/rules index aba6b25..627bd97 100755 --- a/debian/rules +++ b/debian/rules @@ -1,3 +1,3 @@ #!/usr/bin/make -f %: - dh $@ --with python2 --with systemd + dh $@ --with python3 --with systemd diff --git a/nginx-ldap-auth-daemon.py b/nginx-ldap-auth-daemon.py index 388364c..87ea340 100755 --- a/nginx-ldap-auth-daemon.py +++ b/nginx-ldap-auth-daemon.py @@ -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-2015 Nginx, Inc. diff --git a/rpm/nginx-ldap-auth.spec b/rpm/nginx-ldap-auth.spec index 569fb17..53650d0 100644 --- a/rpm/nginx-ldap-auth.spec +++ b/rpm/nginx-ldap-auth.spec @@ -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