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-2014 Greek Research and Technology Network (GRNET S.A.)
5 # Copyright © 2011-2014 Leonidas Poulopoulos (@leopoul)
7 # Permission to use, copy, modify, and/or distribute this software for any
8 # purpose with or without fee is hereby granted, provided that the above
9 # copyright notice and this permission notice appear in all copies.
11 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12 # TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
13 # FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
15 # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
16 # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
21 djcelery.setup_loader()
22 from celery.schedules import crontab
25 TEMPLATE_DEBUG = DEBUG
28 ('AdminName', 'adminmail@admin.com'),
31 here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
36 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
37 'NAME': '', # Or path to database file if using sqlite3.
38 'USER': '', # Not used with sqlite3.
39 'PASSWORD': '', # Not used with sqlite3.
40 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
41 'PORT': '', # Set to empty string for default. Not used with sqlite3.
45 # Hosts/domain names that are valid for this site; required if DEBUG is False
46 # See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
49 # Local time zone for this installation. Choices can be found here:
50 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
51 # although not all choices may be available on all operating systems.
52 # In a Windows environment this must be set to your system time zone.
53 TIME_ZONE = 'Europe/Athens'
55 # Language code for this installation. All choices can be found here:
56 # http://www.i18nguy.com/unicode/language-identifiers.html
64 # Language code for this installation. All choices can be found here:
65 # http://www.i18nguy.com/unicode/language-identifiers.html
69 os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'locale'),
74 # If you set this to False, Django will make some optimizations so as not
75 # to load the internationalization machinery.
78 # If you set this to False, Django will not format dates, numbers and
79 # calendars according to the current locale.
82 # If you set this to False, Django will not use timezone-aware datetimes.
85 # Absolute filesystem path to the directory that will hold user-uploaded files.
86 # Example: "/home/media/media.lawrence.com/media/"
89 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
91 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
94 # Absolute path to the directory static files should be collected to.
95 # Don't put anything in this directory yourself; store your static files
96 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
97 # Example: "/home/media/media.lawrence.com/static/"
98 STATIC_ROOT = '/path/to/projects/flowspy/static'
100 # URL prefix for static files.
101 # Example: "http://media.lawrence.com/static/"
102 STATIC_URL = 'https://example.com/static/'
104 # Additional locations of static files
106 # Put strings here, like "/home/html/static" or "C:/www/django/static".
107 # Always use forward slashes, even on Windows.
108 # Don't forget to use absolute paths, not relative paths.
111 # List of finder classes that know how to find static files in
113 STATICFILES_FINDERS = (
114 'django.contrib.staticfiles.finders.FileSystemFinder',
115 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
116 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
119 # Make this unique, and don't share it with anybody.
120 SECRET_KEY = '<PLACE RANDOM CHARS HERE>eg. @@5234#$%345345^@#$%*()123^@12!&!()$JMNDF#$@(@#8FRNJWX_'
122 # List of callables that know how to import templates from various sources.
124 'django.template.loaders.filesystem.Loader',
125 'django.template.loaders.app_directories.Loader',
126 # 'django.template.loaders.eggs.Loader',
129 TEMPLATE_CONTEXT_PROCESSORS = (
130 "django.contrib.auth.context_processors.auth",
131 "django.core.context_processors.debug",
132 "django.core.context_processors.i18n",
133 "django.core.context_processors.media",
134 "django.core.context_processors.static",
135 "django.contrib.messages.context_processors.messages",
136 "context.global_vars.settings_vars",
139 MIDDLEWARE_CLASSES = (
140 'django.middleware.cache.UpdateCacheMiddleware',
141 'django.middleware.common.CommonMiddleware',
142 'django.contrib.sessions.middleware.SessionMiddleware',
143 'django.middleware.locale.LocaleMiddleware',
144 'django.middleware.csrf.CsrfViewMiddleware',
145 'django.contrib.auth.middleware.AuthenticationMiddleware',
146 'django.contrib.messages.middleware.MessageMiddleware',
147 # Uncomment the next line for simple clickjacking protection:
148 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
149 'django.middleware.cache.FetchFromCacheMiddleware',
150 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
153 ROOT_URLCONF = 'flowspy.urls'
155 # Python dotted path to the WSGI application used by Django's runserver.
156 WSGI_APPLICATION = 'flowspy.wsgi.application'
158 AUTHENTICATION_BACKENDS = (
159 'djangobackends.shibauthBackend.shibauthBackend',
160 'django.contrib.auth.backends.ModelBackend',
164 '/path/to/templates/',
165 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
166 # Always use forward slashes, even on Windows.
167 # Don't forget to use absolute paths, not relative paths.
172 'django.contrib.auth',
173 'django.contrib.contenttypes',
174 'django.contrib.sessions',
175 'django.contrib.sites',
176 'django.contrib.flatpages',
177 'django.contrib.messages',
178 'django.contrib.staticfiles',
182 # Uncomment the next line to enable the admin:
183 'django.contrib.admin',
184 # Uncomment the next line to enable admin documentation:
185 # 'django.contrib.admindocs',
194 # A sample logging configuration. The only tangible logging
195 # performed by this configuration is to send an email to
196 # the site admins on every HTTP 500 error when DEBUG=False.
197 # See http://docs.djangoproject.com/en/dev/topics/logging for
198 # more details on how to customize your logging configuration.
201 'disable_existing_loggers': False,
203 'require_debug_false': {
204 '()': 'django.utils.log.RequireDebugFalse'
210 'filters': ['require_debug_false'],
211 'class': 'django.utils.log.AdminEmailHandler'
216 'handlers': ['mail_admins'],
223 LOGIN_URL = '/welcome'
227 # 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
228 # 'LOCATION': '127.0.0.1:11211',
233 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
237 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
244 ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
245 ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
246 COMMIT_CONFIRMED_TIMEOUT = "120"
247 EXPIRATION_DAYS_OFFSET = 7
250 USE_X_FORWARDED_HOST = True
252 BROKER_HOST = "localhost"
257 CELERY_CONCURRENCY = 1
259 # List of modules to import when celery starts.
260 CELERY_IMPORTS = ("flowspec.tasks", )
262 SERVER_EMAIL = "Example FoD Service <noreply@example.com>"
263 EMAIL_SUBJECT_PREFIX = "[FoD] "
265 EXPIRATION_NOTIFY_DAYS = 4
267 POLL_SESSION_UPDATE = 60.0
269 BROKER_URL = "beanstalk://localhost:11300//"
271 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
272 SHIB_ADMIN_DOMAIN = 'grnet.gr'
273 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
276 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
278 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
279 UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
281 PROTECTED_SUBNETS = ['10.10.0.0/16']
283 CELERYBEAT_SCHEDULE = {
285 "task": "flowspec.tasks.check_sync",
286 "schedule": crontab(minute=01, hour=01),
290 "task": "flowspec.tasks.notify_expired",
291 "schedule": crontab(minute=01, hour=02),
296 PRIMARY_WHOIS = 'whois.example.com'
297 ALTERNATE_WHOIS = 'whois.example.net'
299 ACCOUNT_ACTIVATION_DAYS = 7
301 #Shibboleth attribute map
302 SHIB_USERNAME = ['HTTP_EPPN']
303 SHIB_SLUGIFY_USERNAME = False
305 SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
306 SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
307 SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
308 SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
310 TINYMCE_JS_URL = STATIC_URL +'js/tinymce/tiny_mce.js'
312 TINYMCE_DEFAULT_CONFIG = {
313 'extended_valid_elements' : 'iframe[src|width|height|name|align]',
314 'plugins': "table,spellchecker,paste,searchreplace",
319 SW_VERSION = _version.VERSION
321 LOG_FILE_LOCATION = "/var/log/fod"
323 # Change the following values only if you know what you are doing!!!
324 # To integrate FoD with tables (Peer, Networks, Contacts)
325 # from your CRM platform, set the following values to False and create the views that are
326 # exact matches of the tables in peers/models.py
327 PEER_MANAGED_TABLE = True
328 PEER_RANGE_MANAGED_TABLE = True
329 PEER_TECHC_MANAGED_TABLE = True