2019-09-01 14:04:53 +00:00
|
|
|
# coding: utf-8
|
2020-11-23 16:06:37 +00:00
|
|
|
# Re2o est un logiciel d'administration développé initiallement au Rézo Metz. Il
|
2017-01-15 23:01:18 +00:00
|
|
|
# se veut agnostique au réseau considéré, de manière à être installable en
|
|
|
|
# quelques clics.
|
|
|
|
#
|
|
|
|
# Copyright © 2017 Gabriel Détraz
|
2019-09-29 14:02:28 +00:00
|
|
|
# Copyright © 2017 Lara Kermarec
|
2017-01-15 23:01:18 +00:00
|
|
|
# Copyright © 2017 Augustin Lemesle
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2021-02-18 17:41:51 +00:00
|
|
|
"""re2o.settings_local
|
2018-05-17 20:45:41 +00:00
|
|
|
The file with all the available options for a locale configuration of re2o
|
2018-04-14 19:29:16 +00:00
|
|
|
"""
|
2017-01-15 23:01:18 +00:00
|
|
|
|
2017-09-10 23:29:24 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# A secret key used by the server.
|
2019-11-04 16:55:03 +00:00
|
|
|
SECRET_KEY = "SUPER_SECRET_KEY"
|
2016-07-06 10:29:49 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# The password to access the project database
|
2019-11-04 16:55:03 +00:00
|
|
|
DB_PASSWORD = "SUPER_SECRET_DB"
|
2016-07-06 10:29:49 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# AES key for secret key encryption.
|
|
|
|
# The length must be a multiple of 16
|
2019-11-04 16:55:03 +00:00
|
|
|
AES_KEY = "A_SECRET_AES_KEY"
|
2018-01-15 00:06:54 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# Should the server run in debug mode ?
|
2016-07-06 10:29:49 +00:00
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
DEBUG = False
|
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# A list of admins of the services. Receive mails when an error occurs
|
2019-11-04 16:55:03 +00:00
|
|
|
ADMINS = [("Example", "admin@example.net")]
|
2017-01-15 13:32:12 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# The list of hostname the server will respond to.
|
2019-11-04 16:55:03 +00:00
|
|
|
ALLOWED_HOSTS = ["URL_SERVER"]
|
2016-07-06 10:29:49 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# The time zone the server is runned in
|
2019-11-04 16:55:03 +00:00
|
|
|
TIME_ZONE = "Europe/Paris"
|
2018-04-14 19:29:16 +00:00
|
|
|
|
|
|
|
# The storage systems parameters to use
|
2016-07-06 10:29:49 +00:00
|
|
|
DATABASES = {
|
2019-11-04 16:55:03 +00:00
|
|
|
"default": { # The DB
|
|
|
|
"ENGINE": "db_engine",
|
|
|
|
"NAME": "db_name_value",
|
|
|
|
"USER": "db_user_value",
|
|
|
|
"PASSWORD": DB_PASSWORD,
|
|
|
|
"HOST": "db_host_value",
|
|
|
|
"TEST": {"CHARSET": "utf8", "COLLATION": "utf8_general_ci"},
|
|
|
|
},
|
|
|
|
"ldap": { # The LDAP
|
|
|
|
"ENGINE": "ldapdb.backends.ldap",
|
|
|
|
"NAME": "ldap://ldap_host_ip/",
|
|
|
|
"USER": "ldap_dn",
|
|
|
|
"TLS": True,
|
|
|
|
"PASSWORD": "SUPER_SECRET_LDAP",
|
2016-10-12 10:46:39 +00:00
|
|
|
},
|
2016-07-06 10:29:49 +00:00
|
|
|
}
|
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# Security settings for secure https
|
|
|
|
# Activate once https is correctly configured
|
2018-01-21 16:45:11 +00:00
|
|
|
SECURE_CONTENT_TYPE_NOSNIFF = False
|
|
|
|
SECURE_BROWSER_XSS_FILTER = False
|
|
|
|
SESSION_COOKIE_SECURE = False
|
|
|
|
CSRF_COOKIE_SECURE = False
|
|
|
|
CSRF_COOKIE_HTTPONLY = False
|
2019-11-04 16:55:03 +00:00
|
|
|
X_FRAME_OPTIONS = "DENY"
|
2020-04-22 10:30:06 +00:00
|
|
|
|
|
|
|
# The validity duration of session cookies, in seconds
|
2016-12-12 15:59:33 +00:00
|
|
|
SESSION_COOKIE_AGE = 60 * 60 * 3
|
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# The path where your organization logo is stored
|
2016-07-14 12:08:50 +00:00
|
|
|
LOGO_PATH = "static_files/logo.png"
|
2016-07-20 10:18:37 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# The mail configuration for Re2o to send mails
|
2019-11-04 16:55:03 +00:00
|
|
|
SERVER_EMAIL = "no-reply@example.net" # The mail address to use
|
|
|
|
EMAIL_HOST = "MY_EMAIL_HOST" # The host to use
|
|
|
|
EMAIL_PORT = MY_EMAIL_PORT # The port to use
|
2017-09-08 19:19:32 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# Settings of the LDAP structure
|
2016-10-12 10:46:39 +00:00
|
|
|
LDAP = {
|
2019-11-04 16:55:03 +00:00
|
|
|
"base_user_dn": "cn=Utilisateurs,dc=example,dc=net",
|
|
|
|
"base_userservice_dn": "ou=service-users,dc=example,dc=net",
|
|
|
|
"base_usergroup_dn": "ou=posix,ou=groups,dc=example,dc=net",
|
|
|
|
"base_userservicegroup_dn": "ou=services,ou=groups,dc=example,dc=net",
|
|
|
|
"user_gid": 500,
|
|
|
|
}
|
2016-10-12 10:46:39 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# A range of UID to use. Used in linux environement
|
2019-11-04 16:55:03 +00:00
|
|
|
UID_RANGES = {"users": [21001, 30000], "service-users": [20000, 21000]}
|
2016-10-12 10:46:39 +00:00
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# A range of GID to use. Used in linux environement
|
2019-11-04 16:55:03 +00:00
|
|
|
GID_RANGES = {"posix": [501, 600]}
|
2016-10-12 10:46:39 +00:00
|
|
|
|
2021-02-17 12:05:59 +00:00
|
|
|
# Default gid
|
|
|
|
DEFAULT_GID = 500
|
|
|
|
|
2020-05-21 16:34:14 +00:00
|
|
|
# If you want to add a database routers, please fill in above and add your databse.
|
|
|
|
# Then, add a file "local_routers.py" in folder app re2o, and add your router path in
|
2021-02-10 10:06:09 +00:00
|
|
|
# the LOCAL_ROUTERS var as "re2o.local_routers.DbRouter". You can also add extra routers.
|
2021-02-13 14:52:41 +00:00
|
|
|
# To use ldap you need to add "ldapdb.router.Router"
|
2020-05-21 16:34:14 +00:00
|
|
|
LOCAL_ROUTERS = []
|
|
|
|
|
2019-08-11 19:51:31 +00:00
|
|
|
# Some optionnal Re2o Apps
|
|
|
|
OPTIONNAL_APPS_RE2O = ()
|
|
|
|
|
2018-04-14 19:29:16 +00:00
|
|
|
# Some Django apps you want to add in you local project
|
2019-08-11 19:51:31 +00:00
|
|
|
OPTIONNAL_APPS = OPTIONNAL_APPS_RE2O + ()
|
2020-04-19 20:14:38 +00:00
|
|
|
|
2021-02-16 11:23:04 +00:00
|
|
|
# Add statiffiles dir that were installed using system packaging
|
|
|
|
# Example to reproduce re2o2.9 behavior
|
|
|
|
# SYSTEM_STATICFILES_DIRS = ("/usr/share/fonts-font-awesome/", "/usr/share/javascript/")
|
|
|
|
SYSTEM_STATICFILES_DIRS = ()
|
|
|
|
|
|
|
|
# Wether to use CDN to retrieve bootstrap, font-aweseome and jquery files
|
|
|
|
# Default to False
|
|
|
|
USE_CDN = False
|
|
|
|
|
2021-02-10 10:06:09 +00:00
|
|
|
# Set auth password validator
|
2020-04-19 20:20:13 +00:00
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
2021-02-10 10:06:09 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
|
|
|
"OPTIONS": {
|
|
|
|
"user_attributes": ["surname", "pseudo", "name", "email"],
|
|
|
|
},
|
2020-04-19 20:20:13 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-10 10:06:09 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
|
|
|
"OPTIONS": {
|
|
|
|
"min_length": 8,
|
|
|
|
},
|
2020-04-19 20:20:13 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-10 10:06:09 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
2020-04-19 20:20:13 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-10 10:06:09 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
2020-04-19 20:20:13 +00:00
|
|
|
},
|
|
|
|
]
|