2019-08-23 16:08:03 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import os
|
|
|
|
from settings_base import *
|
|
|
|
|
|
|
|
DEBUG = TEMPLATE_DEBUG = False
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = ['{{ domain }}']
|
|
|
|
|
|
|
|
URL_PREFIX = '{{ prefix }}'
|
|
|
|
STATIC_ROOT = '{{ final_path }}/static'
|
|
|
|
NOTIFICATION_EMAILS = ['{{ email }}']
|
|
|
|
DEFAULT_FROM_EMAIL = 'notifier@{{ domain }}'
|
|
|
|
SITE_URL = "https://{{ domain }}{{ path_url }}"
|
|
|
|
SECRET_KEY = '{{ secret }}'
|
|
|
|
ISP = {
|
|
|
|
'NAME': '{{ isp_name }}',
|
|
|
|
'SITE': '{{ isp_site }}',
|
|
|
|
'EMAIL': '{{ email }}',
|
|
|
|
}
|
|
|
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
|
|
|
|
|
|
|
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'NAME': '{{ db_name }}',
|
|
|
|
'USER': '{{ db_user }}',
|
|
|
|
'PASSWORD': '{{ db_pwd }}',
|
2019-08-23 17:43:40 +02:00
|
|
|
'HOST': '127.0.0.1',
|
|
|
|
'PORT': '5432',
|
2019-08-23 16:08:03 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-08-25 01:24:07 +02:00
|
|
|
FEEDS = (('ffdn', 'http://www.ffdn.org/fr/rss.xml', 3),)
|
2019-08-23 16:08:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-23 17:43:40 +02:00
|
|
|
# Tous acces
|
|
|
|
# parametrer SSO en protect_uris
|
2019-08-23 16:08:03 +02:00
|
|
|
# OU
|
2019-08-23 17:43:40 +02:00
|
|
|
# Pas d'acces
|
2019-08-23 16:08:03 +02:00
|
|
|
# hook
|
2019-08-23 17:43:40 +02:00
|
|
|
# parametrer SSO en protect_uris
|
2019-08-23 16:08:03 +02:00
|
|
|
import ldap
|
|
|
|
from django_auth_ldap.config import LDAPSearch, PosixGroupType
|
|
|
|
AUTHENTICATION_BACKENDS = (
|
|
|
|
'django_auth_ldap.backend.LDAPBackend',
|
|
|
|
'django.contrib.auth.backends.ModelBackend',
|
|
|
|
)
|
|
|
|
AUTH_LDAP_SERVER_URI = "ldap://localhost:389"
|
2019-08-24 19:20:31 +02:00
|
|
|
AUTH_LDAP_USER_SEARCH = LDAPSearch("uid={{ admin }},ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
|
2019-08-23 16:08:03 +02:00
|
|
|
AUTH_LDAP_USER_ATTR_MAP = {
|
|
|
|
"username": "uid",
|
|
|
|
"first_name": "givenName",
|
|
|
|
"last_name": "sn",
|
|
|
|
"email": "mail",
|
|
|
|
}
|
|
|
|
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
|
|
|
|
"is_active": "cn=sftpusers,ou=groups,dc=yunohost,dc=org",
|
|
|
|
"is_staff": "cn=sftpusers,ou=groups,dc=yunohost,dc=org",
|
|
|
|
"is_superuser": "cn=sftpusers,ou=groups,dc=yunohost,dc=org"
|
|
|
|
}
|
|
|
|
AUTH_LDAP_GROUP_SEARCH = LDAPSearch("ou=groups,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(objectClass=posixGroup)")
|
|
|
|
AUTH_LDAP_GROUP_TYPE = PosixGroupType()
|
|
|
|
AUTH_LDAP_ALWAYS_UPDATE_USER = True
|
|
|
|
AUTH_LDAP_AUTHORIZE_ALL_USERS = True
|
|
|
|
AUTH_LDAP_FIND_GROUP_PERMS = True
|
|
|
|
#AUTH_LDAP_CACHE_GROUPS = True
|
|
|
|
#AUTH_LDAP_GROUP_CACHE_TIMEOUT = 300
|
|
|
|
#import logging
|
|
|
|
#logger = logging.getLogger('django_auth_ldap')
|
|
|
|
#logger.addHandler(logging.StreamHandler())
|
|
|
|
#logger.setLevel(logging.DEBUG)
|