ansible/roles/re2o/templates/re2o/settings_local.py.j2

94 lines
2.8 KiB
Django/Jinja

# -*- mode: python; coding: utf-8 -*-
{{ ansible_header | comment }}
from __future__ import unicode_literals
# A secret key used by the server.
SECRET_KEY = '{{ re2o.django_secret_key }}'
# The password to access the project database
DB_PASSWORD = '{{ re2o.db_password }}'
# AES key for secret key encryption.
# The length must be a multiple of 16
AES_KEY = '{{ re2o.aes_key }}'
# Should the server run in debug mode ?
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
# A list of admins of the services. Receive mails when an error occurs
ADMINS = [('Root', 'root@crans.org')]
# The list of hostname the server will respond to.
ALLOWED_HOSTS = ['re2o.crans.org', 're2o.adm.crans.org', 'intranet.crans.org', 'intranet.adm.crans.org', 're2o-srv.crans.org', 're2o-srv.adm.crans.org', 'intranet.switches.crans.org', 're2o.switches.crans.org', 're2o-srv.switches.crans.org']
# The time zone the server is runned in
TIME_ZONE = 'Europe/Paris'
# The storage systems parameters to use
DATABASES = {
'default': { # The DB
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 're2o',
'USER': 're2o',
'PASSWORD': DB_PASSWORD,
'HOST': 'pgsql.adm.crans.org',
'TEST': {
'CHARSET': 'utf8',
'COLLATION': 'utf8_general_ci'
}
},
'ldap': { # The LDAP
'ENGINE': 'ldapdb.backends.ldap',
'NAME': 'ldap://re2o-ldap.adm.crans.org/',
'USER': 'cn=admin,dc=crans,dc=org',
'TLS': False,
'PASSWORD': '{{ ldap.master_password }}',
}
}
# Security settings for secure https
# Activate once https is correctly configured
SECURE_CONTENT_TYPE_NOSNIFF = False
SECURE_BROWSER_XSS_FILTER = False
SESSION_COOKIE_SECURE = False
CSRF_COOKIE_SECURE = False
CSRF_COOKIE_HTTPONLY = False
X_FRAME_OPTIONS = 'DENY'
SESSION_COOKIE_AGE = 60 * 60 * 3
# The path where your organization logo is stored
LOGO_PATH = "static_files/logo.png"
# The mail configuration for Re2o to send mails
SERVER_EMAIL = 'root@crans.org' # The mail address to use
EMAIL_HOST = 'smtp.adm.crans.org' # The host to use
EMAIL_PORT = 25 # The port to use
# Settings of the LDAP structure
LDAP = {
'base_user_dn' : u'cn=Utilisateurs,dc=crans,dc=org',
'base_userservice_dn' : u'ou=service-users,dc=crans,dc=org',
'base_usergroup_dn' : u'ou=posix,ou=groups,dc=crans,dc=org',
'base_userservicegroup_dn' : u'ou=services,ou=groups,dc=crans,dc=org',
'base_dn' : 'dc=crans,dc=org',
'user_gid': 500,
}
# A range of UID to use. Used in linux environement
UID_RANGES = {
'users': [11001, 20000],
'service-users': [30000, 31000],
}
# A range of GID to use. Used in linux environement
GID_RANGES = {
'posix': [501, 600],
}
CAPTIVE_IP_RANGE = "10.51.0.0/16"
# Some Django apps you want to add in you local project
OPTIONNAL_APPS = ('api',)