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.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
43 'NAME': '', # 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 # uncomment the following line if mysql is selected
50 # "init_command": "SET storage_engine=MYISAM",
55 # Local time zone for this installation. Choices can be found here:
56 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
57 # although not all choices may be available on all operating systems.
58 # On Unix systems, a value of None will cause Django to use the same
59 # timezone as the operating system.
60 # If running in a Windows environment this must be set to the same as your
62 TIME_ZONE = 'Europe/Athens'
64 # Language code for this installation. All choices can be found here:
65 # http://www.i18nguy.com/unicode/language-identifiers.html
73 # Language code for this installation. All choices can be found here:
74 # http://www.i18nguy.com/unicode/language-identifiers.html
79 # If you set this to False, Django will make some optimizations so as not
80 # to load the internationalization machinery.
83 # If you set this to False, Django will not format dates, numbers and
84 # calendars according to the current locale
87 # Absolute path to the directory that holds media.
88 # Example: "/home/media/media.lawrence.com/"
91 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
92 # trailing slash if there is a path component (optional in other cases).
93 # Examples: "http://media.lawrence.com", "http://example.com/media/"
96 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
98 # Examples: "http://foo.com/media/", "/media/".
99 ADMIN_MEDIA_PREFIX = '/admin/media/'
101 # Make this unique, and don't share it with anybody.
102 SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
104 # List of callables that know how to import templates from various sources.
106 'django.template.loaders.filesystem.Loader',
107 'django.template.loaders.app_directories.Loader',
108 # 'django.template.loaders.eggs.Loader',
111 TEMPLATE_CONTEXT_PROCESSORS = (
112 "django.contrib.auth.context_processors.auth",
113 "django.core.context_processors.debug",
114 "django.core.context_processors.i18n",
115 "django.core.context_processors.media",
116 "django.contrib.messages.context_processors.messages"
119 MIDDLEWARE_CLASSES = (
120 'django.middleware.cache.UpdateCacheMiddleware',
121 'django.middleware.common.CommonMiddleware',
122 'django.contrib.sessions.middleware.SessionMiddleware',
123 'django.middleware.locale.LocaleMiddleware',
124 'django.middleware.csrf.CsrfViewMiddleware',
125 'django.contrib.auth.middleware.AuthenticationMiddleware',
126 'django.contrib.messages.middleware.MessageMiddleware',
127 'django.middleware.cache.FetchFromCacheMiddleware',
128 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
131 AUTHENTICATION_BACKENDS = (
132 'flowspy.djangobackends.shibauthBackend.shibauthBackend',
133 'django.contrib.auth.backends.ModelBackend',
136 ROOT_URLCONF = 'flowspy.urls'
138 STATIC_URL = '/path/to/static'
141 '/path/to/templates/',
142 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
143 # Always use forward slashes, even on Windows.
144 # Don't forget to use absolute paths, not relative paths.
149 'django.contrib.auth',
150 'django.contrib.contenttypes',
151 'django.contrib.sessions',
152 'django.contrib.sites',
153 'django.contrib.messages',
154 'django.contrib.flatpages',
158 # Uncomment the next line to enable the admin:
159 'django.contrib.admin',
160 # Uncomment the next line to enable admin documentation:
161 'django.contrib.admindocs',
170 LOGIN_URL = '/fod/welcome'
172 CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
174 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
179 ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
180 ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
181 COMMIT_CONFIRMED_TIMEOUT = "120"
182 EXPIRATION_DAYS_OFFSET = 7
185 USE_X_FORWARDED_HOST = True
187 BROKER_HOST = "localhost"
192 CELERY_CONCURRENCY = 1
194 # List of modules to import when celery starts.
195 CELERY_IMPORTS = ("flowspec.tasks", )
197 SERVER_EMAIL = "GRNET FoD Service <noreply@example.com>"
198 EMAIL_SUBJECT_PREFIX = "[FoD] "
200 LOG_FILE_LOCATION = here("log")
202 EXPIRATION_NOTIFY_DAYS = 4
204 POLL_SESSION_UPDATE = 60.0
206 BROKER_URL = "beanstalk://localhost:11300//"
208 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
209 SHIB_ADMIN_DOMAIN = 'grnet.gr'
210 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
213 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
215 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
216 UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
218 PROTECTED_SUBNETS = ['10.10.0.0/16']
220 CELERYBEAT_SCHEDULE = {
222 "task": "flowspec.tasks.check_sync",
223 "schedule": crontab(minute=01, hour=01),
227 "task": "flowspec.tasks.notify_expired",
228 "schedule": crontab(minute=01, hour=02),
233 PRIMARY_WHOIS = 'whois.example.com'
234 ALTERNATE_WHOIS = 'whois.example.net'
236 ACCOUNT_ACTIVATION_DAYS = 7
238 #Shibboleth attribute map
239 SHIB_USERNAME = ['HTTP_EPPN']
240 SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
241 SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
242 SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
243 SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
245 TINYMCE_JS_URL = '/fodstatic/js/tinymce/tiny_mce.js'
247 TINYMCE_DEFAULT_CONFIG = {
248 'extended_valid_elements' : 'iframe[src|width|height|name|align]',
249 'plugins': "table,spellchecker,paste,searchreplace",
254 SW_VERSION = _version.VERSION