mirror of
https://github.com/YunoHost-Apps/mygpo_ynh.git
synced 2024-09-03 19:55:52 +02:00
Add LDAP
This commit is contained in:
parent
4400e7072d
commit
4472ad0283
9 changed files with 36 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
1
sources/extra_files/app/requirements-ynh.txt
Normal file
1
sources/extra_files/app/requirements-ynh.txt
Normal file
|
@ -0,0 +1 @@
|
|||
django-auth-ldap
|
29
sources/patches/app-01-settings.py.patch
Normal file
29
sources/patches/app-01-settings.py.patch
Normal 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
|
||||
|
Loading…
Add table
Reference in a new issue