1 # Django settings for flowspy project.
2 # -*- coding: utf-8 -*- vim:fileencoding=utf-8:
3 # vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
4 #Copyright © 2011-2013 Greek Research and Technology Network (GRNET S.A.)
6 #Developed by Leonidas Poulopoulos (leopoul-at-noc-dot-grnet-dot-gr),
9 #Permission to use, copy, modify, and/or distribute this software for any
10 #purpose with or without fee is hereby granted, provided that the above
11 #copyright notice and this permission notice appear in all copies.
13 #THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD
14 #TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
15 #FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
16 #CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 #DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
18 #ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
25 djcelery.setup_loader()
26 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)
42 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
43 'NAME': 'flowspec', # Or path to database file if using sqlite3.
44 'USER': '', # Not used with sqlite3.
45 'PASSWORD': '', # Not used with sqlite3.
46 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
47 'PORT': '', # Set to empty string for default. Not used with sqlite3.
49 "init_command": "SET storage_engine=MYISAM",
54 # Local time zone for this installation. Choices can be found here:
55 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
56 # although not all choices may be available on all operating systems.
57 # On Unix systems, a value of None will cause Django to use the same
58 # timezone as the operating system.
59 # If running in a Windows environment this must be set to the same as your
61 TIME_ZONE = 'Europe/Athens'
63 # Language code for this installation. All choices can be found here:
64 # http://www.i18nguy.com/unicode/language-identifiers.html
72 # Language code for this installation. All choices can be found here:
73 # http://www.i18nguy.com/unicode/language-identifiers.html
78 # If you set this to False, Django will make some optimizations so as not
79 # to load the internationalization machinery.
82 # If you set this to False, Django will not format dates, numbers and
83 # calendars according to the current locale
86 # Absolute path to the directory that holds media.
87 # Example: "/home/media/media.lawrence.com/"
90 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
91 # trailing slash if there is a path component (optional in other cases).
92 # Examples: "http://media.lawrence.com", "http://example.com/media/"
95 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
97 # Examples: "http://foo.com/media/", "/media/".
98 ADMIN_MEDIA_PREFIX = '/admin/media/'
100 # Make this unique, and don't share it with anybody.
101 SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
103 # List of callables that know how to import templates from various sources.
105 'django.template.loaders.filesystem.Loader',
106 'django.template.loaders.app_directories.Loader',
107 # 'django.template.loaders.eggs.Loader',
110 TEMPLATE_CONTEXT_PROCESSORS = (
111 "django.contrib.auth.context_processors.auth",
112 "django.core.context_processors.debug",
113 "django.core.context_processors.i18n",
114 "django.core.context_processors.media",
115 "django.contrib.messages.context_processors.messages"
118 MIDDLEWARE_CLASSES = (
119 'django.middleware.cache.UpdateCacheMiddleware',
120 'django.middleware.common.CommonMiddleware',
121 'django.contrib.sessions.middleware.SessionMiddleware',
122 'django.middleware.locale.LocaleMiddleware',
123 'django.middleware.csrf.CsrfViewMiddleware',
124 'django.contrib.auth.middleware.AuthenticationMiddleware',
125 'django.contrib.messages.middleware.MessageMiddleware',
126 'django.middleware.cache.FetchFromCacheMiddleware',
127 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
130 AUTHENTICATION_BACKENDS = (
131 'flowspy.djangobackends.shibauthBackend.shibauthBackend',
132 'django.contrib.auth.backends.ModelBackend',
135 ROOT_URLCONF = 'flowspy.urls'
137 STATIC_URL = '/path/to/static'
140 '/path/to/templates/',
141 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
142 # Always use forward slashes, even on Windows.
143 # Don't forget to use absolute paths, not relative paths.
148 'django.contrib.auth',
149 'django.contrib.contenttypes',
150 'django.contrib.sessions',
151 'django.contrib.sites',
152 'django.contrib.messages',
153 'django.contrib.flatpages',
157 # Uncomment the next line to enable the admin:
158 'django.contrib.admin',
159 # Uncomment the next line to enable admin documentation:
160 'django.contrib.admindocs',
169 LOGIN_URL = '/fod/welcome'
171 CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
173 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
178 ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
179 ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
180 COMMIT_CONFIRMED_TIMEOUT = "120"
181 EXPIRATION_DAYS_OFFSET = 7
184 USE_X_FORWARDED_HOST = True
186 BROKER_HOST = "localhost"
191 CELERY_CONCURRENCY = 1
193 # List of modules to import when celery starts.
194 CELERY_IMPORTS = ("flowspec.tasks", )
196 SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>"
197 EMAIL_SUBJECT_PREFIX = "[FoD] "
199 LOG_FILE_LOCATION = here("log")
201 EXPIRATION_NOTIFY_DAYS = 4
203 POLL_SESSION_UPDATE = 60.0
205 BROKER_URL = "beanstalk://localhost:11300//"
207 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
208 SHIB_ADMIN_DOMAIN = 'grnet.gr'
209 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
212 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
214 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
215 UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
217 PROTECTED_SUBNETS = ['10.10.0.0/16']
219 CELERYBEAT_SCHEDULE = {
221 "task": "flowspec.tasks.check_sync",
222 "schedule": crontab(minute=01, hour=01),
226 "task": "flowspec.tasks.notify_expired",
227 "schedule": crontab(minute=01, hour=02),
232 PRIMARY_WHOIS = 'whois.grnet.gr'
233 ALTERNATE_WHOIS = 'whois.ripe.net'
235 ACCOUNT_ACTIVATION_DAYS = 7
237 #Shibboleth attribute map
238 SHIB_USERNAME = ['HTTP_EPPN']
239 SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
240 SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
241 SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
242 SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
244 TINYMCE_JS_URL = '/fodstatic/js/tinymce/tiny_mce.js'
246 TINYMCE_DEFAULT_CONFIG = {
247 'extended_valid_elements' : 'iframe[src|width|height|name|align]',
248 'plugins': "table,spellchecker,paste,searchreplace",