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 # If no other locale is present/supported for the time leave the following as is.
64 # When locales are added, place them ath the "('yourlang', ugettext('YOUR LANGUAGE')),"
65 # line. E.g, for the Greek locale, it becomes: ('el', ugettext('Greek'))
69 # ('yourlang', ugettext('YOUR LANGUAGE')),
70 ('el', ugettext('Greek')),
71 ('en', ugettext('English')),
73 # end-of localization support
75 # Language code for this installation. All choices can be found here:
76 # http://www.i18nguy.com/unicode/language-identifiers.html
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 STATIC_ROOT = '%s/static' % DOC_ROOT
108 # URL that handles the media served from STATIC_ROOT.
109 # XXX contrary to django docs, do not use a trailling slash. It makes urls
110 # using this url easier to read. ie. {{STATIC_URL}}/images/foo.png
111 STATIC_URL = '%s/static' % SITE_ROOT
113 # Path to installed locales. New translations should be added to this
116 '%s/locale' % DOC_ROOT,
119 # Make this unique, and don't share it with anybody.
120 SECRET_KEY = '!c&bm88vo=gby*vxf2gydv8hc!+f+eo+yu&!g&!)#n5quwsr82'
122 AUTHENTICATION_BACKENDS = (
123 'django.contrib.auth.backends.ModelBackend',
124 'object_permissions.backend.ObjectPermBackend',
127 ROOT_URLCONF = 'urls'
130 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
131 # Always use forward slashes, even on Windows.
132 # Don't forget to use absolute paths, not relative paths.
137 HAYSTACK_SITECONF = 'search_sites'
138 HAYSTACK_SEARCH_ENGINE = 'whoosh'
139 HAYSTACK_WHOOSH_PATH = os.path.join(DOC_ROOT, 'whoosh_index')
141 LOGIN_REDIRECT_URL = '/'
143 DATE_FORMAT = "d/m/Y"
144 DATETIME_FORMAT = "d/m/Y H:i"
146 ACCOUNT_ACTIVATION_DAYS = 7
148 # Email settings for registration
149 EMAIL_HOST = "localhost"
151 # DEFAULT_FROM_EMAIL = "noreply@example.org"
153 # Whether users should be able to create their own accounts.
154 # False if accounts can only be created by admins.
155 ALLOW_OPEN_REGISTRATION = True
157 # A sample logging configuration. The only tangible logging
158 # performed by this configuration is to send an email to
159 # the site admins on every HTTP 500 error.
160 # See http://docs.djangoproject.com/en/dev/topics/logging for
161 # more details on how to customize your logging configuration.
164 'disable_existing_loggers': False,
168 'class': 'django.utils.log.AdminEmailHandler'
173 'handlers': ['mail_admins'],
180 # default items per page
183 # Ganeti Cached Cluster Objects Timeouts
184 # LAZY_CACHE_REFRESH (milliseconds) is the fallback cache timer that is
185 # checked when the object is instantiated.
187 # PERIODIC_CACHE_REFRESH - timer used by an outside process twisted process
188 # that uses bulk methods for keeping the cache in sync with ganeti. If used
189 # this value should *always* be less than LAZY_CACHE_REFRESH. Note that this
190 # process still takes time to update object. If it does not complete fast
191 # enough LAZY_CACHE_REFRESH will still be checked
193 # Start this process this this command:
196 LAZY_CACHE_REFRESH = 600000
197 PERIODIC_CACHE_REFRESH = 300
199 # VNC Proxy. This will use a proxy to create local ports that are forwarded to
200 # the virtual machines. It allows you to control access to the VNC servers.
203 # String syntax: "HOST:CONTROL_PORT", for example: "localhost:8888". If
204 # localhost is used then the proxy will only be accessible to clients and
205 # browsers on localhost. Production servers should use a publicly accessible
209 # Control Port: 8888, must be open between Ganeti Web Manager and Proxy
210 # Internal Ports: 12000+ must be open between the Proxy and Ganeti Nodes
211 # External Ports: default is 7000-8000, must be open between Proxy and Clients
212 # Flash Policy Server: 843, must open between Proxy and Clients
214 VNC_PROXY='localhost:8888'
217 # API Key for authenticating scripts that pull information from ganeti, such as
218 # list of sshkey's to assign to a virtual machine
220 # XXX this is a temporary feature that will eventually be replaced by a system
221 # that automatically creates keys per virtual machine. This is just a quick
222 # way of enabled a secure method to pull sshkeys from ganeti web manager
223 WEB_MGR_API_KEY = "CHANGE_ME"
225 # PyCurls default TIMEOUT in 7.21.6 defaults to 13 and CONNECTTIMEOUT to 78.
226 # This is way too long to wait for incorrect or unresponsive ganeti clusters
227 # when using the rapi for syncing and querying.
228 RAPI_CONNECT_TIMEOUT = 3