1 # Copyright (C) 2010 Oregon State University et al.
2 # Copyright (C) 2010 Greek Research and Technology Network
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 # Django settings for ganeti_webmgr project.
21 from ganeti_web.settings import *
26 TEMPLATE_DEBUG = DEBUG
28 # XXX - Django sets DEBUG to False when running unittests. They want to ensure
29 # that you test as if it were a production environment. Unfortunately we have
30 # some models and other settings used only for testing. We use the TESTING flag
31 # to enable or disable these items.
33 # If you run the unittests without this set to TRUE, you will get many errors!
35 # Setting this to False disables south migrations when running tests.
36 SOUTH_TESTS_MIGRATE = False
37 SKIP_SOUTH_TESTS = True
40 # ('Your Name', 'your_email@example.com'),
47 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
48 'NAME': 'ganeti.db', # Or path to database file if using sqlite3.
49 'USER': '', # Not used with sqlite3.
50 'PASSWORD': '', # Not used with sqlite3.
51 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
52 'PORT': '', # Set to empty string for default. Not used with sqlite3.
56 # Local time zone for this installation. Choices can be found here:
57 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
58 # although not all choices may be available on all operating systems.
59 # If running in a Windows environment this must be set to the same as your
61 TIME_ZONE = 'America/Los_Angeles'
63 # Language code for this installation. All choices can be found here:
64 # http://www.i18nguy.com/unicode/language-identifiers.html
66 # If no other locale is present/supported for the time leave the following as is.
67 # When locales are added, place them ath the "('yourlang', ugettext('YOUR LANGUAGE')),"
68 # line. E.g, for the Greek locale, it becomes: ('el', ugettext('Greek'))
71 # ('yourlang', ugettext('YOUR LANGUAGE')),
72 ('el', ugettext('Greek')),
73 ('en', ugettext('English')),
75 # end-of localization support
77 LANGUAGE_CODE = 'en-US'
79 # Unique site id used by many modules to distinguish site from others.
82 # Site name and domain referenced by some modules to provide links back to
84 SITE_NAME = 'Ganeti Web Manager'
85 SITE_DOMAIN = 'localhost:8000'
87 # Enable i18n (translations) and l10n (locales, currency, times).
88 # You really have no good reason to disable these unless you are only
89 # going to be using GWM in English.
92 # If you set this to False, Django will not format dates, numbers and
93 # calendars according to the current locale
96 # absolute path to the docroot of this site
97 DOC_ROOT = os.path.dirname(os.path.realpath(__file__))
99 # prefix used for the site. ie. http://myhost.com/<SITE_ROOT>
100 # for the django standalone server this should be ''
101 # for apache this is the url the site is mapped to, probably /tracker
104 # Absolute path to the directory that holds media.
105 # Example: "/home/media/media.lawrence.com/"
106 MEDIA_ROOT = '%s/media' % DOC_ROOT
108 # URL that handles the media served from MEDIA_ROOT.
109 # XXX contrary to django docs, do not use a trailling slash. It makes urls
110 # using this url easier to read. ie. {{MEDIA_URL}}/images/foo.png
111 MEDIA_URL = '%s/media' % SITE_ROOT
113 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
115 # Examples: "http://foo.com/media/", "/media/".
116 ADMIN_MEDIA_PREFIX = '/adminmedia/'
118 # Make this unique, and don't share it with anybody.
119 SECRET_KEY = '!c&bm88vo=gby*vxf2gydv8hc!+f+eo+yu&!g&!)#n5quwsr82'
121 AUTHENTICATION_BACKENDS = (
122 'django.contrib.auth.backends.ModelBackend',
123 'object_permissions.backend.ObjectPermBackend',
126 ROOT_URLCONF = 'urls'
129 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
130 # Always use forward slashes, even on Windows.
131 # Don't forget to use absolute paths, not relative paths.
136 HAYSTACK_SITECONF = 'search_sites'
137 HAYSTACK_SEARCH_ENGINE = 'whoosh'
138 HAYSTACK_WHOOSH_PATH = os.path.join(DOC_ROOT, 'whoosh_index')
140 LOGIN_REDIRECT_URL = '/'
142 DATE_FORMAT = "d/m/Y"
143 DATETIME_FORMAT = "d/m/Y H:i"
145 ACCOUNT_ACTIVATION_DAYS = 7
147 # Email settings for registration
148 EMAIL_HOST = "localhost"
150 # DEFAULT_FROM_EMAIL = "noreply@example.org"
152 # Whether users should be able to create their own accounts.
153 # False if accounts can only be created by admins.
154 ALLOW_OPEN_REGISTRATION = True
156 # A sample logging configuration. The only tangible logging
157 # performed by this configuration is to send an email to
158 # the site admins on every HTTP 500 error.
159 # See http://docs.djangoproject.com/en/dev/topics/logging for
160 # more details on how to customize your logging configuration.
163 'disable_existing_loggers': False,
167 'class': 'django.utils.log.AdminEmailHandler'
172 'handlers': ['mail_admins'],
179 # default items per page
182 # Ganeti Cached Cluster Objects Timeouts
183 # LAZY_CACHE_REFRESH (milliseconds) is the fallback cache timer that is
184 # checked when the object is instantiated.
186 # PERIODIC_CACHE_REFRESH - timer used by an outside process twisted process
187 # that uses bulk methods for keeping the cache in sync with ganeti. If used
188 # this value should *always* be less than LAZY_CACHE_REFRESH. Note that this
189 # process still takes time to update object. If it does not complete fast
190 # enough LAZY_CACHE_REFRESH will still be checked
192 # Start this process this this command:
195 LAZY_CACHE_REFRESH = 600000
196 PERIODIC_CACHE_REFRESH = 300
198 # VNC Proxy. This will use a proxy to create local ports that are forwarded to
199 # the virtual machines. It allows you to control access to the VNC servers.
202 # String syntax: "HOST:CONTROL_PORT", for example: "localhost:8888". If
203 # localhost is used then the proxy will only be accessible to clients and
204 # browsers on localhost. Production servers should use a publicly accessible
208 # Control Port: 8888, must be open between Ganeti Web Manager and Proxy
209 # Internal Ports: 12000+ must be open between the Proxy and Ganeti Nodes
210 # External Ports: default is 7000-8000, must be open between Proxy and Clients
211 # Flash Policy Server: 843, must open between Proxy and Clients
213 VNC_PROXY='localhost:8888'
216 # API Key for authenticating scripts that pull information from ganeti, such as
217 # list of sshkey's to assign to a virtual machine
219 # XXX this is a temporary feature that will eventually be replaced by a system
220 # that automatically creates keys per virtual machine. This is just a quick
221 # way of enabled a secure method to pull sshkeys from ganeti web manager
222 WEB_MGR_API_KEY = "CHANGE_ME"
224 # PyCurls default TIMEOUT in 7.21.6 defaults to 13 and CONNECTTIMEOUT to 78.
225 # This is way too long to wait for incorrect or unresponsive ganeti clusters
226 # when using the rapi for syncing and querying.
227 RAPI_CONNECT_TIMEOUT = 3