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 *
22 #from ldap_settings import *
27 TEMPLATE_DEBUG = DEBUG
29 # XXX - Django sets DEBUG to False when running unittests. They want to ensure
30 # that you test as if it were a production environment. Unfortunately we have
31 # some models and other settings used only for testing. We use the TESTING
32 # flag to enable or disable these items.
34 # If you run the unittests without this set to TRUE, you will get many errors!
36 # Setting this to False disables south migrations when running tests.
37 SOUTH_TESTS_MIGRATE = False
38 SKIP_SOUTH_TESTS = True
41 # ('Your Name', 'your_email@example.com'),
48 # Add 'postgresql_psycopg2', 'postgresql', 'mysql',
49 # 'sqlite3' or 'oracle'.
50 'ENGINE': 'django.db.backends.sqlite3',
52 # Or path to database file if using sqlite3.
54 'USER': '', # Not used with sqlite3.
55 'PASSWORD': '', # Not used with sqlite3.
56 'HOST': '', # Set to empty string for localhost.
57 # Not used with sqlite3.
58 'PORT': '', # Set to empty string for default.
59 #Not used with sqlite3.
63 # Local time zone for this installation. Choices can be found here:
64 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
65 # although not all choices may be available on all operating systems.
66 # If running in a Windows environment this must be set to the same as your
68 TIME_ZONE = 'America/Los_Angeles'
70 # If no other locale is present/supported for the time leave the
71 # following as is. When locales are added, place them ath the
72 # "('yourlang', ugettext('YOUR LANGUAGE')),"
73 # line. E.g, for the Greek locale, it becomes: ('el', ugettext('Greek'))
77 # ('yourlang', ugettext('YOUR LANGUAGE')),
78 ('el', ugettext('Greek')),
79 ('en', ugettext('English')),
81 # end-of localization support
83 # Language code for this installation. All choices can be found here:
84 # http://www.i18nguy.com/unicode/language-identifiers.html
85 LANGUAGE_CODE = 'en-US'
87 # Unique site id used by many modules to distinguish site from others.
90 # Site name and domain referenced by some modules to provide links back to
92 SITE_NAME = 'Ganeti Web Manager'
93 SITE_DOMAIN = 'localhost:8000'
95 # Enable i18n (translations) and l10n (locales, currency, times).
96 # You really have no good reason to disable these unless you are only
97 # going to be using GWM in English.
100 # If you set this to False, Django will not format dates, numbers and
101 # calendars according to the current locale
104 # absolute path to the docroot of this site
105 DOC_ROOT = os.path.dirname(os.path.realpath(__file__))
107 # prefix used for the site. ie. http://myhost.com/<SITE_ROOT>
108 # for the django standalone server this should be ''
109 # for apache this is the url the site is mapped to, probably /tracker
112 # Absolute path to the directory that holds media.
113 # Example: "/home/media/media.lawrence.com/"
114 STATIC_ROOT = '%s/static' % DOC_ROOT
116 # URL that handles the media served from STATIC_ROOT.
117 # XXX contrary to django docs, do not use a trailling slash. It makes urls
118 # using this url easier to read. ie. {{STATIC_URL}}/images/foo.png
119 STATIC_URL = '%s/static' % SITE_ROOT
121 # Path to installed locales. New translations should be added to this
124 '%s/locale' % DOC_ROOT,
127 # Make this unique, and don't share it with anybody.
128 SECRET_KEY = '!c&bm88vo=gby*vxf2gydv8hc!+f+eo+yu&!g&!)#n5quwsr82'
130 AUTHENTICATION_BACKENDS = (
131 'django.contrib.auth.backends.ModelBackend',
132 # 'django_auth_ldap.backend.LDAPBackend',
133 'object_permissions.backend.ObjectPermBackend',
136 ROOT_URLCONF = 'urls'
139 # Put strings here, like "/home/html/django_templates"
140 # or "C:/www/django/templates".
141 # Always use forward slashes, even on Windows.
142 # Don't forget to use absolute paths, not relative paths.
147 HAYSTACK_SITECONF = 'search_sites'
148 HAYSTACK_SEARCH_ENGINE = 'whoosh'
149 HAYSTACK_WHOOSH_PATH = os.path.join(DOC_ROOT, 'whoosh_index')
151 LOGIN_REDIRECT_URL = '/'
153 DATE_FORMAT = "d/m/Y"
154 DATETIME_FORMAT = "d/m/Y H:i"
156 ACCOUNT_ACTIVATION_DAYS = 7
158 # Email settings for registration
159 EMAIL_HOST = "localhost"
161 # DEFAULT_FROM_EMAIL = "noreply@example.org"
163 # Whether users should be able to create their own accounts.
164 # False if accounts can only be created by admins.
165 ALLOW_OPEN_REGISTRATION = True
167 # A sample logging configuration. The only tangible logging
168 # performed by this configuration is to send an email to
169 # the site admins on every HTTP 500 error.
170 # See http://docs.djangoproject.com/en/dev/topics/logging for
171 # more details on how to customize your logging configuration.
174 'disable_existing_loggers': False,
178 'class': 'django.utils.log.AdminEmailHandler'
183 'handlers': ['mail_admins'],
190 # default items per page
193 # default max number of disks that can be added at once to an instance
195 # default max number of NICS that can be added at once to an instance
198 # Ganeti Cached Cluster Objects Timeouts
199 # LAZY_CACHE_REFRESH (milliseconds) is the fallback cache timer that is
200 # checked when the object is instantiated. It defaults to 600000ms, or ten
202 LAZY_CACHE_REFRESH = 600000
204 # VNC Proxy. This will use a proxy to create local ports that are forwarded to
205 # the virtual machines. It allows you to control access to the VNC servers.
208 # String syntax: "HOST:CONTROL_PORT", for example: "localhost:8888". If
209 # localhost is used then the proxy will only be accessible to clients and
210 # browsers on localhost. Production servers should use a publicly accessible
214 # Control Port: 8888, must be open between Ganeti Web Manager and Proxy
215 # Internal Ports: 12000+ must be open between the Proxy and Ganeti Nodes
216 # External Ports: default is 7000-8000, must be open between Proxy and Client
217 # Flash Policy Server: 843, must open between Proxy and Clients
219 VNC_PROXY = 'localhost:8888'
222 # API Key for authenticating scripts that pull information from ganeti, such as
223 # list of sshkey's to assign to a virtual machine
225 # XXX this is a temporary feature that will eventually be replaced by a system
226 # that automatically creates keys per virtual machine. This is just a quick
227 # way of enabled a secure method to pull sshkeys from ganeti web manager
228 WEB_MGR_API_KEY = "CHANGE_ME"
230 # PyCurls default TIMEOUT in 7.21.6 defaults to 13 and CONNECTTIMEOUT to 78.
231 # This is way too long to wait for incorrect or unresponsive ganeti clusters
232 # when using the rapi for syncing and querying.
233 RAPI_CONNECT_TIMEOUT = 3