1 # -*- coding: utf-8 -*- vim:fileencoding=utf-8:
2 # vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
3 # Django settings for flowspy project.
4 # Copyright © 2011-2015 Greek Research and Technology Network (GRNET S.A.)
5 # Copyright © 2011-2014 Leonidas Poulopoulos (@leopoul)
6 # Copyright © 2014-2015 Stavros Kroustouris (@kroustou)
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 djcelery.setup_loader()
25 from celery.schedules import crontab
28 TEMPLATE_DEBUG = DEBUG
31 ('AdminName', 'adminmail@admin.com'),
34 here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
39 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
40 'NAME': '', # Or path to database file if using sqlite3.
41 'USER': '', # Not used with sqlite3.
42 'PASSWORD': '', # Not used with sqlite3.
43 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
44 'PORT': '', # Set to empty string for default. Not used with sqlite3.
48 # Hosts/domain names that are valid for this site; required if DEBUG is False
49 # See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
52 # Local time zone for this installation. Choices can be found here:
53 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
54 # although not all choices may be available on all operating systems.
55 # In a Windows environment this must be set to your system time zone.
56 TIME_ZONE = 'Europe/Athens'
58 # Language code for this installation. All choices can be found here:
59 # http://www.i18nguy.com/unicode/language-identifiers.html
67 # Language code for this installation. All choices can be found here:
68 # http://www.i18nguy.com/unicode/language-identifiers.html
72 os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'locale'),
77 # If you set this to False, Django will make some optimizations so as not
78 # to load the internationalization machinery.
81 # If you set this to False, Django will not format dates, numbers and
82 # calendars according to the current locale.
85 # If you set this to False, Django will not use timezone-aware datetimes.
88 # Absolute filesystem path to the directory that will hold user-uploaded files.
89 # Example: "/home/media/media.lawrence.com/media/"
92 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
94 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
97 # Absolute path to the directory static files should be collected to.
98 # Don't put anything in this directory yourself; store your static files
99 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
100 # Example: "/home/media/media.lawrence.com/static/"
101 STATIC_ROOT = '/path/to/projects/flowspy/static'
103 # URL prefix for static files.
104 # Example: "http://media.lawrence.com/static/"
105 STATIC_URL = 'https://example.com/static/'
107 # Additional locations of static files
109 # Put strings here, like "/home/html/static" or "C:/www/django/static".
110 # Always use forward slashes, even on Windows.
111 # Don't forget to use absolute paths, not relative paths.
114 # List of finder classes that know how to find static files in
116 STATICFILES_FINDERS = (
117 'django.contrib.staticfiles.finders.FileSystemFinder',
118 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
119 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
122 # Make this unique, and don't share it with anybody.
123 SECRET_KEY = '<PLACE RANDOM CHARS HERE>eg. @@5234#$%345345^@#$%*()123^@12!&!()$JMNDF#$@(@#8FRNJWX_'
125 # List of callables that know how to import templates from various sources.
127 'django.template.loaders.filesystem.Loader',
128 'django.template.loaders.app_directories.Loader',
129 # 'django.template.loaders.eggs.Loader',
132 TEMPLATE_CONTEXT_PROCESSORS = (
133 "django.contrib.auth.context_processors.auth",
134 "django.core.context_processors.debug",
135 "django.core.context_processors.i18n",
136 "django.core.context_processors.media",
137 "django.core.context_processors.static",
138 "django.contrib.messages.context_processors.messages",
139 "context.global_vars.settings_vars",
142 MIDDLEWARE_CLASSES = (
143 'django.middleware.cache.UpdateCacheMiddleware',
144 'django.middleware.common.CommonMiddleware',
145 'django.contrib.sessions.middleware.SessionMiddleware',
146 'django.middleware.locale.LocaleMiddleware',
147 'django.middleware.csrf.CsrfViewMiddleware',
148 'django.contrib.auth.middleware.AuthenticationMiddleware',
149 'django.contrib.messages.middleware.MessageMiddleware',
150 # Uncomment the next line for simple clickjacking protection:
151 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
152 'django.middleware.cache.FetchFromCacheMiddleware',
153 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
156 ROOT_URLCONF = 'flowspy.urls'
158 # Python dotted path to the WSGI application used by Django's runserver.
159 WSGI_APPLICATION = 'flowspy.wsgi.application'
161 AUTHENTICATION_BACKENDS = (
162 'djangobackends.shibauthBackend.shibauthBackend',
163 'django.contrib.auth.backends.ModelBackend',
167 '/path/to/templates/',
168 '/path/to/rest_framework/templates/',
169 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
170 # Always use forward slashes, even on Windows.
171 # Don't forget to use absolute paths, not relative paths.
176 'django.contrib.auth',
177 'django.contrib.contenttypes',
178 'django.contrib.sessions',
179 'django.contrib.sites',
180 'django.contrib.flatpages',
181 'django.contrib.messages',
182 'django.contrib.staticfiles',
186 # Uncomment the next line to enable the admin:
187 'django.contrib.admin',
188 # Uncomment the next line to enable admin documentation:
189 # 'django.contrib.admindocs',
199 # A sample logging configuration. The only tangible logging
200 # performed by this configuration is to send an email to
201 # the site admins on every HTTP 500 error when DEBUG=False.
202 # See http://docs.djangoproject.com/en/dev/topics/logging for
203 # more details on how to customize your logging configuration.
206 'disable_existing_loggers': False,
208 'require_debug_false': {
209 '()': 'django.utils.log.RequireDebugFalse'
215 'filters': ['require_debug_false'],
216 'class': 'django.utils.log.AdminEmailHandler'
221 'handlers': ['mail_admins'],
228 LOGIN_URL = '/welcome'
232 # 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
233 # 'LOCATION': '127.0.0.1:11211',
238 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
242 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
249 ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
250 ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
251 COMMIT_CONFIRMED_TIMEOUT = "120"
252 EXPIRATION_DAYS_OFFSET = 7
255 USE_X_FORWARDED_HOST = True
257 BROKER_HOST = "localhost"
262 CELERY_CONCURRENCY = 1
264 # List of modules to import when celery starts.
265 CELERY_IMPORTS = ("flowspec.tasks", )
267 SERVER_EMAIL = "Example FoD Service <noreply@example.com>"
268 EMAIL_SUBJECT_PREFIX = "[FoD] "
270 EXPIRATION_NOTIFY_DAYS = 4
272 POLL_SESSION_UPDATE = 60.0
274 BROKER_URL = "beanstalk://localhost:11300//"
276 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
277 SHIB_ADMIN_DOMAIN = 'grnet.gr'
278 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
281 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
283 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
284 UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
286 PROTECTED_SUBNETS = ['10.10.0.0/16']
288 CELERYBEAT_SCHEDULE = {
290 "task": "flowspec.tasks.check_sync",
291 "schedule": crontab(minute=01, hour=01),
295 "task": "flowspec.tasks.notify_expired",
296 "schedule": crontab(minute=01, hour=02),
301 PRIMARY_WHOIS = 'whois.example.com'
302 ALTERNATE_WHOIS = 'whois.example.net'
304 ACCOUNT_ACTIVATION_DAYS = 7
306 #Shibboleth attribute map
307 SHIB_USERNAME = ['HTTP_EPPN']
308 SHIB_SLUGIFY_USERNAME = False
310 SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
311 SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
312 SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
313 SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
315 TINYMCE_JS_URL = STATIC_URL +'js/tinymce/tiny_mce.js'
317 TINYMCE_DEFAULT_CONFIG = {
318 'extended_valid_elements' : 'iframe[src|width|height|name|align]',
319 'plugins': "table,spellchecker,paste,searchreplace",
324 SW_VERSION = _version.VERSION
326 LOG_FILE_LOCATION = "/var/log/fod"
328 # Change the following values only if you know what you are doing!!!
329 # To integrate FoD with tables (Peer, Networks, Contacts)
330 # from your CRM platform, set the following values to False and create the views that are
331 # exact matches of the tables in peers/models.py
332 PEER_MANAGED_TABLE = True
333 PEER_RANGE_MANAGED_TABLE = True
334 PEER_TECHC_MANAGED_TABLE = True