Revision 04a38bd0
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Admin names and email addresses |
|
4 |
################################## |
|
5 |
|
|
6 |
ADMINS = ( |
|
7 |
# ('Your Name', 'your_email@domain.com'), |
|
8 |
) |
|
9 |
|
|
10 |
MANAGERS = ADMINS |
|
11 |
|
|
12 |
# Email configuration |
|
13 |
EMAIL_HOST = "127.0.0.1" |
|
14 |
EMAIL_HOST_USER = "" |
|
15 |
EMAIL_HOST_PASSWORD = "" |
|
16 |
EMAIL_SUBJECT_PREFIX = "[email-subject-prefix] " |
|
17 |
DEFAULT_CHARSET = 'utf-8' |
|
18 |
|
|
19 |
# Address to use for outgoing emails |
|
20 |
DEFAULT_FROM_EMAIL = "~okeanos <no-reply@grnet.gr>" |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Core Django settings |
|
4 |
################################## |
|
5 |
|
|
6 |
INSTALLED_APPS = ( |
|
7 |
'django.contrib.contenttypes', |
|
8 |
'django.contrib.sessions', |
|
9 |
'django.contrib.sites', |
|
10 |
'django.contrib.messages', |
|
11 |
'django.contrib.admin', |
|
12 |
'synnefo.aai', |
|
13 |
'synnefo.admin', |
|
14 |
'synnefo.api', |
|
15 |
'synnefo.ui', |
|
16 |
'synnefo.db', |
|
17 |
'synnefo.logic', |
|
18 |
'synnefo.invitations', |
|
19 |
'synnefo.helpdesk', |
|
20 |
'synnefo.ui.userdata', |
|
21 |
|
|
22 |
'south' |
|
23 |
) |
|
24 |
|
|
25 |
SESSION_ENGINE = "django.contrib.sessions.backends.cache" |
|
26 |
|
|
27 |
# List of callables that know how to import templates from various sources. |
|
28 |
TEMPLATE_LOADERS = ( |
|
29 |
'django.template.loaders.filesystem.Loader', |
|
30 |
'django.template.loaders.app_directories.Loader', |
|
31 |
# 'django.template.loaders.eggs.Loader', |
|
32 |
) |
|
33 |
|
|
34 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
|
35 |
'django.core.context_processors.request', |
|
36 |
'django.core.context_processors.i18n', |
|
37 |
'django.contrib.auth.context_processors.auth', |
|
38 |
'django.core.context_processors.media' |
|
39 |
) |
|
40 |
|
|
41 |
MIDDLEWARE_CLASSES = ( |
|
42 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
43 |
'synnefo.aai.middleware.SynnefoAuthMiddleware', |
|
44 |
'synnefo.api.middleware.ApiAuthMiddleware', |
|
45 |
'synnefo.helpdesk.middleware.HelpdeskMiddleware', |
|
46 |
'django.middleware.locale.LocaleMiddleware', |
|
47 |
'django.middleware.common.CommonMiddleware', |
|
48 |
'django.contrib.messages.middleware.MessageMiddleware' |
|
49 |
) |
|
50 |
|
|
51 |
ROOT_URLCONF = 'synnefo.urls' |
|
52 |
|
|
53 |
TEMPLATE_DIRS = ( |
|
54 |
# Put strings here, like "/home/html/django_templates" |
|
55 |
# or "C:/www/django/templates". |
|
56 |
# Always use forward slashes, even on Windows. |
|
57 |
# Don't forget to use absolute paths, not relative paths. |
|
58 |
) |
|
59 |
|
|
60 |
LANGUAGES = ( |
|
61 |
#('el', u'Ελληνικά'), |
|
62 |
('en', 'English'), |
|
63 |
) |
|
64 |
|
|
65 |
# Local time zone for this installation. Choices can be found here: |
|
66 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
67 |
# although not all choices may be available on all operating systems. |
|
68 |
# On Unix systems, a value of None will cause Django to use the same |
|
69 |
# timezone as the operating system. |
|
70 |
# If running in a Windows environment this must be set to the same as your |
|
71 |
# system time zone. |
|
72 |
TIME_ZONE = 'UTC' # Warning: The API depends on the TIME_ZONE being UTC |
|
73 |
|
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Deployment |
|
4 |
################################## |
|
5 |
|
|
6 |
DEBUG = True |
|
7 |
TEMPLATE_DEBUG = DEBUG |
|
8 |
|
|
9 |
# Top-level URL for deployment. Numerous other URLs depend on this. |
|
10 |
APP_INSTALL_URL = "https://host:port" |
|
11 |
|
|
12 |
# Make this unique, and don't share it with anybody. |
|
13 |
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg' |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Logging configuration |
|
4 |
################################## |
|
5 |
|
|
6 |
LOGGING = { |
|
7 |
'version': 1, |
|
8 |
'disable_existing_loggers': True, |
|
9 |
|
|
10 |
'formatters': { |
|
11 |
'simple': { |
|
12 |
'format': '%(message)s' |
|
13 |
}, |
|
14 |
'verbose': { |
|
15 |
'format': '%(asctime)s [%(levelname)s] %(message)s' |
|
16 |
}, |
|
17 |
'django': { |
|
18 |
'format': '[%(asctime)s] %(levelname)s %(message)s', |
|
19 |
'datefmt': '%d/%b/%Y %H:%M:%S' |
|
20 |
}, |
|
21 |
}, |
|
22 |
|
|
23 |
'handlers': { |
|
24 |
'null': { |
|
25 |
'class': 'logging.NullHandler', |
|
26 |
}, |
|
27 |
'console': { |
|
28 |
'class': 'logging.StreamHandler', |
|
29 |
'formatter': 'django' |
|
30 |
}, |
|
31 |
'syslog': { |
|
32 |
'class': 'logging.handlers.SysLogHandler', |
|
33 |
'address': '/dev/log', |
|
34 |
# 'address': ('localhost', 514), |
|
35 |
'facility': 'daemon', |
|
36 |
'formatter': 'verbose', |
|
37 |
'level': 'INFO', |
|
38 |
}, |
|
39 |
}, |
|
40 |
|
|
41 |
'loggers': { |
|
42 |
'synnefo': { |
|
43 |
'handlers': ['syslog'], |
|
44 |
'level': 'INFO' |
|
45 |
}, |
|
46 |
'synnefo.admin': { |
|
47 |
'level': 'INFO', |
|
48 |
'propagate': 1 |
|
49 |
}, |
|
50 |
'synnefo.api': { |
|
51 |
'level': 'INFO', |
|
52 |
'propagate': 1 |
|
53 |
}, |
|
54 |
'synnefo.db': { |
|
55 |
'level': 'INFO', |
|
56 |
'propagate': 1 |
|
57 |
}, |
|
58 |
'synnefo.logic': { |
|
59 |
'level': 'INFO', |
|
60 |
'propagate': 1 |
|
61 |
}, |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
|
|
66 |
DISPATCHER_LOGGING = { |
|
67 |
'version': 1, |
|
68 |
'disable_existing_loggers': True, |
|
69 |
|
|
70 |
'formatters': { |
|
71 |
'verbose': { |
|
72 |
'format': '%(asctime)s [%(levelname)s] %(message)s' |
|
73 |
}, |
|
74 |
}, |
|
75 |
|
|
76 |
'handlers': { |
|
77 |
'console': { |
|
78 |
'class': 'logging.StreamHandler', |
|
79 |
'formatter': 'verbose' |
|
80 |
}, |
|
81 |
'file': { |
|
82 |
'class': 'logging.handlers.WatchedFileHandler', |
|
83 |
'filename': '/var/log/synnefo/dispatcher.log', |
|
84 |
'formatter': 'verbose', |
|
85 |
'level': 'DEBUG' |
|
86 |
}, |
|
87 |
}, |
|
88 |
|
|
89 |
'loggers': { |
|
90 |
'synnefo': {'propagate': 1} |
|
91 |
}, |
|
92 |
|
|
93 |
'root': { |
|
94 |
'handlers': ['console', 'file'], |
|
95 |
'level': 'DEBUG', |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
|
|
100 |
SNFADMIN_LOGGING = { |
|
101 |
'version': 1, |
|
102 |
'disable_existing_loggers': True, |
|
103 |
|
|
104 |
'formatters': { |
|
105 |
'verbose': { |
|
106 |
'format': '%(asctime)s [%(levelname)s] %(message)s' |
|
107 |
}, |
|
108 |
}, |
|
109 |
|
|
110 |
'handlers': { |
|
111 |
'console': { |
|
112 |
'class': 'logging.StreamHandler', |
|
113 |
'formatter': 'verbose' |
|
114 |
}, |
|
115 |
}, |
|
116 |
|
|
117 |
'loggers': { |
|
118 |
'synnefo': {'propagate': 1} |
|
119 |
}, |
|
120 |
|
|
121 |
'root': { |
|
122 |
'handlers': ['console'], |
|
123 |
'level': 'DEBUG', |
|
124 |
} |
|
125 |
} |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Site-specific Django conf |
|
4 |
################################## |
|
5 |
|
|
6 |
# Language code for this installation. All choices can be found here: |
|
7 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
|
8 |
LANGUAGE_CODE = 'en-us' |
|
9 |
|
|
10 |
# FIXME? |
|
11 |
SITE_ID = 1 |
|
12 |
|
|
13 |
# If you set this to False, Django will make some optimizations so as not |
|
14 |
# to load the internationalization machinery. |
|
15 |
USE_I18N = True |
|
16 |
|
|
17 |
# If you set this to False, Django will not format dates, numbers and |
|
18 |
# calendars according to the current locale |
|
19 |
USE_L10N = True |
|
20 |
|
|
21 |
# Absolute path to the directory that holds media. |
|
22 |
# Example: "/home/media/media.lawrence.com/" |
|
23 |
MEDIA_ROOT = '' |
|
24 |
|
|
25 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
26 |
# trailing slash if there is a path component (optional in other cases). |
|
27 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
28 |
MEDIA_URL = '/static/' |
|
29 |
|
|
30 |
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
31 |
# trailing slash. |
|
32 |
# Examples: "http://foo.com/media/", "/media/". |
|
33 |
ADMIN_MEDIA_PREFIX = '/media/' |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Ganeti backend configuration |
|
4 |
################################### |
|
5 |
|
|
6 |
# The RAPI endpoint and associated credentials to use |
|
7 |
# for talking to the Ganeti backend. |
|
8 |
GANETI_MASTER_IP = "10.0.0.1" |
|
9 |
GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "username", "password") |
|
10 |
|
|
11 |
# This prefix gets used when determining the instance names |
|
12 |
# of Synnefo VMs at the Ganeti backend. |
|
13 |
# The dash must always appear in the name! |
|
14 |
BACKEND_PREFIX_ID = "snf-" |
|
15 |
|
|
16 |
# The following dictionary defines deployment-specific |
|
17 |
# arguments to the RAPI CreateInstance call. |
|
18 |
# At a minimum it should contain the |
|
19 |
# 'disk_template', 'os_provider', and 'hvparams' keys. |
|
20 |
# |
|
21 |
# More specifically: |
|
22 |
# a) disk_template: |
|
23 |
# The disk template to use when creating the instance. |
|
24 |
# Suggested values: 'plain', or 'drbd'. |
|
25 |
# b) os: |
|
26 |
# The OS provider to use (customized Ganeti Instance Image) |
|
27 |
# c) hvparams: |
|
28 |
# Hypervisor-specific parameters (serial_console = False, see #785) |
|
29 |
# d) If using the DRBD disk_template, you may want to include |
|
30 |
# wait_for_sync = False (see #835). |
|
31 |
# |
|
32 |
GANETI_CREATEINSTANCE_KWARGS = { |
|
33 |
'os': 'snf-image+default', |
|
34 |
'hvparams': {'serial_console': False}, |
|
35 |
'wait_for_sync': False} |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Database settings |
|
4 |
#################### |
|
5 |
|
|
6 |
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/' |
|
7 |
|
|
8 |
DATABASES = { |
|
9 |
'default': { |
|
10 |
# 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle' |
|
11 |
'ENGINE': 'sqlite3', |
|
12 |
# ATTENTION: This *must* be the absolute path if using sqlite3. |
|
13 |
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name |
|
14 |
'NAME': os.path.join(PROJECT_PATH, 'database.sqlite'), |
|
15 |
'USER': '', # Not used with sqlite3. |
|
16 |
'PASSWORD': '', # Not used with sqlite3. |
|
17 |
# Set to empty string for localhost. Not used with sqlite3. |
|
18 |
'HOST': '', |
|
19 |
# Set to empty string for default. Not used with sqlite3. |
|
20 |
'PORT': '', |
|
21 |
} |
|
22 |
} |
|
23 |
|
|
24 |
if DATABASES['default']['ENGINE'].endswith('mysql'): |
|
25 |
DATABASES['default']['OPTIONS'] = { |
|
26 |
'init_command': 'SET storage_engine=INNODB; ' + |
|
27 |
'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', |
|
28 |
} |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Queues, exchanges and bindings for AMQP |
|
4 |
########################################### |
|
5 |
|
|
6 |
# Rabbit work queue endpoint |
|
7 |
RABBIT_HOST = "10.0.0.1:5672" |
|
8 |
RABBIT_USERNAME = "username" |
|
9 |
RABBIT_PASSWORD = "password" |
|
10 |
RABBIT_VHOST = "/" |
|
11 |
|
|
12 |
EXCHANGE_GANETI = "ganeti" # Messages from Ganeti |
|
13 |
EXCHANGE_CRON = "cron" # Messages from periodically triggered tasks |
|
14 |
EXCHANGE_API = "api" # Messages from the REST API |
|
15 |
EXCHANGES = (EXCHANGE_GANETI, EXCHANGE_CRON, EXCHANGE_API) |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# API configuration |
|
4 |
##################### |
|
5 |
|
|
6 |
# The API implementation needs to accept and return absolute references |
|
7 |
# to its resources. Thus, it needs to know its public URL. |
|
8 |
API_ROOT_URL = APP_INSTALL_URL + '/api' |
|
9 |
|
|
10 |
# The API will return HTTP Bad Request if the ?changes-since |
|
11 |
# parameter refers to a point in time more than POLL_LIMIT seconds ago. |
|
12 |
POLL_LIMIT = 3600 |
|
13 |
|
|
14 |
# |
|
15 |
# Network Configuration |
|
16 |
# |
|
17 |
|
|
18 |
# Synnefo assigns this link id to NICs connected on the public network. |
|
19 |
# An IP pool should be associated with this link by the Ganeti administrator. |
|
20 |
GANETI_PUBLIC_LINK = 'snf_public' |
|
21 |
# This link id is assigned to NICs that should be isolated from anything else |
|
22 |
# (e.g., right before the NIC gets deleted). |
|
23 |
# This value is also hardcoded in a fixture in db/fixtures/initial_data.json. |
|
24 |
GANETI_NULL_LINK = 'snf_null' |
|
25 |
|
|
26 |
# The pool of private network links to use is |
|
27 |
# $GANETI_LINK_PREFIX{1..$GANETI_MAX_LINK_NUMBER}. |
|
28 |
# |
|
29 |
# The prefix to use for private network links. |
|
30 |
GANETI_LINK_PREFIX = 'prv' |
|
31 |
# The number of private network links to use. |
|
32 |
GANETI_MAX_LINK_NUMBER = 100 |
|
33 |
# Firewalling |
|
34 |
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:0:protected' |
|
35 |
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:0:unprotected' |
|
36 |
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:0:limited' |
|
37 |
|
|
38 |
# The default firewall profile that will be in effect if no tags are defined |
|
39 |
DEFAULT_FIREWALL_PROFILE = 'DISABLED' |
|
40 |
|
|
41 |
# our REST API would prefer to be explicit about trailing slashes |
|
42 |
APPEND_SLASH = False |
|
43 |
|
|
44 |
# Ignore disk size specified by flavor, always build the |
|
45 |
# machine with a 4GB (in the case of Windows: 14GB) disk. |
|
46 |
# This setting is helpful in development setups. |
|
47 |
# |
|
48 |
IGNORE_FLAVOR_DISK_SIZES = False |
|
49 |
|
|
50 |
# Quota |
|
51 |
# |
|
52 |
# Maximum number of VMs a user is allowed to have |
|
53 |
MAX_VMS_PER_USER = 3 |
|
54 |
|
|
55 |
# URL templates for the stat graphs. |
|
56 |
# The API implementation replaces '%s' with the encrypted backend id. |
|
57 |
# FIXME: For now we do not encrypt the backend id. |
|
58 |
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png' |
|
59 |
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png' |
|
60 |
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png' |
|
61 |
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png' |
|
62 |
|
|
63 |
# Recommended refresh period for server stats |
|
64 |
STATS_REFRESH_PERIOD = 60 |
|
65 |
|
|
66 |
# The maximum number of file path/content pairs that can be supplied on server |
|
67 |
# build |
|
68 |
MAX_PERSONALITY = 5 |
|
69 |
|
|
70 |
# The maximum size, in bytes, for each personality file |
|
71 |
MAX_PERSONALITY_SIZE = 10240 |
|
72 |
|
|
73 |
# Available storage types to be used as disk templates |
|
74 |
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain', |
|
75 |
'rbd', 'sharedfile') |
|
76 |
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd' |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# UI settings |
|
4 |
################### |
|
5 |
|
|
6 |
# base url for ui static files |
|
7 |
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/' |
|
8 |
#UI_MEDIA_URL = MEDIA_URL + 'snf/' |
|
9 |
|
|
10 |
# UI requests to the API layer time out after that many milliseconds |
|
11 |
TIMEOUT = 10 * 1000 |
|
12 |
|
|
13 |
# A list of suggested server tags (server metadata keys) |
|
14 |
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"] |
|
15 |
|
|
16 |
# A list of allowed icons for OS Images |
|
17 |
IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux", |
|
18 |
"centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware", |
|
19 |
"suse", "kubuntu"] |
|
20 |
|
|
21 |
# How often should the UI request changes from the API |
|
22 |
UI_UPDATE_INTERVAL = 5000 |
|
23 |
|
|
24 |
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls |
|
25 |
# of recurrent api requests |
|
26 |
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4 |
|
27 |
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4 |
|
28 |
|
|
29 |
# Maximum update interval |
|
30 |
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3 |
|
31 |
|
|
32 |
# Fast update interval |
|
33 |
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2 |
|
34 |
|
|
35 |
# List of emails used for sending the feedback messages to (following the ADMINS format) |
|
36 |
FEEDBACK_CONTACTS = ( |
|
37 |
# ('Contact Name', 'contact_email@domain.com'), |
|
38 |
) |
|
39 |
|
|
40 |
# Email from which the feedback emails will be sent from |
|
41 |
FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL |
|
42 |
|
|
43 |
# URL to redirect user to when he logs out from the ui (if not set |
|
44 |
# settings.LOGIN_URL will be used) |
|
45 |
#LOGOUT_URL = "" |
|
46 |
|
|
47 |
# Flavor options that we provide to the user as predefined |
|
48 |
# cpu/ram/disk combinations on vm create wizard |
|
49 |
VM_CREATE_SUGGESTED_FLAVORS = { |
|
50 |
'small': { |
|
51 |
'cpu': 1, |
|
52 |
'ram': 1024, |
|
53 |
'disk': 20, |
|
54 |
'disk_template': 'drbd' |
|
55 |
}, |
|
56 |
'medium': { |
|
57 |
'cpu': 2, |
|
58 |
'ram': 2048, |
|
59 |
'disk': 30, |
|
60 |
'disk_template': 'drbd' |
|
61 |
|
|
62 |
}, |
|
63 |
'large': { |
|
64 |
'cpu': 4, |
|
65 |
'ram': 4096, |
|
66 |
'disk': 40, |
|
67 |
'disk_template': 'drbd' |
|
68 |
|
|
69 |
} |
|
70 |
} |
|
71 |
|
|
72 |
# A list of metadata keys to clone from image |
|
73 |
# to the virtual machine on its creation. |
|
74 |
VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain"] |
|
75 |
|
|
76 |
# A list of suggested vm roles to display to user on create wizard |
|
77 |
VM_CREATE_SUGGESTED_ROLES = ["Database server", "File server", "Mail server", "Web server", "Proxy"] |
|
78 |
|
|
79 |
# Template to be used for suggesting the user a default name for newly created |
|
80 |
# vms. {0} gets replaced by the image OS value |
|
81 |
VM_CREATE_NAME_TPL = "My {0} server" |
|
82 |
|
|
83 |
# Name/description metadata for the available flavor disk templates |
|
84 |
# Dict key is the disk_template value as stored in database |
|
85 |
UI_FLAVORS_DISK_TEMPLATES_INFO = { |
|
86 |
'drbd': {'name': 'DRBD', |
|
87 |
'description': 'DRBD storage.'}, |
|
88 |
} |
|
89 |
|
|
90 |
####################### |
|
91 |
# UI BEHAVIOUR SETTINGS |
|
92 |
####################### |
|
93 |
|
|
94 |
# Whether to increase the time of recurrent requests (networks/vms update) if |
|
95 |
# window loses its focus |
|
96 |
UI_DELAY_ON_BLUR = False |
|
97 |
|
|
98 |
# Whether not visible vm views will update their content if vm changes |
|
99 |
UI_UPDATE_HIDDEN_VIEWS = False |
|
100 |
|
|
101 |
# After how many timeouts of reccurent ajax requests to display the timeout |
|
102 |
# error overlay |
|
103 |
UI_SKIP_TIMEOUTS = 1 |
|
104 |
|
|
105 |
# Whether UI should display error overlay for all Javascript exceptions |
|
106 |
UI_HANDLE_WINDOW_EXCEPTIONS = True |
|
107 |
|
|
108 |
# A list of os names that support ssh public key assignment |
|
109 |
UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu', 'centos'] |
|
110 |
|
|
111 |
# OS/username map to identify default user name for the specified os |
|
112 |
UI_OS_DEFAULT_USER_MAP = { |
|
113 |
'debian':'root', 'fedora': 'root', 'okeanos': 'root', |
|
114 |
'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root', |
|
115 |
'windows': 'Administrator' |
|
116 |
} |
/dev/null | ||
---|---|---|
1 |
# Genetared SSH key bits length |
|
2 |
USERDATA_SSH_KEY_LENGTH = 2048 |
|
3 |
|
|
4 |
# Generated SSH key exponent |
|
5 |
USERDATA_SSH_KEY_EXPONENT = 65537 |
|
6 |
|
|
7 |
# Maximum number of ssh keys a user is allowed to have |
|
8 |
USERDATA_MAX_SSH_KEYS_PER_USER = 10 |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# AAI configuration |
|
4 |
##################### |
|
5 |
|
|
6 |
# Shibboleth-enabled path under the APP_INSTALL_URL. |
|
7 |
LOGIN_URL = "https://login.okeanos.grnet.gr" |
|
8 |
|
|
9 |
# Set the expiration time of newly created auth tokens |
|
10 |
# to be this many hours after their creation time. |
|
11 |
AUTH_TOKEN_DURATION = 30 * 24 |
|
12 |
|
|
13 |
# Enable receiving a temporary auth token (using the ?test URL parameter) that |
|
14 |
# bypasses the authentication mechanism. |
|
15 |
# |
|
16 |
# WARNING, ACHTUNG, README, etc: DO NOT ENABLE THIS ON DEPLOYED VERSIONS! |
|
17 |
# |
|
18 |
BYPASS_AUTHENTICATION = False |
|
19 |
|
|
20 |
# Urls that bypass Shibboleth authentication |
|
21 |
AAI_SKIP_AUTH_URLS = ['/api', '/invitations/login'] |
|
22 |
|
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
|
|
3 |
# Max number of invitations allowed per level |
|
4 |
INVITATIONS_PER_LEVEL = { |
|
5 |
#Level #Max Invitations |
|
6 |
0 : 10000, |
|
7 |
1 : 3, |
|
8 |
2 : 2, |
|
9 |
3 : 1, |
|
10 |
4 : 0 |
|
11 |
} |
|
12 |
|
|
13 |
# Key to encrypt X-Auth-Token with when sending invitations |
|
14 |
INVITATION_ENCR_KEY = '8d342f6e7a0366c632978a80257019af' |
|
15 |
|
|
16 |
# Days for which an invitation is active |
|
17 |
INVITATION_VALID_DAYS = 180 |
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Reconciliations |
|
4 |
################### |
|
5 |
|
|
6 |
# Minutes between reconciliations |
|
7 |
RECONCILIATION_MIN = 30 |
|
8 |
|
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Helpdesk application |
|
4 |
# |
|
5 |
|
|
6 |
# Duration for temporary auth tokens, created for impersonating a registered |
|
7 |
# user by helpdesk staff. |
|
8 |
HELPDESK_TOKEN_DURATION_MIN = 30 |
|
9 |
|
|
10 |
# IP addresses of the machines allowed to connect as help desk |
|
11 |
HELPDESK_ALLOWED_IPS = ("127.0.0.1",) |
|
12 |
|
/dev/null | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Special unit test mode |
|
4 |
######################### |
|
5 |
|
|
6 |
# A quick-n-dirty way which sets settings.TEST |
|
7 |
# if we're running unit tests. |
|
8 |
import sys |
|
9 |
TEST = False |
|
10 |
if len(sys.argv) >= 2: |
|
11 |
if os.path.basename(sys.argv[0]) == 'manage.py' and \ |
|
12 |
(sys.argv[1] == 'test' or sys.argv[1] == 'hudson'): |
|
13 |
TEST = True |
/dev/null | ||
---|---|---|
1 |
# Copyright 2011 GRNET S.A. All rights reserved. |
|
2 |
# |
|
3 |
# Redistribution and use in source and binary forms, with or |
|
4 |
# without modification, are permitted provided that the following |
|
5 |
# conditions are met: |
|
6 |
# |
|
7 |
# 1. Redistributions of source code must retain the above |
|
8 |
# copyright notice, this list of conditions and the following |
|
9 |
# disclaimer. |
|
10 |
# |
|
11 |
# 2. Redistributions in binary form must reproduce the above |
|
12 |
# copyright notice, this list of conditions and the following |
|
13 |
# disclaimer in the documentation and/or other materials |
|
14 |
# provided with the distribution. |
|
15 |
# |
|
16 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
|
17 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
18 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
19 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
|
20 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
21 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
22 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
23 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
24 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
25 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
26 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
27 |
# POSSIBILITY OF SUCH DAMAGE. |
|
28 |
# |
|
29 |
# The views and conclusions contained in the software and |
|
30 |
# documentation are those of the authors and should not be |
|
31 |
# interpreted as representing official policies, either expressed |
|
32 |
# or implied, of GRNET S.A. |
|
33 |
|
|
34 |
import os.path |
|
35 |
import glob |
|
36 |
|
|
37 |
from synnefo.settings_common import * |
|
38 |
|
|
39 |
SYNNEFO_DIST_SETTINGS_DIR = '/etc/synnefo' |
|
40 |
|
|
41 |
# extend common settings with settings set in /etc/synnefo dir |
|
42 |
conffiles = glob.glob(os.path.join(SYNNEFO_DIST_SETTINGS_DIR, '*.conf')) |
|
43 |
conffiles.sort() |
|
44 |
for f in conffiles: |
|
45 |
execfile(os.path.abspath(f)) |
|
46 |
|
|
47 |
|
b/synnefo/settings/__init__.py | ||
---|---|---|
1 |
# Copyright 2011 GRNET S.A. All rights reserved. |
|
2 |
# |
|
3 |
# Redistribution and use in source and binary forms, with or |
|
4 |
# without modification, are permitted provided that the following |
|
5 |
# conditions are met: |
|
6 |
# |
|
7 |
# 1. Redistributions of source code must retain the above |
|
8 |
# copyright notice, this list of conditions and the following |
|
9 |
# disclaimer. |
|
10 |
# |
|
11 |
# 2. Redistributions in binary form must reproduce the above |
|
12 |
# copyright notice, this list of conditions and the following |
|
13 |
# disclaimer in the documentation and/or other materials |
|
14 |
# provided with the distribution. |
|
15 |
# |
|
16 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
|
17 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
18 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
19 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
|
20 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
21 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
22 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
23 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
24 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
25 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
26 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
27 |
# POSSIBILITY OF SUCH DAMAGE. |
|
28 |
# |
|
29 |
# The views and conclusions contained in the software and |
|
30 |
# documentation are those of the authors and should not be |
|
31 |
# interpreted as representing official policies, either expressed |
|
32 |
# or implied, of GRNET S.A. |
|
33 |
|
|
34 |
import os.path |
|
35 |
import glob |
|
36 |
|
|
37 |
# import common settings |
|
38 |
from synnefo.settings.common import * |
|
39 |
|
|
40 |
SYNNEFO_DIST_SETTINGS_DIR = '/etc/synnefo' |
|
41 |
|
|
42 |
# extend common settings with settings set in /etc/synnefo dir |
|
43 |
conffiles = glob.glob(os.path.join(SYNNEFO_DIST_SETTINGS_DIR, '*.conf')) |
|
44 |
conffiles.sort() |
|
45 |
for f in conffiles: |
|
46 |
execfile(os.path.abspath(f)) |
|
47 |
|
|
48 |
|
b/synnefo/settings/common/__init__.py | ||
---|---|---|
1 |
# Copyright 2011 GRNET S.A. All rights reserved. |
|
2 |
# |
|
3 |
# Redistribution and use in source and binary forms, with or |
|
4 |
# without modification, are permitted provided that the following |
|
5 |
# conditions are met: |
|
6 |
# |
|
7 |
# 1. Redistributions of source code must retain the above |
|
8 |
# copyright notice, this list of conditions and the following |
|
9 |
# disclaimer. |
|
10 |
# |
|
11 |
# 2. Redistributions in binary form must reproduce the above |
|
12 |
# copyright notice, this list of conditions and the following |
|
13 |
# disclaimer in the documentation and/or other materials |
|
14 |
# provided with the distribution. |
|
15 |
# |
|
16 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
|
17 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
18 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
|
19 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
|
20 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
21 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
22 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
23 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
|
24 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
25 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
26 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
27 |
# POSSIBILITY OF SUCH DAMAGE. |
|
28 |
# |
|
29 |
# The views and conclusions contained in the software and |
|
30 |
# documentation are those of the authors and should not be |
|
31 |
# interpreted as representing official policies, either expressed |
|
32 |
# or implied, of GRNET S.A. |
|
33 |
|
|
34 |
from synnefo.settings.common.admins import * |
|
35 |
from synnefo.settings.common.apps import * |
|
36 |
from synnefo.settings.common.deploy import * |
|
37 |
from synnefo.settings.common.logging import * |
|
38 |
from synnefo.settings.common.site import * |
|
39 |
from synnefo.settings.common.backend import * |
|
40 |
from synnefo.settings.common.database import * |
|
41 |
from synnefo.settings.common.queues import * |
|
42 |
from synnefo.settings.common.api import * |
|
43 |
from synnefo.settings.common.ui import * |
|
44 |
from synnefo.settings.common.userdata import * |
|
45 |
from synnefo.settings.common.aai import * |
|
46 |
from synnefo.settings.common.invitations import * |
|
47 |
from synnefo.settings.common.reconciliation import * |
|
48 |
from synnefo.settings.common.helpdesk import * |
|
49 |
from synnefo.settings.common.tests import * |
|
50 |
|
b/synnefo/settings/common/aai.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# AAI configuration |
|
4 |
##################### |
|
5 |
|
|
6 |
# Shibboleth-enabled path under the APP_INSTALL_URL. |
|
7 |
LOGIN_URL = "https://login.okeanos.grnet.gr" |
|
8 |
|
|
9 |
# Set the expiration time of newly created auth tokens |
|
10 |
# to be this many hours after their creation time. |
|
11 |
AUTH_TOKEN_DURATION = 30 * 24 |
|
12 |
|
|
13 |
# Enable receiving a temporary auth token (using the ?test URL parameter) that |
|
14 |
# bypasses the authentication mechanism. |
|
15 |
# |
|
16 |
# WARNING, ACHTUNG, README, etc: DO NOT ENABLE THIS ON DEPLOYED VERSIONS! |
|
17 |
# |
|
18 |
BYPASS_AUTHENTICATION = False |
|
19 |
|
|
20 |
# Urls that bypass Shibboleth authentication |
|
21 |
AAI_SKIP_AUTH_URLS = ['/api', '/invitations/login'] |
|
22 |
|
b/synnefo/settings/common/admins.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Admin names and email addresses |
|
4 |
################################## |
|
5 |
|
|
6 |
ADMINS = ( |
|
7 |
# ('Your Name', 'your_email@domain.com'), |
|
8 |
) |
|
9 |
|
|
10 |
MANAGERS = ADMINS |
|
11 |
|
|
12 |
# Email configuration |
|
13 |
EMAIL_HOST = "127.0.0.1" |
|
14 |
EMAIL_HOST_USER = "" |
|
15 |
EMAIL_HOST_PASSWORD = "" |
|
16 |
EMAIL_SUBJECT_PREFIX = "[email-subject-prefix] " |
|
17 |
DEFAULT_CHARSET = 'utf-8' |
|
18 |
|
|
19 |
# Address to use for outgoing emails |
|
20 |
DEFAULT_FROM_EMAIL = "~okeanos <no-reply@grnet.gr>" |
b/synnefo/settings/common/api.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# API configuration |
|
4 |
##################### |
|
5 |
|
|
6 |
from deploy import * |
|
7 |
|
|
8 |
# The API implementation needs to accept and return absolute references |
|
9 |
# to its resources. Thus, it needs to know its public URL. |
|
10 |
API_ROOT_URL = APP_INSTALL_URL + '/api' |
|
11 |
|
|
12 |
# The API will return HTTP Bad Request if the ?changes-since |
|
13 |
# parameter refers to a point in time more than POLL_LIMIT seconds ago. |
|
14 |
POLL_LIMIT = 3600 |
|
15 |
|
|
16 |
# |
|
17 |
# Network Configuration |
|
18 |
# |
|
19 |
|
|
20 |
# Synnefo assigns this link id to NICs connected on the public network. |
|
21 |
# An IP pool should be associated with this link by the Ganeti administrator. |
|
22 |
GANETI_PUBLIC_LINK = 'snf_public' |
|
23 |
# This link id is assigned to NICs that should be isolated from anything else |
|
24 |
# (e.g., right before the NIC gets deleted). |
|
25 |
# This value is also hardcoded in a fixture in db/fixtures/initial_data.json. |
|
26 |
GANETI_NULL_LINK = 'snf_null' |
|
27 |
|
|
28 |
# The pool of private network links to use is |
|
29 |
# $GANETI_LINK_PREFIX{1..$GANETI_MAX_LINK_NUMBER}. |
|
30 |
# |
|
31 |
# The prefix to use for private network links. |
|
32 |
GANETI_LINK_PREFIX = 'prv' |
|
33 |
# The number of private network links to use. |
|
34 |
GANETI_MAX_LINK_NUMBER = 100 |
|
35 |
# Firewalling |
|
36 |
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:0:protected' |
|
37 |
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:0:unprotected' |
|
38 |
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:0:limited' |
|
39 |
|
|
40 |
# The default firewall profile that will be in effect if no tags are defined |
|
41 |
DEFAULT_FIREWALL_PROFILE = 'DISABLED' |
|
42 |
|
|
43 |
# our REST API would prefer to be explicit about trailing slashes |
|
44 |
APPEND_SLASH = False |
|
45 |
|
|
46 |
# Ignore disk size specified by flavor, always build the |
|
47 |
# machine with a 4GB (in the case of Windows: 14GB) disk. |
|
48 |
# This setting is helpful in development setups. |
|
49 |
# |
|
50 |
IGNORE_FLAVOR_DISK_SIZES = False |
|
51 |
|
|
52 |
# Quota |
|
53 |
# |
|
54 |
# Maximum number of VMs a user is allowed to have |
|
55 |
MAX_VMS_PER_USER = 3 |
|
56 |
|
|
57 |
# URL templates for the stat graphs. |
|
58 |
# The API implementation replaces '%s' with the encrypted backend id. |
|
59 |
# FIXME: For now we do not encrypt the backend id. |
|
60 |
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png' |
|
61 |
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png' |
|
62 |
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png' |
|
63 |
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png' |
|
64 |
|
|
65 |
# Recommended refresh period for server stats |
|
66 |
STATS_REFRESH_PERIOD = 60 |
|
67 |
|
|
68 |
# The maximum number of file path/content pairs that can be supplied on server |
|
69 |
# build |
|
70 |
MAX_PERSONALITY = 5 |
|
71 |
|
|
72 |
# The maximum size, in bytes, for each personality file |
|
73 |
MAX_PERSONALITY_SIZE = 10240 |
|
74 |
|
|
75 |
# Available storage types to be used as disk templates |
|
76 |
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain', |
|
77 |
'rbd', 'sharedfile') |
|
78 |
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd' |
b/synnefo/settings/common/apps.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Core Django settings |
|
4 |
################################## |
|
5 |
|
|
6 |
INSTALLED_APPS = ( |
|
7 |
'django.contrib.contenttypes', |
|
8 |
'django.contrib.sessions', |
|
9 |
'django.contrib.sites', |
|
10 |
'django.contrib.messages', |
|
11 |
'django.contrib.admin', |
|
12 |
'synnefo.aai', |
|
13 |
'synnefo.admin', |
|
14 |
'synnefo.api', |
|
15 |
'synnefo.ui', |
|
16 |
'synnefo.db', |
|
17 |
'synnefo.logic', |
|
18 |
'synnefo.invitations', |
|
19 |
'synnefo.helpdesk', |
|
20 |
'synnefo.ui.userdata', |
|
21 |
|
|
22 |
'south' |
|
23 |
) |
|
24 |
|
|
25 |
SESSION_ENGINE = "django.contrib.sessions.backends.cache" |
|
26 |
|
|
27 |
# List of callables that know how to import templates from various sources. |
|
28 |
TEMPLATE_LOADERS = ( |
|
29 |
'django.template.loaders.filesystem.Loader', |
|
30 |
'django.template.loaders.app_directories.Loader', |
|
31 |
# 'django.template.loaders.eggs.Loader', |
|
32 |
) |
|
33 |
|
|
34 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
|
35 |
'django.core.context_processors.request', |
|
36 |
'django.core.context_processors.i18n', |
|
37 |
'django.contrib.auth.context_processors.auth', |
|
38 |
'django.core.context_processors.media' |
|
39 |
) |
|
40 |
|
|
41 |
MIDDLEWARE_CLASSES = ( |
|
42 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
43 |
'synnefo.aai.middleware.SynnefoAuthMiddleware', |
|
44 |
'synnefo.api.middleware.ApiAuthMiddleware', |
|
45 |
'synnefo.helpdesk.middleware.HelpdeskMiddleware', |
|
46 |
'django.middleware.locale.LocaleMiddleware', |
|
47 |
'django.middleware.common.CommonMiddleware', |
|
48 |
'django.contrib.messages.middleware.MessageMiddleware' |
|
49 |
) |
|
50 |
|
|
51 |
ROOT_URLCONF = 'synnefo.urls' |
|
52 |
|
|
53 |
TEMPLATE_DIRS = ( |
|
54 |
# Put strings here, like "/home/html/django_templates" |
|
55 |
# or "C:/www/django/templates". |
|
56 |
# Always use forward slashes, even on Windows. |
|
57 |
# Don't forget to use absolute paths, not relative paths. |
|
58 |
) |
|
59 |
|
|
60 |
LANGUAGES = ( |
|
61 |
#('el', u'Ελληνικά'), |
|
62 |
('en', 'English'), |
|
63 |
) |
|
64 |
|
|
65 |
# Local time zone for this installation. Choices can be found here: |
|
66 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
67 |
# although not all choices may be available on all operating systems. |
|
68 |
# On Unix systems, a value of None will cause Django to use the same |
|
69 |
# timezone as the operating system. |
|
70 |
# If running in a Windows environment this must be set to the same as your |
|
71 |
# system time zone. |
|
72 |
TIME_ZONE = 'UTC' # Warning: The API depends on the TIME_ZONE being UTC |
|
73 |
|
b/synnefo/settings/common/backend.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Ganeti backend configuration |
|
4 |
################################### |
|
5 |
|
|
6 |
# The RAPI endpoint and associated credentials to use |
|
7 |
# for talking to the Ganeti backend. |
|
8 |
GANETI_MASTER_IP = "10.0.0.1" |
|
9 |
GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "username", "password") |
|
10 |
|
|
11 |
# This prefix gets used when determining the instance names |
|
12 |
# of Synnefo VMs at the Ganeti backend. |
|
13 |
# The dash must always appear in the name! |
|
14 |
BACKEND_PREFIX_ID = "snf-" |
|
15 |
|
|
16 |
# The following dictionary defines deployment-specific |
|
17 |
# arguments to the RAPI CreateInstance call. |
|
18 |
# At a minimum it should contain the |
|
19 |
# 'disk_template', 'os_provider', and 'hvparams' keys. |
|
20 |
# |
|
21 |
# More specifically: |
|
22 |
# a) disk_template: |
|
23 |
# The disk template to use when creating the instance. |
|
24 |
# Suggested values: 'plain', or 'drbd'. |
|
25 |
# b) os: |
|
26 |
# The OS provider to use (customized Ganeti Instance Image) |
|
27 |
# c) hvparams: |
|
28 |
# Hypervisor-specific parameters (serial_console = False, see #785) |
|
29 |
# d) If using the DRBD disk_template, you may want to include |
|
30 |
# wait_for_sync = False (see #835). |
|
31 |
# |
|
32 |
GANETI_CREATEINSTANCE_KWARGS = { |
|
33 |
'os': 'snf-image+default', |
|
34 |
'hvparams': {'serial_console': False}, |
|
35 |
'wait_for_sync': False} |
b/synnefo/settings/common/database.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Database settings |
|
4 |
#################### |
|
5 |
|
|
6 |
import os |
|
7 |
|
|
8 |
DEFAULT_DB_PATH = '/usr/share/synnefo/' |
|
9 |
DATABASES = { |
|
10 |
'default': { |
|
11 |
# 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle' |
|
12 |
'ENGINE': 'sqlite3', |
|
13 |
# ATTENTION: This *must* be the absolute path if using sqlite3. |
|
14 |
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name |
|
15 |
'NAME': os.path.join(DEFAULT_DB_PATH, 'database.sqlite'), |
|
16 |
'USER': '', # Not used with sqlite3. |
|
17 |
'PASSWORD': '', # Not used with sqlite3. |
|
18 |
# Set to empty string for localhost. Not used with sqlite3. |
|
19 |
'HOST': '', |
|
20 |
# Set to empty string for default. Not used with sqlite3. |
|
21 |
'PORT': '', |
|
22 |
} |
|
23 |
} |
|
24 |
|
|
25 |
if DATABASES['default']['ENGINE'].endswith('mysql'): |
|
26 |
DATABASES['default']['OPTIONS'] = { |
|
27 |
'init_command': 'SET storage_engine=INNODB; ' + |
|
28 |
'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', |
|
29 |
} |
b/synnefo/settings/common/deploy.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Deployment |
|
4 |
################################## |
|
5 |
|
|
6 |
DEBUG = True |
|
7 |
TEMPLATE_DEBUG = DEBUG |
|
8 |
|
|
9 |
# Top-level URL for deployment. Numerous other URLs depend on this. |
|
10 |
APP_INSTALL_URL = "https://host:port" |
|
11 |
|
|
12 |
# Make this unique, and don't share it with anybody. |
|
13 |
SECRET_KEY = 'ly6)mw6a7x%n)-e#zzk4jo6f2=uqu!1o%)2-(7lo+f9yd^k^bg' |
b/synnefo/settings/common/helpdesk.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Helpdesk application |
|
4 |
# |
|
5 |
|
|
6 |
# Duration for temporary auth tokens, created for impersonating a registered |
|
7 |
# user by helpdesk staff. |
|
8 |
HELPDESK_TOKEN_DURATION_MIN = 30 |
|
9 |
|
|
10 |
# IP addresses of the machines allowed to connect as help desk |
|
11 |
HELPDESK_ALLOWED_IPS = ("127.0.0.1",) |
|
12 |
|
b/synnefo/settings/common/invitations.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
|
|
3 |
# Max number of invitations allowed per level |
|
4 |
INVITATIONS_PER_LEVEL = { |
|
5 |
#Level #Max Invitations |
|
6 |
0 : 10000, |
|
7 |
1 : 3, |
|
8 |
2 : 2, |
|
9 |
3 : 1, |
|
10 |
4 : 0 |
|
11 |
} |
|
12 |
|
|
13 |
# Key to encrypt X-Auth-Token with when sending invitations |
|
14 |
INVITATION_ENCR_KEY = '8d342f6e7a0366c632978a80257019af' |
|
15 |
|
|
16 |
# Days for which an invitation is active |
|
17 |
INVITATION_VALID_DAYS = 180 |
b/synnefo/settings/common/logging.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Logging configuration |
|
4 |
################################## |
|
5 |
|
|
6 |
LOGGING = { |
|
7 |
'version': 1, |
|
8 |
'disable_existing_loggers': True, |
|
9 |
|
|
10 |
'formatters': { |
|
11 |
'simple': { |
|
12 |
'format': '%(message)s' |
|
13 |
}, |
|
14 |
'verbose': { |
|
15 |
'format': '%(asctime)s [%(levelname)s] %(message)s' |
|
16 |
}, |
|
17 |
'django': { |
|
18 |
'format': '[%(asctime)s] %(levelname)s %(message)s', |
|
19 |
'datefmt': '%d/%b/%Y %H:%M:%S' |
|
20 |
}, |
|
21 |
}, |
|
22 |
|
|
23 |
'handlers': { |
|
24 |
'null': { |
|
25 |
'class': 'logging.NullHandler', |
|
26 |
}, |
|
27 |
'console': { |
|
28 |
'class': 'logging.StreamHandler', |
|
29 |
'formatter': 'django' |
|
30 |
}, |
|
31 |
'syslog': { |
|
32 |
'class': 'logging.handlers.SysLogHandler', |
|
33 |
'address': '/dev/log', |
|
34 |
# 'address': ('localhost', 514), |
|
35 |
'facility': 'daemon', |
|
36 |
'formatter': 'verbose', |
|
37 |
'level': 'INFO', |
|
38 |
}, |
|
39 |
}, |
|
40 |
|
|
41 |
'loggers': { |
|
42 |
'synnefo': { |
|
43 |
'handlers': ['syslog'], |
|
44 |
'level': 'INFO' |
|
45 |
}, |
|
46 |
'synnefo.admin': { |
|
47 |
'level': 'INFO', |
|
48 |
'propagate': 1 |
|
49 |
}, |
|
50 |
'synnefo.api': { |
|
51 |
'level': 'INFO', |
|
52 |
'propagate': 1 |
|
53 |
}, |
|
54 |
'synnefo.db': { |
|
55 |
'level': 'INFO', |
|
56 |
'propagate': 1 |
|
57 |
}, |
|
58 |
'synnefo.logic': { |
|
59 |
'level': 'INFO', |
|
60 |
'propagate': 1 |
|
61 |
}, |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
|
|
66 |
DISPATCHER_LOGGING = { |
|
67 |
'version': 1, |
|
68 |
'disable_existing_loggers': True, |
|
69 |
|
|
70 |
'formatters': { |
|
71 |
'verbose': { |
|
72 |
'format': '%(asctime)s [%(levelname)s] %(message)s' |
|
73 |
}, |
|
74 |
}, |
|
75 |
|
|
76 |
'handlers': { |
|
77 |
'console': { |
|
78 |
'class': 'logging.StreamHandler', |
|
79 |
'formatter': 'verbose' |
|
80 |
}, |
|
81 |
'file': { |
|
82 |
'class': 'logging.handlers.WatchedFileHandler', |
|
83 |
'filename': '/var/log/synnefo/dispatcher.log', |
|
84 |
'formatter': 'verbose', |
|
85 |
'level': 'DEBUG' |
|
86 |
}, |
|
87 |
}, |
|
88 |
|
|
89 |
'loggers': { |
|
90 |
'synnefo': {'propagate': 1} |
|
91 |
}, |
|
92 |
|
|
93 |
'root': { |
|
94 |
'handlers': ['console', 'file'], |
|
95 |
'level': 'DEBUG', |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
|
|
100 |
SNFADMIN_LOGGING = { |
|
101 |
'version': 1, |
|
102 |
'disable_existing_loggers': True, |
|
103 |
|
|
104 |
'formatters': { |
|
105 |
'verbose': { |
|
106 |
'format': '%(asctime)s [%(levelname)s] %(message)s' |
|
107 |
}, |
|
108 |
}, |
|
109 |
|
|
110 |
'handlers': { |
|
111 |
'console': { |
|
112 |
'class': 'logging.StreamHandler', |
|
113 |
'formatter': 'verbose' |
|
114 |
}, |
|
115 |
}, |
|
116 |
|
|
117 |
'loggers': { |
|
118 |
'synnefo': {'propagate': 1} |
|
119 |
}, |
|
120 |
|
|
121 |
'root': { |
|
122 |
'handlers': ['console'], |
|
123 |
'level': 'DEBUG', |
|
124 |
} |
|
125 |
} |
b/synnefo/settings/common/queues.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Queues, exchanges and bindings for AMQP |
|
4 |
########################################### |
|
5 |
|
|
6 |
# Rabbit work queue endpoint |
|
7 |
RABBIT_HOST = "10.0.0.1:5672" |
|
8 |
RABBIT_USERNAME = "username" |
|
9 |
RABBIT_PASSWORD = "password" |
|
10 |
RABBIT_VHOST = "/" |
|
11 |
|
|
12 |
EXCHANGE_GANETI = "ganeti" # Messages from Ganeti |
|
13 |
EXCHANGE_CRON = "cron" # Messages from periodically triggered tasks |
|
14 |
EXCHANGE_API = "api" # Messages from the REST API |
|
15 |
EXCHANGES = (EXCHANGE_GANETI, EXCHANGE_CRON, EXCHANGE_API) |
b/synnefo/settings/common/reconciliation.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Reconciliations |
|
4 |
################### |
|
5 |
|
|
6 |
# Minutes between reconciliations |
|
7 |
RECONCILIATION_MIN = 30 |
|
8 |
|
b/synnefo/settings/common/site.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Site-specific Django conf |
|
4 |
################################## |
|
5 |
|
|
6 |
# Language code for this installation. All choices can be found here: |
|
7 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
|
8 |
LANGUAGE_CODE = 'en-us' |
|
9 |
|
|
10 |
# FIXME? |
|
11 |
SITE_ID = 1 |
|
12 |
|
|
13 |
# If you set this to False, Django will make some optimizations so as not |
|
14 |
# to load the internationalization machinery. |
|
15 |
USE_I18N = True |
|
16 |
|
|
17 |
# If you set this to False, Django will not format dates, numbers and |
|
18 |
# calendars according to the current locale |
|
19 |
USE_L10N = True |
|
20 |
|
|
21 |
# Absolute path to the directory that holds media. |
|
22 |
# Example: "/home/media/media.lawrence.com/" |
|
23 |
MEDIA_ROOT = '' |
|
24 |
|
|
25 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
26 |
# trailing slash if there is a path component (optional in other cases). |
|
27 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
28 |
MEDIA_URL = '/static/' |
|
29 |
|
|
30 |
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
31 |
# trailing slash. |
|
32 |
# Examples: "http://foo.com/media/", "/media/". |
|
33 |
ADMIN_MEDIA_PREFIX = '/media/' |
b/synnefo/settings/common/tests.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# Special unit test mode |
|
4 |
######################### |
|
5 |
|
|
6 |
# A quick-n-dirty way which sets settings.TEST |
|
7 |
# if we're running unit tests. |
|
8 |
import sys, os |
|
9 |
TEST = False |
|
10 |
if len(sys.argv) >= 2: |
|
11 |
if os.path.basename(sys.argv[0]) == 'manage.py' and \ |
|
12 |
(sys.argv[1] == 'test' or sys.argv[1] == 'hudson'): |
|
13 |
TEST = True |
b/synnefo/settings/common/ui.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
# |
|
3 |
# UI settings |
|
4 |
################### |
|
5 |
|
|
6 |
from admins import * |
|
7 |
|
|
8 |
# base url for ui static files |
|
9 |
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/' |
|
10 |
#UI_MEDIA_URL = MEDIA_URL + 'snf/' |
|
11 |
|
|
12 |
# UI requests to the API layer time out after that many milliseconds |
|
13 |
TIMEOUT = 10 * 1000 |
|
14 |
|
|
15 |
# A list of suggested server tags (server metadata keys) |
|
16 |
DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"] |
|
17 |
|
|
18 |
# A list of allowed icons for OS Images |
|
19 |
IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux", |
|
20 |
"centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware", |
|
21 |
"suse", "kubuntu"] |
|
22 |
|
|
23 |
# How often should the UI request changes from the API |
|
24 |
UI_UPDATE_INTERVAL = 5000 |
|
25 |
|
|
26 |
# Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls |
|
27 |
# of recurrent api requests |
|
28 |
UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4 |
|
29 |
UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4 |
|
30 |
|
|
31 |
# Maximum update interval |
|
32 |
UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3 |
|
33 |
|
|
34 |
# Fast update interval |
|
35 |
UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2 |
|
36 |
|
|
37 |
# List of emails used for sending the feedback messages to (following the ADMINS format) |
|
38 |
FEEDBACK_CONTACTS = ( |
|
39 |
# ('Contact Name', 'contact_email@domain.com'), |
Also available in: Unified diff