3 from django.utils.translation import ugettext_lazy as _
5 from openstack_dashboard import exceptions
10 # Required for Django 1.5.
11 # If horizon is running in production (DEBUG is False), set this
12 # with the list of host/domain names that the application can serve.
13 # For more information see:
14 # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
15 #ALLOWED_HOSTS = ['horizon.example.com', ]
17 # Set SSL proxy settings:
18 # For Django 1.4+ pass this header from the proxy after terminating the SSL,
19 # and don't forget to strip it from the client's request.
20 # For more information see:
21 # https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header
22 # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
24 # If Horizon is being served through SSL, then uncomment the following two
25 # settings to better secure the cookies from security exploits
26 #CSRF_COOKIE_SECURE = True
27 #SESSION_COOKIE_SECURE = True
29 # Overrides for OpenStack API versions. Use this setting to force the
30 # OpenStack dashboard to use a specific API version for a given service API.
31 # NOTE: The version should be formatted as it appears in the URL for the
32 # service API. For example, The identity service APIs have inconsistent
33 # use of the decimal point, so valid options would be "2.0" or "3".
34 # OPENSTACK_API_VERSIONS = {
39 # Set this to True if running on multi-domain model. When this is enabled, it
40 # will require user to enter the Domain name in addition to username for login.
41 # OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
43 # Overrides the default domain used when running on single-domain model
44 # with Keystone V3. All entities will be created in the default domain.
45 # OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
48 # valid options would be "AUTO", "VNC", "SPICE" or "RDP"
49 # CONSOLE_TYPE = "AUTO"
51 # Default OpenStack Dashboard configuration.
53 'dashboards': ('project', 'admin', 'settings',),
54 'default_dashboard': 'project',
55 'user_home': 'openstack_dashboard.views.get_user_home',
56 'ajax_queue_limit': 10,
59 'fade_duration': 1500,
60 'types': ['alert-success', 'alert-info']
62 'help_url': "http://docs.openstack.org",
63 'exceptions': {'recoverable': exceptions.RECOVERABLE,
64 'not_found': exceptions.NOT_FOUND,
65 'unauthorized': exceptions.UNAUTHORIZED},
68 # Specify a regular expression to validate user passwords.
69 # HORIZON_CONFIG["password_validator"] = {
71 # "help_text": _("Your password does not meet the requirements.")
74 # Disable simplified floating IP address management for deployments with
75 # multiple floating IP pools or complex network requirements.
76 # HORIZON_CONFIG["simple_ip_management"] = False
78 # Turn off browser autocompletion for the login form if so desired.
79 # HORIZON_CONFIG["password_autocomplete"] = "off"
81 LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
83 # Set custom secret key:
84 # You can either set it to a specific value or you can let horizion generate a
85 # default secret key that is unique on this machine, e.i. regardless of the
86 # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there
87 # may be situations where you would want to set this explicitly, e.g. when
88 # multiple dashboard instances are distributed on different machines (usually
89 # behind a load-balancer). Either you have to make sure that a session gets all
90 # requests routed to the same dashboard instance or you set the same SECRET_KEY
92 from horizon.utils import secret_key
93 SECRET_KEY = 'AJDSKLAJDKASJDKASJDKSAJDKSJAKDSA'
94 # We recommend you use memcached for development; otherwise after every reload
95 # of the django development server, you will have to login again. To use
96 # memcached set CACHES to something like
99 'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
100 'LOCATION' : '127.0.0.1:11211',
106 # 'BACKEND' : 'django.core.cache.backends.locmem.LocMemCache'
110 # Enable the Ubuntu theme if it is present.
112 from ubuntu_theme import *
116 # Default Ubuntu apache configuration uses /horizon as the application root.
117 # Configure auth redirects here accordingly.
118 LOGIN_URL='/horizon/auth/login/'
119 LOGOUT_URL='/horizon/auth/logout/'
120 LOGIN_REDIRECT_URL='/horizon'
122 # The Ubuntu package includes pre-compressed JS and compiled CSS to allow
123 # offline compression by default. To enable online compression, install
124 # the node-less package and enable the following option.
125 COMPRESS_OFFLINE = True
127 # By default, validation of the HTTP Host header is disabled. Production
128 # installations should have this set accordingly. For more information
129 # see https://docs.djangoproject.com/en/dev/ref/settings/.
130 ALLOWED_HOSTS = ['{{ dashboard_host }}']
132 # Send email to the console by default
133 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
134 # Or send them to /dev/null
135 #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
137 # Configure these for your outgoing email host
138 # EMAIL_HOST = 'smtp.my-company.com'
140 # EMAIL_HOST_USER = 'djangomail'
141 # EMAIL_HOST_PASSWORD = 'top-secret!'
143 # For multiple regions uncomment this configuration, and add (endpoint, title).
144 # AVAILABLE_REGIONS = [
145 # ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
146 # ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
149 OPENSTACK_HOST = "{{ HA_VIP }}"
150 OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
151 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
153 # Disable SSL certificate checks (useful for self-signed certificates):
154 # OPENSTACK_SSL_NO_VERIFY = True
156 # The CA certificate to use to verify SSL connections
157 # OPENSTACK_SSL_CACERT = '/path/to/cacert.pem'
159 # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
160 # capabilities of the auth backend for Keystone.
161 # If Keystone has been configured to use LDAP as the auth backend then set
162 # can_edit_user to False and name to 'ldap'.
164 # TODO(tres): Remove these once Keystone has an API to identify auth backend.
165 OPENSTACK_KEYSTONE_BACKEND = {
167 'can_edit_user': True,
168 'can_edit_group': True,
169 'can_edit_project': True,
170 'can_edit_domain': True,
171 'can_edit_role': True
174 #Setting this to True, will add a new "Retrieve Password" action on instance,
175 #allowing Admin session password retrieval/decryption.
176 #OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
178 # The Xen Hypervisor has the ability to set the mount point for volumes
179 # attached to instances (other Hypervisors currently do not). Setting
180 # can_set_mount_point to True will add the option to set the mount point
182 OPENSTACK_HYPERVISOR_FEATURES = {
183 'can_set_mount_point': False,
184 'can_set_password': False,
187 # The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
188 # services provided by neutron. Options currently available are load
189 # balancer service, security groups, quotas, VPN service.
190 OPENSTACK_NEUTRON_NETWORK = {
192 'enable_firewall': False,
193 'enable_quotas': True,
195 # The profile_support option is used to detect if an external router can be
196 # configured via the dashboard. When using specific plugins the
197 # profile_support can be turned on if needed.
198 'profile_support': None,
199 #'profile_support': 'cisco',
202 # The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
203 # in the OpenStack Dashboard related to the Image service, such as the list
204 # of supported image formats.
205 # OPENSTACK_IMAGE_BACKEND = {
208 # ('aki', _('AKI - Amazon Kernel Image')),
209 # ('ami', _('AMI - Amazon Machine Image')),
210 # ('ari', _('ARI - Amazon Ramdisk Image')),
211 # ('iso', _('ISO - Optical Disk Image')),
212 # ('qcow2', _('QCOW2 - QEMU Emulator')),
216 # ('vmdk', _('VMDK'))
220 # The IMAGE_CUSTOM_PROPERTY_TITLES settings is used to customize the titles for
221 # image custom property attributes that appear on image detail pages.
222 IMAGE_CUSTOM_PROPERTY_TITLES = {
223 "architecture": _("Architecture"),
224 "kernel_id": _("Kernel ID"),
225 "ramdisk_id": _("Ramdisk ID"),
226 "image_state": _("Euca2ools state"),
227 "project_id": _("Project ID"),
228 "image_type": _("Image Type")
231 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
232 # in the Keystone service catalog. Use this setting when Horizon is running
233 # external to the OpenStack environment. The default is 'publicURL'.
234 #OPENSTACK_ENDPOINT_TYPE = "publicURL"
236 # SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
237 # case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
238 # in the Keystone service catalog. Use this setting when Horizon is running
239 # external to the OpenStack environment. The default is None. This
240 # value should differ from OPENSTACK_ENDPOINT_TYPE if used.
241 #SECONDARY_ENDPOINT_TYPE = "publicURL"
243 # The number of objects (Swift containers/objects or images) to display
244 # on a single page before providing a paging element (a "more" link)
245 # to paginate results.
246 API_RESULT_LIMIT = 1000
247 API_RESULT_PAGE_SIZE = 20
249 # The timezone of the server. This should correspond with the timezone
250 # of your entire OpenStack installation, and hopefully be in UTC.
253 # When launching an instance, the menu of available flavors is
254 # sorted by RAM usage, ascending. If you would like a different sort order,
255 # you can provide another flavor attribute as sorting key. Alternatively, you
256 # can provide a custom callback method to use for sorting. You can also provide
257 # a flag for reverse sort. For more info, see
258 # http://docs.python.org/2/library/functions.html#sorted
259 # CREATE_INSTANCE_FLAVOR_SORT = {
262 # 'key': my_awesome_callback_method,
266 # The Horizon Policy Enforcement engine uses these values to load per service
267 # policy rule files. The content of these files should match the files the
268 # OpenStack services are using to determine role based access control in the
269 # target installation.
271 # Path to directory containing policy.json files
272 #POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
273 # Map of local copy of service policy files
275 # 'identity': 'keystone_policy.json',
276 # 'compute': 'nova_policy.json',
277 # 'volume': 'cinder_policy.json',
278 # 'image': 'glance_policy.json',
281 # Trove user and database extension support. By default support for
282 # creating users and databases on database instances is turned on.
283 # To disable these extensions set the permission here to something
284 # unusable such as ["!"].
285 # TROVE_ADD_USER_PERMS = []
286 # TROVE_ADD_DATABASE_PERMS = []
290 # When set to True this will disable all logging except
291 # for loggers specified in this configuration dictionary. Note that
292 # if nothing is specified here and disable_existing_loggers is True,
293 # django.db.backends will still log unless it is disabled explicitly.
294 'disable_existing_loggers': False,
298 'class': 'django.utils.log.NullHandler',
301 # Set the level to "DEBUG" for verbose output logging.
303 'class': 'logging.StreamHandler',
307 # Logging from django.db.backends is VERY verbose, send to null
309 'django.db.backends': {
310 'handlers': ['null'],
314 'handlers': ['null'],
318 'handlers': ['console'],
322 'openstack_dashboard': {
323 'handlers': ['console'],
328 'handlers': ['console'],
333 'handlers': ['console'],
338 'handlers': ['console'],
343 'handlers': ['console'],
348 'handlers': ['console'],
353 'handlers': ['console'],
357 'ceilometerclient': {
358 'handlers': ['console'],
363 'handlers': ['console'],
368 'handlers': ['console'],
373 'handlers': ['console'],
377 'nose.plugins.manager': {
378 'handlers': ['console'],
383 'handlers': ['console'],
388 'handlers': ['null'],
394 # 'direction' should not be specified for all_tcp/udp/icmp.
395 # It is specified in the form.
396 SECURITY_GROUP_RULES = {
399 'ip_protocol': 'tcp',
405 'ip_protocol': 'udp',
411 'ip_protocol': 'icmp',
417 'ip_protocol': 'tcp',
423 'ip_protocol': 'tcp',
429 'ip_protocol': 'tcp',
435 'ip_protocol': 'tcp',
441 'ip_protocol': 'tcp',
447 'ip_protocol': 'tcp',
453 'ip_protocol': 'tcp',
459 'ip_protocol': 'tcp',
465 'ip_protocol': 'tcp',
471 'ip_protocol': 'tcp',
477 'ip_protocol': 'tcp',
483 'ip_protocol': 'tcp',
489 'ip_protocol': 'tcp',
495 'ip_protocol': 'tcp',
501 FLAVOR_EXTRA_KEYS = {
503 ('quota:read_bytes_sec', _('Quota: Read bytes')),
504 ('quota:write_bytes_sec', _('Quota: Write bytes')),
505 ('quota:cpu_quota', _('Quota: CPU')),
506 ('quota:cpu_period', _('Quota: CPU period')),
507 ('quota:inbound_average', _('Quota: Inbound average')),
508 ('quota:outbound_average', _('Quota: Outbound average')),