Conversation
Dockerfile: add Python & psycopg2 support for external auth scripts This change installs python3, pip, and required build deps in both build and runtime stages, and globally installs bcrypt and psycopg2. Motivation: - ejabberd supports external authentication scripts written in Python. - These scripts often require bcrypt (password hashing) and psycopg2 (PostgreSQL driver). - Currently, users need to extend the official image to add these dependencies manually. With this change, the official Docker image can run Python auth scripts out of the box.
|
Hi @paulo-roger, many thanks for your contribution! In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. |
|
You did it @paulo-roger! Thank you for signing the ProcessOne Contribution License Agreement. We will have a look at your contribution! |
|
This opens a few questions: The external authentication script can be written in any language, right? In any compiled language like C, Cobol, and also any interpreted languages like Perl, Python, Tcl, Ruby, JavaScript, Lisp, Elixir, etc, right? And people may use any of those languages for writting their authentication scripts, right? And, in order to reduce friction for that people, the compilers and interpreters of all the existing languages should be included, right? But maybe not all languages are nowadays really used, so they don't need to be included. Which ones to include in the image, and which ones to discard as unpopular/irrelevant/obsolete? The ones you use? The ones I use? The most popular nowadays? The most popular according to what statistics? The ones that somebody request (like Python in this case)? The current solution is to provide a small image for everybody, and let people decide freely which language they use, and adapt the image accordingly.
Interesting possibility, because I remember the CAPTCHA feature also requires some additional libraries not included in the current image. Maybe there could be an "extended" image with the Python you propose, and any other language other people may request, and CAPTCHA support libraries, etc. |
Dockerfile: add Python & psycopg2 support for external auth scripts
This change installs python3, pip, and required build deps in both build and runtime stages, and globally installs bcrypt and psycopg2.
Motivation:
With this change, the official Docker image can run Python auth scripts out of the box.
Summary
This PR updates the Dockerfile to include Python support and
common dependencies needed for ejabberd authentication scripts.
Changes
python3,py3-pip,python3-dev,postgresql-dev,and build tools via
apk.bcryptandpsycopg2globally.Motivation
Many ejabberd deployments rely on custom external authentication
scripts, frequently written in Python. A common pattern is to use:
bcryptfor password hashingpsycopg2for PostgreSQL accessAt present, the official Docker image does not include these
dependencies, forcing users to extend the Dockerfile themselves.
Benefits
Notes
would be to publish an additional
-with-pythonvariant.