1 # Django settings for grnet project.
2 # -*- coding: utf-8 -*- vim:encoding=utf-8:
3 # vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab
6 djcelery.setup_loader()
7 from celery.schedules import crontab
12 ('AdminName', 'adminmail@admin.com'),
15 here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
23 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
24 'NAME': 'flowspec', # Or path to database file if using sqlite3.
25 'USER': '', # Not used with sqlite3.
26 'PASSWORD': '', # Not used with sqlite3.
27 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
28 'PORT': '', # Set to empty string for default. Not used with sqlite3.
30 "init_command": "SET storage_engine=MYISAM",
35 # Local time zone for this installation. Choices can be found here:
36 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
37 # although not all choices may be available on all operating systems.
38 # On Unix systems, a value of None will cause Django to use the same
39 # timezone as the operating system.
40 # If running in a Windows environment this must be set to the same as your
42 TIME_ZONE = 'Europe/Athens'
44 # Language code for this installation. All choices can be found here:
45 # http://www.i18nguy.com/unicode/language-identifiers.html
53 # Language code for this installation. All choices can be found here:
54 # http://www.i18nguy.com/unicode/language-identifiers.html
59 # If you set this to False, Django will make some optimizations so as not
60 # to load the internationalization machinery.
63 # If you set this to False, Django will not format dates, numbers and
64 # calendars according to the current locale
67 # Absolute path to the directory that holds media.
68 # Example: "/home/media/media.lawrence.com/"
71 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
72 # trailing slash if there is a path component (optional in other cases).
73 # Examples: "http://media.lawrence.com", "http://example.com/media/"
76 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
78 # Examples: "http://foo.com/media/", "/media/".
79 ADMIN_MEDIA_PREFIX = '/admin/media/'
81 # Make this unique, and don't share it with anybody.
82 SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
84 # List of callables that know how to import templates from various sources.
86 'django.template.loaders.filesystem.Loader',
87 'django.template.loaders.app_directories.Loader',
88 # 'django.template.loaders.eggs.Loader',
91 TEMPLATE_CONTEXT_PROCESSORS = (
92 "django.contrib.auth.context_processors.auth",
93 "django.core.context_processors.debug",
94 "django.core.context_processors.i18n",
95 "django.core.context_processors.media",
96 "django.contrib.messages.context_processors.messages"
99 MIDDLEWARE_CLASSES = (
100 'django.middleware.cache.UpdateCacheMiddleware',
101 'django.middleware.common.CommonMiddleware',
102 'django.contrib.sessions.middleware.SessionMiddleware',
103 'django.middleware.locale.LocaleMiddleware',
104 'django.middleware.csrf.CsrfViewMiddleware',
105 'django.contrib.auth.middleware.AuthenticationMiddleware',
106 'django.contrib.messages.middleware.MessageMiddleware',
107 'django.middleware.cache.FetchFromCacheMiddleware',
108 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
111 AUTHENTICATION_BACKENDS = (
112 'flowspy.djangobackends.shibauthBackend.shibauthBackend',
113 'django.contrib.auth.backends.ModelBackend',
116 ROOT_URLCONF = 'flowspy.urls'
118 STATIC_URL = '/path/to/static'
121 '/path/to/templates/',
122 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
123 # Always use forward slashes, even on Windows.
124 # Don't forget to use absolute paths, not relative paths.
129 'django.contrib.auth',
130 'django.contrib.contenttypes',
131 'django.contrib.sessions',
132 'django.contrib.sites',
133 'django.contrib.messages',
134 'django.contrib.flatpages',
138 # Uncomment the next line to enable the admin:
139 'django.contrib.admin',
140 # Uncomment the next line to enable admin documentation:
141 'django.contrib.admindocs',
150 LOGIN_URL = '/fod/welcome'
152 CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
154 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
159 ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
160 ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
161 COMMIT_CONFIRMED_TIMEOUT = "120"
162 EXPIRATION_DAYS_OFFSET = 7
165 USE_X_FORWARDED_HOST = True
167 BROKER_HOST = "localhost"
172 CELERY_CONCURRENCY = 1
174 # List of modules to import when celery starts.
175 CELERY_IMPORTS = ("flowspec.tasks", )
177 SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>"
178 EMAIL_SUBJECT_PREFIX = "[FoD] "
180 LOG_FILE_LOCATION = here("log")
182 EXPIRATION_NOTIFY_DAYS = 4
184 POLL_SESSION_UPDATE = 60.0
186 BROKER_URL = "beanstalk://localhost:11300//"
188 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
189 SHIB_ADMIN_DOMAIN = 'grnet.gr'
190 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
193 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
195 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
196 UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
198 PROTECTED_SUBNETS = ['10.10.0.0/16']
200 CELERYBEAT_SCHEDULE = {
202 "task": "flowspec.tasks.check_sync",
203 "schedule": crontab(minute=01, hour=01),
207 "task": "flowspec.tasks.notify_expired",
208 "schedule": crontab(minute=01, hour=02),
213 PRIMARY_WHOIS = 'whois.grnet.gr'
214 ALTERNATE_WHOIS = 'whois.ripe.net'
216 ACCOUNT_ACTIVATION_DAYS = 7
218 #Shibboleth attribute map
219 SHIB_USERNAME = ['HTTP_EPPN']
220 SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
221 SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
222 SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
223 SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
225 TINYMCE_JS_URL = '/fodstatic/js/tinymce/tiny_mce.js'
227 TINYMCE_DEFAULT_CONFIG = {
228 'extended_valid_elements' : 'iframe[src|width|height|name|align]',
229 'plugins': "table,spellchecker,paste,searchreplace",