settings.py.dist 6.2 KB
Newer Older
1
2
# Django settings for flowspy project.

3
4
5
6
import os
import djcelery
djcelery.setup_loader()
from celery.schedules import crontab
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
7
DEBUG = False
8
9
10
TEMPLATE_DEBUG = DEBUG

ADMINS = (
11
    ('AdminName', 'adminmail@admin.com'),
12
13
)

14
15
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)

16
17


18
19
20
21
MANAGERS = ADMINS

DATABASES = {
    'default': {
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
22
23
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'flowspec',                      # Or path to database file if using sqlite3.
24
25
26
27
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
28
        'OPTIONS':  {
29
        "init_command": "SET storage_engine=MYISAM",
30
        }
31
32
33
34
35
36
37
38
39
40
    }
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
41
42
43
44
45
46
47
48
49
50
TIME_ZONE = 'Europe/Athens'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
_ = lambda s: s

LANGUAGES = (
    ('el', _('Greek')),
    ('en', _('English')),
)
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
78
ADMIN_MEDIA_PREFIX = '/admin/media/'
79
80
81
82
83
84
85
86
87
88
89

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'fju0e4zu-thi7qf@93voi5eeot21@a*e54)%89xe-7iorqcimk'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

90
91
92
93
94
95
96
97
TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.contrib.messages.context_processors.messages"
)

98
MIDDLEWARE_CLASSES = (
99
    'django.middleware.cache.UpdateCacheMiddleware',
100
101
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
102
    'django.middleware.locale.LocaleMiddleware',
103
104
105
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
106
107
108
109
110
111
    'django.middleware.cache.FetchFromCacheMiddleware',
)

AUTHENTICATION_BACKENDS = (
    'flowspy.djangobackends.shibauthBackend.shibauthBackend',
    'django.contrib.auth.backends.ModelBackend',
112
113
114
115
)

ROOT_URLCONF = 'flowspy.urls'

Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
116
STATIC_URL = '/path/to/static'
117

118
TEMPLATE_DIRS = (
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
119
    '/path/to/templates/',
120
121
122
123
124
125
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
)

INSTALLED_APPS = (
126
    'monkey_patch',
127
128
129
130
131
132
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'flowspec',
133
    'poller',
134
    'south',
135
    # Uncomment the next line to enable the admin:
136
    'django.contrib.admin',
137
    # Uncomment the next line to enable admin documentation:
138
139
140
141
    'django.contrib.admindocs',
    'django_extensions',
    'djcelery',
    'peers',
142
	'registration',
143
    'accounts'
144
)
145
146
147

LOGIN_URL = '/fod/welcome'

148
CACHE_BACKEND = "memcached://127.0.0.1:11211/?timeout=3600"
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165

AUTH_PROFILE_MODULE = 'accounts.UserProfile'

NETCONF_DEVICE = ""
NETCONF_USER = ""
NETCONF_PASS = ""
ROUTES_FILTER = "<configuration><routing-options><flow/></routing-options></configuration>"
ROUTE_FILTER = "<configuration><routing-options><flow><route><name>%s</name></route></flow></routing-options></configuration>"
COMMIT_CONFIRMED_TIMEOUT = "120"
EXPIRATION_DAYS_OFFSET = 7
COMMIT = True

USE_X_FORWARDED_HOST = True

BROKER_HOST = "localhost"
BROKER_PORT = 11300
POLLS_TUBE = 'polls'
166

167
168
169
170
171
172
BROKER_VHOST = "/"
CELERY_CONCURRENCY = 1

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

173
SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>"
174
175
176
177
178
EMAIL_SUBJECT_PREFIX = "[FoD] "

LOG_FILE_LOCATION = here("log")

EXPIRATION_NOTIFY_DAYS = 4
179
PREFIX_LENGTH = 29 
180
POLL_SESSION_UPDATE = 60.0
181
182
183

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

184
SHIB_AUTH_ENTITLEMENT = 'urn:mace'
185
SHIB_ADMIN_DOMAIN = 'grnet.gr'
186
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'
187

Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
188
189
# BCC mail addresses
NOTIFY_ADMIN_MAILS = ["admin@admin.com"]
190
191

UI_USER_THEN_ACTIONS = ['discard', 'rate-limit']
192
UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp']
193
194
195

PROTECTED_SUBNETS = ['10.10.0.0/16']

196
CELERYBEAT_SCHEDULE = { 
197
198
    "every-day-sync": {
        "task": "flowspec.tasks.check_sync",
199
        "schedule": crontab(minute=01, hour=01),
200
201
        "args": (),
    },
202
203
204
205
206
    "notify-expired": {
        "task": "flowspec.tasks.notify_expired",
        "schedule": crontab(minute=01, hour=02),
        "args": (),
    },
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
207
}
208
209
210
# whois
PRIMARY_WHOIS = 'whois.grnet.gr'
ALTERNATE_WHOIS = 'whois.ripe.net'
Leonidas Poulopoulos's avatar
Leonidas Poulopoulos committed
211

212
ACCOUNT_ACTIVATION_DAYS = 7