Statistics
| Branch: | Tag: | Revision:

root / flowspy / settings.py.dist @ 3ff6f95b

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
	'registration',
194
    'accounts',
195
    'tinymce',
196
    'widget_tweaks',
197
)
198

    
199
# A sample logging configuration. The only tangible logging
200
# performed by this configuration is to send an email to
201
# the site admins on every HTTP 500 error when DEBUG=False.
202
# See http://docs.djangoproject.com/en/dev/topics/logging for
203
# more details on how to customize your logging configuration.
204
LOGGING = {
205
    'version': 1,
206
    'disable_existing_loggers': False,
207
    'filters': {
208
        'require_debug_false': {
209
            '()': 'django.utils.log.RequireDebugFalse'
210
        }
211
    },
212
    'handlers': {
213
        'mail_admins': {
214
            'level': 'ERROR',
215
            'filters': ['require_debug_false'],
216
            'class': 'django.utils.log.AdminEmailHandler'
217
        }
218
    },
219
    'loggers': {
220
        'django.request': {
221
            'handlers': ['mail_admins'],
222
            'level': 'ERROR',
223
            'propagate': True,
224
        },
225
    }
226
}
227

    
228
LOGIN_URL = '/welcome'
229

    
230
# CACHES = {
231
#     'default': {
232
#         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
233
#         'LOCATION': '127.0.0.1:11211',
234
#     }
235
# }
236
CACHES = {
237
    'default': {
238
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
239
    }
240
}
241

    
242
AUTH_PROFILE_MODULE = 'accounts.UserProfile'
243

    
244
NETCONF_DEVICE = ""
245
NETCONF_USER = ""
246
NETCONF_PASS = ""
247
NETCONF_PORT = 830
248

    
249
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
250
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
251
COMMIT_CONFIRMED_TIMEOUT = "120"
252
EXPIRATION_DAYS_OFFSET = 7
253
COMMIT = True
254

    
255
USE_X_FORWARDED_HOST = True
256

    
257
BROKER_HOST = "localhost"
258
BROKER_PORT = 11300
259
POLLS_TUBE = 'polls'
260

    
261
BROKER_VHOST = "/"
262
CELERY_CONCURRENCY = 1
263

    
264
# List of modules to import when celery starts.
265
CELERY_IMPORTS = ("flowspec.tasks", )
266

    
267
SERVER_EMAIL = "Example FoD Service <noreply@example.com>"
268
EMAIL_SUBJECT_PREFIX = "[FoD] "
269

    
270
EXPIRATION_NOTIFY_DAYS = 4
271
PREFIX_LENGTH = 29
272
POLL_SESSION_UPDATE = 60.0
273

    
274
BROKER_URL = "beanstalk://localhost:11300//"
275

    
276
SHIB_AUTH_ENTITLEMENT = 'urn:mace'
277
SHIB_ADMIN_DOMAIN = 'grnet.gr'
278
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
279

    
280
# BCC mail addresses
281
NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
282

    
283
UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
284
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
285

    
286
PROTECTED_SUBNETS = ['10.10.0.0/16']
287

    
288
CELERYBEAT_SCHEDULE = {
289
    "every-day-sync": {
290
        "task": "flowspec.tasks.check_sync",
291
        "schedule": crontab(minute=01, hour=01),
292
        "args": (),
293
    },
294
    "notify-expired": {
295
        "task": "flowspec.tasks.notify_expired",
296
        "schedule": crontab(minute=01, hour=02),
297
        "args": (),
298
    },
299
}
300
# whois
301
PRIMARY_WHOIS = 'whois.example.com'
302
ALTERNATE_WHOIS = 'whois.example.net'
303

    
304
ACCOUNT_ACTIVATION_DAYS = 7
305

    
306
#Shibboleth attribute map
307
SHIB_USERNAME = ['HTTP_EPPN']
308
SHIB_SLUGIFY_USERNAME = False
309

    
310
SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
311
SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
312
SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
313
SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']
314

    
315
TINYMCE_JS_URL = STATIC_URL +'js/tinymce/tiny_mce.js'
316

    
317
TINYMCE_DEFAULT_CONFIG = {
318
    'extended_valid_elements' :  'iframe[src|width|height|name|align]',
319
    'plugins': "table,spellchecker,paste,searchreplace",
320
    'theme': "advanced",
321
}
322

    
323
import _version
324
SW_VERSION = _version.VERSION
325

    
326
LOG_FILE_LOCATION = "/var/log/fod"
327

    
328
# Change the following values only if you know what you are doing!!!
329
# To integrate FoD with tables (Peer, Networks, Contacts)
330
# from your CRM platform, set the following values to False and create the views that are
331
# exact matches of the tables in peers/models.py
332
PEER_MANAGED_TABLE = True
333
PEER_RANGE_MANAGED_TABLE = True
334
PEER_TECHC_MANAGED_TABLE = True
335

    
336