Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use python3 by default #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Maintainer: Ippolitov Igor <[email protected]>
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
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/make -f
%:
dh $@ --with python2 --with systemd
dh $@ --with python3 --with systemd
2 changes: 1 addition & 1 deletion nginx-ldap-auth-daemon.py
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
3 changes: 1 addition & 2 deletions rpm/nginx-ldap-auth.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down