root / flowspy / settings.py.dist @ 8b295414
History | View | Annotate | Download (10.5 kB)
1 |
# -*- coding: utf-8 -*- vim:fileencoding=utf-8: |
---|---|
2 |
# vim: tabstop=4:shiftwidth=4:softtabstop=4:expandtab |
3 |
# Django settings for flowspy project. |
4 |
|
5 |
# Copyright © 2011-2015 Greek Research and Technology Network (GRNET S.A.) |
6 |
# Copyright © 2011-2014 Leonidas Poulopoulos (@leopoul) |
7 |
# Copyright © 2014-2015 Stavros Kroustouris (@kroustou) |
8 |
# |
9 |
# This program is free software: you can redistribute it and/or modify |
10 |
# it under the terms of the GNU General Public License as published by |
11 |
# the Free Software Foundation, either version 3 of the License, or |
12 |
# (at your option) any later version. |
13 |
# |
14 |
# This program is distributed in the hope that it will be useful, |
15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 |
# GNU General Public License for more details. |
18 |
# |
19 |
# You should have received a copy of the GNU General Public License |
20 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
21 |
# |
22 |
|
23 |
import os |
24 |
import djcelery |
25 |
djcelery.setup_loader() |
26 |
from celery.schedules import crontab |
27 |
|
28 |
DEBUG = False |
29 |
TEMPLATE_DEBUG = DEBUG |
30 |
|
31 |
ADMINS = ( |
32 |
('AdminName', 'adminmail@admin.com'), |
33 |
) |
34 |
MANAGERS = ADMINS |
35 |
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x) |
36 |
|
37 |
|
38 |
DATABASES = { |
39 |
'default': { |
40 |
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
41 |
'NAME': '', # Or path to database file if using sqlite3. |
42 |
'USER': '', # Not used with sqlite3. |
43 |
'PASSWORD': '', # Not used with sqlite3. |
44 |
'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
45 |
'PORT': '', # Set to empty string for default. Not used with sqlite3. |
46 |
} |
47 |
} |
48 |
|
49 |
# Hosts/domain names that are valid for this site; required if DEBUG is False |
50 |
# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts |
51 |
ALLOWED_HOSTS = [] |
52 |
|
53 |
# Local time zone for this installation. Choices can be found here: |
54 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
55 |
# although not all choices may be available on all operating systems. |
56 |
# In a Windows environment this must be set to your system time zone. |
57 |
TIME_ZONE = 'Europe/Athens' |
58 |
|
59 |
# Language code for this installation. All choices can be found here: |
60 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
61 |
_ = lambda s: s |
62 |
|
63 |
LANGUAGES = ( |
64 |
('el', _('Greek')), |
65 |
('en', _('English')), |
66 |
) |
67 |
|
68 |
# Language code for this installation. All choices can be found here: |
69 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
70 |
LANGUAGE_CODE = 'en' |
71 |
|
72 |
LOCALE_PATHS = ( |
73 |
os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'locale'), |
74 |
) |
75 |
|
76 |
SITE_ID = 1 |
77 |
|
78 |
# If you set this to False, Django will make some optimizations so as not |
79 |
# to load the internationalization machinery. |
80 |
USE_I18N = True |
81 |
|
82 |
# If you set this to False, Django will not format dates, numbers and |
83 |
# calendars according to the current locale. |
84 |
USE_L10N = True |
85 |
|
86 |
# If you set this to False, Django will not use timezone-aware datetimes. |
87 |
USE_TZ = True |
88 |
|
89 |
# Absolute filesystem path to the directory that will hold user-uploaded files. |
90 |
# Example: "/home/media/media.lawrence.com/media/" |
91 |
MEDIA_ROOT = '' |
92 |
|
93 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
94 |
# trailing slash. |
95 |
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
96 |
MEDIA_URL = '' |
97 |
|
98 |
# Absolute path to the directory static files should be collected to. |
99 |
# Don't put anything in this directory yourself; store your static files |
100 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
101 |
# Example: "/home/media/media.lawrence.com/static/" |
102 |
STATIC_ROOT = '/path/to/projects/flowspy/static' |
103 |
|
104 |
# URL prefix for static files. |
105 |
# Example: "http://media.lawrence.com/static/" |
106 |
STATIC_URL = 'https://example.com/static/' |
107 |
|
108 |
# Additional locations of static files |
109 |
STATICFILES_DIRS = ( |
110 |
# Put strings here, like "/home/html/static" or "C:/www/django/static". |
111 |
# Always use forward slashes, even on Windows. |
112 |
# Don't forget to use absolute paths, not relative paths. |
113 |
) |
114 |
|
115 |
# List of finder classes that know how to find static files in |
116 |
# various locations. |
117 |
STATICFILES_FINDERS = ( |
118 |
'django.contrib.staticfiles.finders.FileSystemFinder', |
119 |
'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
120 |
# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
121 |
) |
122 |
|
123 |
# Make this unique, and don't share it with anybody. |
124 |
SECRET_KEY = '<PLACE RANDOM CHARS HERE>eg. @@5234#$%345345^@#$%*()123^@12!&!()$JMNDF#$@(@#8FRNJWX_' |
125 |
|
126 |
# List of callables that know how to import templates from various sources. |
127 |
TEMPLATE_LOADERS = ( |
128 |
'django.template.loaders.filesystem.Loader', |
129 |
'django.template.loaders.app_directories.Loader', |
130 |
# 'django.template.loaders.eggs.Loader', |
131 |
) |
132 |
|
133 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
134 |
"django.contrib.auth.context_processors.auth", |
135 |
"django.core.context_processors.debug", |
136 |
"django.core.context_processors.i18n", |
137 |
"django.core.context_processors.media", |
138 |
"django.core.context_processors.static", |
139 |
"django.contrib.messages.context_processors.messages", |
140 |
"context.global_vars.settings_vars", |
141 |
) |
142 |
|
143 |
MIDDLEWARE_CLASSES = ( |
144 |
'django.middleware.cache.UpdateCacheMiddleware', |
145 |
'django.middleware.common.CommonMiddleware', |
146 |
'django.contrib.sessions.middleware.SessionMiddleware', |
147 |
'django.middleware.locale.LocaleMiddleware', |
148 |
'django.middleware.csrf.CsrfViewMiddleware', |
149 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
150 |
'django.contrib.messages.middleware.MessageMiddleware', |
151 |
# Uncomment the next line for simple clickjacking protection: |
152 |
# 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
153 |
'django.middleware.cache.FetchFromCacheMiddleware', |
154 |
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', |
155 |
) |
156 |
|
157 |
ROOT_URLCONF = 'flowspy.urls' |
158 |
|
159 |
# Python dotted path to the WSGI application used by Django's runserver. |
160 |
WSGI_APPLICATION = 'flowspy.wsgi.application' |
161 |
|
162 |
AUTHENTICATION_BACKENDS = ( |
163 |
'djangobackends.shibauthBackend.shibauthBackend', |
164 |
'django.contrib.auth.backends.ModelBackend', |
165 |
) |
166 |
|
167 |
TEMPLATE_DIRS = ( |
168 |
'/path/to/templates/', |
169 |
'/path/to/rest_framework/templates/', |
170 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
171 |
# Always use forward slashes, even on Windows. |
172 |
# Don't forget to use absolute paths, not relative paths. |
173 |
) |
174 |
|
175 |
INSTALLED_APPS = ( |
176 |
'longerusername', |
177 |
'django.contrib.auth', |
178 |
'django.contrib.contenttypes', |
179 |
'django.contrib.sessions', |
180 |
'django.contrib.sites', |
181 |
'django.contrib.flatpages', |
182 |
'django.contrib.messages', |
183 |
'django.contrib.staticfiles', |
184 |
'flowspec', |
185 |
'poller', |
186 |
'south', |
187 |
# Uncomment the next line to enable the admin: |
188 |
'django.contrib.admin', |
189 |
# Uncomment the next line to enable admin documentation: |
190 |
# 'django.contrib.admindocs', |
191 |
'djcelery', |
192 |
'peers', |
193 |
'rest_framework', |
194 |
'registration', |
195 |
'accounts', |
196 |
'tinymce', |
197 |
'widget_tweaks', |
198 |
) |
199 |
|
200 |
# A sample logging configuration. The only tangible logging |
201 |
# performed by this configuration is to send an email to |
202 |
# the site admins on every HTTP 500 error when DEBUG=False. |
203 |
# See http://docs.djangoproject.com/en/dev/topics/logging for |
204 |
# more details on how to customize your logging configuration. |
205 |
LOGGING = { |
206 |
'version': 1, |
207 |
'disable_existing_loggers': False, |
208 |
'filters': { |
209 |
'require_debug_false': { |
210 |
'()': 'django.utils.log.RequireDebugFalse' |
211 |
} |
212 |
}, |
213 |
'handlers': { |
214 |
'mail_admins': { |
215 |
'level': 'ERROR', |
216 |
'filters': ['require_debug_false'], |
217 |
'class': 'django.utils.log.AdminEmailHandler' |
218 |
} |
219 |
}, |
220 |
'loggers': { |
221 |
'django.request': { |
222 |
'handlers': ['mail_admins'], |
223 |
'level': 'ERROR', |
224 |
'propagate': True, |
225 |
}, |
226 |
} |
227 |
} |
228 |
|
229 |
LOGIN_URL = '/welcome' |
230 |
|
231 |
# CACHES = { |
232 |
# 'default': { |
233 |
# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', |
234 |
# 'LOCATION': '127.0.0.1:11211', |
235 |
# } |
236 |
# } |
237 |
CACHES = { |
238 |
'default': { |
239 |
'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
240 |
} |
241 |
} |
242 |
|
243 |
AUTH_PROFILE_MODULE = 'accounts.UserProfile' |
244 |
|
245 |
NETCONF_DEVICE = "" |
246 |
NETCONF_USER = "" |
247 |
NETCONF_PASS = "" |
248 |
NETCONF_PORT = 830 |
249 |
|
250 |
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>" |
251 |
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>" |
252 |
COMMIT_CONFIRMED_TIMEOUT = "120" |
253 |
EXPIRATION_DAYS_OFFSET = 7 |
254 |
COMMIT = True |
255 |
|
256 |
USE_X_FORWARDED_HOST = True |
257 |
|
258 |
BROKER_HOST = "localhost" |
259 |
BROKER_PORT = 11300 |
260 |
POLLS_TUBE = 'polls' |
261 |
|
262 |
BROKER_VHOST = "/" |
263 |
CELERY_CONCURRENCY = 1 |
264 |
|
265 |
# List of modules to import when celery starts. |
266 |
CELERY_IMPORTS = ("flowspec.tasks", ) |
267 |
|
268 |
SERVER_EMAIL = "Example FoD Service <noreply@example.com>" |
269 |
EMAIL_SUBJECT_PREFIX = "[FoD] " |
270 |
|
271 |
EXPIRATION_NOTIFY_DAYS = 4 |
272 |
PREFIX_LENGTH = 29 |
273 |
POLL_SESSION_UPDATE = 60.0 |
274 |
|
275 |
BROKER_URL = "beanstalk://localhost:11300//" |
276 |
|
277 |
SHIB_AUTH_ENTITLEMENT = 'urn:mace' |
278 |
SHIB_ADMIN_DOMAIN = 'grnet.gr' |
279 |
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout' |
280 |
|
281 |
# BCC mail addresses |
282 |
NOTIFY_ADMIN_MAILS = ["admin@admin.com"] |
283 |
|
284 |
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit'] |
285 |
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp'] |
286 |
|
287 |
PROTECTED_SUBNETS = ['10.10.0.0/16'] |
288 |
|
289 |
CELERYBEAT_SCHEDULE = { |
290 |
"every-day-sync": { |
291 |
"task": "flowspec.tasks.check_sync", |
292 |
"schedule": crontab(minute=01, hour=01), |
293 |
"args": (), |
294 |
}, |
295 |
"notify-expired": { |
296 |
"task": "flowspec.tasks.notify_expired", |
297 |
"schedule": crontab(minute=01, hour=02), |
298 |
"args": (), |
299 |
}, |
300 |
} |
301 |
# whois |
302 |
PRIMARY_WHOIS = 'whois.example.com' |
303 |
ALTERNATE_WHOIS = 'whois.example.net' |
304 |
|
305 |
ACCOUNT_ACTIVATION_DAYS = 7 |
306 |
|
307 |
#Shibboleth attribute map |
308 |
SHIB_USERNAME = ['HTTP_EPPN'] |
309 |
SHIB_SLUGIFY_USERNAME = False |
310 |
|
311 |
SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL'] |
312 |
SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME'] |
313 |
SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME'] |
314 |
SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT'] |
315 |
|
316 |
TINYMCE_JS_URL = STATIC_URL +'js/tinymce/tiny_mce.js' |
317 |
|
318 |
TINYMCE_DEFAULT_CONFIG = { |
319 |
'extended_valid_elements' : 'iframe[src|width|height|name|align]', |
320 |
'plugins': "table,spellchecker,paste,searchreplace", |
321 |
'theme': "advanced", |
322 |
} |
323 |
|
324 |
import _version |
325 |
SW_VERSION = _version.VERSION |
326 |
|
327 |
LOG_FILE_LOCATION = "/var/log/fod" |
328 |
|
329 |
# Change the following values only if you know what you are doing!!! |
330 |
# To integrate FoD with tables (Peer, Networks, Contacts) |
331 |
# from your CRM platform, set the following values to False and create the views that are |
332 |
# exact matches of the tables in peers/models.py |
333 |
PEER_MANAGED_TABLE = True |
334 |
PEER_RANGE_MANAGED_TABLE = True |
335 |
PEER_TECHC_MANAGED_TABLE = True |
336 |
|
337 |
|