881f29e981e53b141f370ee2323409478af2f42f
[flowspy] / settings.py.dist
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.)
5
6 #Developed by Leonidas Poulopoulos (leopoul-at-noc-dot-grnet-dot-gr),
7 #GRNET NOC
8 #
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.
12 #
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
19 #SOFTWARE.
20 #
21
22
23 import os
24 import djcelery
25 djcelery.setup_loader()
26 from celery.schedules import crontab
27 DEBUG = False
28 TEMPLATE_DEBUG = DEBUG
29
30 ADMINS = (
31     ('AdminName', 'adminmail@admin.com'),
32 )
33
34 here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
35
36
37
38 MANAGERS = ADMINS
39
40 DATABASES = {
41     'default': {
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.
48         'OPTIONS':  {
49        # uncomment the following line if mysql is selected
50        # "init_command": "SET storage_engine=MYISAM",
51         }
52     }
53 }
54
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
61 # system time zone.
62 TIME_ZONE = 'Europe/Athens'
63
64 # Language code for this installation. All choices can be found here:
65 # http://www.i18nguy.com/unicode/language-identifiers.html
66 _ = lambda s: s
67
68 LANGUAGES = (
69     ('el', _('Greek')),
70     ('en', _('English')),
71 )
72
73 # Language code for this installation. All choices can be found here:
74 # http://www.i18nguy.com/unicode/language-identifiers.html
75 LANGUAGE_CODE = 'en'
76
77 SITE_ID = 1
78
79 # If you set this to False, Django will make some optimizations so as not
80 # to load the internationalization machinery.
81 USE_I18N = True
82
83 # If you set this to False, Django will not format dates, numbers and
84 # calendars according to the current locale
85 USE_L10N = True
86
87 # Absolute path to the directory that holds media.
88 # Example: "/home/media/media.lawrence.com/"
89 MEDIA_ROOT = ''
90
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/"
94 MEDIA_URL = ''
95
96 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
97 # trailing slash.
98 # Examples: "http://foo.com/media/", "/media/".
99 ADMIN_MEDIA_PREFIX = '/admin/media/'
100
101 # Make this unique, and don't share it with anybody.
102 SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'
103
104 # List of callables that know how to import templates from various sources.
105 TEMPLATE_LOADERS = (
106     'django.template.loaders.filesystem.Loader',
107     'django.template.loaders.app_directories.Loader',
108 #     'django.template.loaders.eggs.Loader',
109 )
110
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"
117 )
118
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',
129 )
130
131 AUTHENTICATION_BACKENDS = (
132     'flowspy.djangobackends.shibauthBackend.shibauthBackend',
133     'django.contrib.auth.backends.ModelBackend',
134 )
135
136 ROOT_URLCONF = 'flowspy.urls'
137
138 STATIC_URL = '/path/to/static'
139
140 TEMPLATE_DIRS = (
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.
145 )
146
147 INSTALLED_APPS = (
148     'monkey_patch',
149     'django.contrib.auth',
150     'django.contrib.contenttypes',
151     'django.contrib.sessions',
152     'django.contrib.sites',
153     'django.contrib.messages',
154     'django.contrib.flatpages',
155     'flowspec',
156     'poller',
157     'south',
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',
162     'django_extensions',
163     'djcelery',
164     'peers',
165         'registration',
166     'accounts',
167     'tinymce',
168 )
169
170 LOGIN_URL = '/fod/welcome'
171
172 CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
173
174 AUTH_PROFILE_MODULE = 'accounts.UserProfile'
175
176 NETCONF_DEVICE = ""
177 NETCONF_USER = ""
178 NETCONF_PASS = ""
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
183 COMMIT = True
184
185 USE_X_FORWARDED_HOST = True
186
187 BROKER_HOST = "localhost"
188 BROKER_PORT = 11300
189 POLLS_TUBE = 'polls'
190
191 BROKER_VHOST = "/"
192 CELERY_CONCURRENCY = 1
193
194 # List of modules to import when celery starts.
195 CELERY_IMPORTS = ("flowspec.tasks", )
196
197 SERVER_EMAIL = "GRNET FoD Service <noreply@example.com>"
198 EMAIL_SUBJECT_PREFIX = "[FoD] "
199
200 LOG_FILE_LOCATION = here("log")
201
202 EXPIRATION_NOTIFY_DAYS = 4
203 PREFIX_LENGTH = 29
204 POLL_SESSION_UPDATE = 60.0
205
206 BROKER_URL = "beanstalk://localhost:11300//"
207
208 SHIB_AUTH_ENTITLEMENT = 'urn:mace'
209 SHIB_ADMIN_DOMAIN = 'grnet.gr'
210 SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
211
212 # BCC mail addresses
213 NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
214
215 UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
216 UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
217
218 PROTECTED_SUBNETS = ['10.10.0.0/16']
219
220 CELERYBEAT_SCHEDULE = {
221     "every-day-sync": {
222         "task": "flowspec.tasks.check_sync",
223         "schedule": crontab(minute=01, hour=01),
224         "args": (),
225     },
226     "notify-expired": {
227         "task": "flowspec.tasks.notify_expired",
228         "schedule": crontab(minute=01, hour=02),
229         "args": (),
230     },
231 }
232 # whois
233 PRIMARY_WHOIS = 'whois.example.com'
234 ALTERNATE_WHOIS = 'whois.example.net'
235
236 ACCOUNT_ACTIVATION_DAYS = 7
237
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']
244
245 TINYMCE_JS_URL = '/fodstatic/js/tinymce/tiny_mce.js'
246
247 TINYMCE_DEFAULT_CONFIG = {
248     'extended_valid_elements' :  'iframe[src|width|height|name|align]',
249     'plugins': "table,spellchecker,paste,searchreplace",
250     'theme': "advanced",
251 }
252
253 import _version
254 SW_VERSION = _version.VERSION
255