diff --git a/README.md b/README.md index 2805d37..a60994c 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Edit files under `/opt/yunohost/APPDIR/envs/prod` to set environment variables. #### Multi-user support -* Are LDAP and HTTP auth supported? **No** +* Are LDAP and HTTP auth supported? **LDAP only** * Can the app be used by multiple users? **Yes** #### Supported architectures diff --git a/README_fr.md b/README_fr.md index 304a538..6c06247 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,7 +32,7 @@ Modifiez les fichiers sous `/opt/yunohost/APPDIR/envs/prod` pour configurer les #### Support multi-utilisateur -* L'authentification LDAP et HTTP est-elle prise en charge ? **Non** +* L'authentification LDAP et HTTP est-elle prise en charge ? **Seulement LDAP** * L'application peut-elle être utilisée par plusieurs utilisateurs ? **Oui** #### Architectures supportées diff --git a/manifest.json b/manifest.json index 85a9d84..8465fa0 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage podcast subscriptions, and sync them between apps and devices", "fr": "Gérez vos sousciptions balado, et sychronisez-lez entre vos applis et appareils" }, - "version": "2.11.0~ynh3", + "version": "2.11.1~ynh1", "url": "https://github.com/gpodder/mygpo", "license": "AGPL-3.0-only", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 3e99049..dcd5851 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="acl python3 python3-pip python3-venv postgresql postgresql-contrib libpq-dev redis-server" +pkg_dependencies="acl python3 python3-pip python3-venv postgresql postgresql-contrib libpq-dev redis-server libldap2-dev libsasl2-dev" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index f707d8f..a61a994 100755 --- a/scripts/install +++ b/scripts/install @@ -193,6 +193,7 @@ pushd $final_path || ynh_die python3 -m pip install -U wheel pip setuptools python3 -m pip install --requirement $final_path/requirements.txt python3 -m pip install --requirement $final_path/requirements-setup.txt + python3 -m pip install --requirement $final_path/requirements-ynh.txt deactivate 'dummy_arg' popd || ynh_die diff --git a/scripts/upgrade b/scripts/upgrade index 2767515..41364d3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,6 +111,7 @@ pushd $final_path || ynh_die python3 -m pip install -U wheel pip setuptools python3 -m pip install -U --requirement $final_path/requirements.txt python3 -m pip install -U --requirement $final_path/requirements-setup.txt + python3 -m pip install -U --requirement $final_path/requirements-ynh.txt deactivate 'dummy_arg' popd || ynh_die diff --git a/sources/extra_files/app/requirements-ynh.txt b/sources/extra_files/app/requirements-ynh.txt new file mode 100644 index 0000000..212b582 --- /dev/null +++ b/sources/extra_files/app/requirements-ynh.txt @@ -0,0 +1 @@ +django-auth-ldap diff --git a/sources/patches/app-00-gunicorn.patch b/sources/patches/app-00-gunicorn.conf.py.patch similarity index 100% rename from sources/patches/app-00-gunicorn.patch rename to sources/patches/app-00-gunicorn.conf.py.patch diff --git a/sources/patches/app-01-settings.py.patch b/sources/patches/app-01-settings.py.patch new file mode 100644 index 0000000..4b14e81 --- /dev/null +++ b/sources/patches/app-01-settings.py.patch @@ -0,0 +1,29 @@ +diff --git a/mygpo/settings.py b/mygpo/settings.py +index 33bd283f..2666ade6 100644 +--- a/mygpo/settings.py ++++ b/mygpo/settings.py +@@ -2,6 +2,7 @@ import re + import sys + import os.path + import dj_database_url ++import ldap + + + try: +@@ -209,10 +210,15 @@ except ImportError: + ACCOUNT_ACTIVATION_DAYS = int(os.getenv("ACCOUNT_ACTIVATION_DAYS", 7)) + + AUTHENTICATION_BACKENDS = ( ++ "django_auth_ldap.backend.LDAPBackend", + "mygpo.users.backend.CaseInsensitiveModelBackend", + "mygpo.web.auth.EmailAuthenticationBackend", + ) + ++AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=users,dc=yunohost,dc=org" ++ ++AUTH_LDAP_USER_ATTR_MAP = {"username": "uid", "first_name": "givenName", "email": "mail", "last_name": "sn"} ++ + SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" + + # TODO: use (default) JSON serializer for security + \ No newline at end of file