1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/coin_ynh.git synced 2024-09-03 18:16:26 +02:00
coin_ynh/conf/local.py

95 lines
2.3 KiB
Python
Raw Normal View History

2017-04-09 11:05:39 +02:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
2018-08-18 13:49:53 +02:00
from settings_base import *
2017-04-09 11:05:39 +02:00
2018-10-19 22:57:34 +02:00
DEBUG = TEMPLATE_DEBUG = False
2017-04-09 11:05:39 +02:00
2017-08-02 16:26:44 +02:00
ALLOWED_HOSTS = ['YNH_APP_ARG_DOMAIN']
2017-04-09 11:05:39 +02:00
2017-08-02 16:26:44 +02:00
URL_PREFIX = 'YNH_APP_PREFIX'
STATIC_ROOT = 'YNH_APP_STATIC_ROOT'
NOTIFICATION_EMAILS = ['YNH_APP_ARG_EMAIL']
DEFAULT_FROM_EMAIL = 'notifier@YNH_APP_ARG_DOMAIN'
SITE_URL = "https://YNH_APP_ARG_DOMAINYNH_APP_ARG_PATH"
2017-04-09 11:05:39 +02:00
SECRET_KEY = 'YNH_APP_SECRET_KEY'
2017-08-02 16:26:44 +02:00
ISP = {
'NAME' : 'YNH_APP_ARG_ISP_NAME',
'SITE' : 'YNH_APP_ARG_ISP_SITE',
'EMAIL' : 'YNH_APP_ARG_EMAIL',
2017-04-09 11:05:39 +02:00
}
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DATABASES = {
'default': {
2017-08-02 16:26:44 +02:00
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'YNH_DB_NAME',
'USER': 'YNH_DB_USER',
'PASSWORD': 'YNH_DB_PASSWORD',
'HOST': '', # Empty for localhost through domain sockets
'PORT': '', # Empty for default
2017-04-09 11:05:39 +02:00
},
}
FEEDS = (('isp', 'http://www.illyse.net/feed/', 3),
('ffdn', 'http://www.ffdn.org/fr/rss.xml', 3))
# Tous accés
# paramétrer SSO en protect_uris
# OU
# Pas d'accès
# hook
# paramétrer SSO en protect_uris
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"
AUTH_LDAP_USER_SEARCH = LDAPSearch("uid=YNH_APP_ARG_ADMIN,ou=users,dc=yunohost,dc=org", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")
2018-12-18 21:17:10 +01:00
AUTH_LDAP_USER_ATTR_MAP = {
"username": "uid",
"first_name": "givenName",
"last_name": "sn",
"email": "mail",
}
2017-04-09 11:05:39 +02:00
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)