1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mygpo_ynh.git synced 2024-09-03 19:55:52 +02:00
This commit is contained in:
Jules Bertholet 2021-03-23 12:33:02 -04:00
parent 4400e7072d
commit 4472ad0283
9 changed files with 36 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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": {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1 @@
django-auth-ldap

View file

@ -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