3 from django.utils.translation import ugettext_lazy as _
5 from openstack_dashboard import exceptions
7 DEBUG = <%= @django_debug.to_s.capitalize %>
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', ]
16 <% if @final_allowed_hosts.kind_of?(Array) %>
17 ALLOWED_HOSTS = ['<%= @final_allowed_hosts.join("', '") %>', ]
19 ALLOWED_HOSTS = ['<%= @final_allowed_hosts %>', ]
22 # Set SSL proxy settings:
23 # For Django 1.4+ pass this header from the proxy after terminating the SSL,
24 # and don't forget to strip it from the client's request.
25 # For more information see:
26 # https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header
27 # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
29 # If Horizon is being served through SSL, then uncomment the following two
30 # settings to better secure the cookies from security exploits
31 <% if @secure_cookies %>
32 CSRF_COOKIE_SECURE = True
33 SESSION_COOKIE_SECURE = True
35 #CSRF_COOKIE_SECURE = True
36 #SESSION_COOKIE_SECURE = True
39 # Overrides for OpenStack API versions. Use this setting to force the
40 # OpenStack dashboard to use a specfic API version for a given service API.
41 # NOTE: The version should be formatted as it appears in the URL for the
42 # service API. For example, The identity service APIs have inconsistent
43 # use of the decimal point, so valid options would be "2.0" or "3".
44 # OPENSTACK_API_VERSIONS = {
48 # Set this to True if running on multi-domain model. When this is enabled, it
49 # will require user to enter the Domain name in addition to username for login.
50 # OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
52 # Overrides the default domain used when running on single-domain model
53 # with Keystone V3. All entities will be created in the default domain.
54 # OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
57 # valid options would be "AUTO", "VNC" or "SPICE"
58 # CONSOLE_TYPE = "AUTO"
60 # Default OpenStack Dashboard configuration.
62 'dashboards': ('project', 'admin', 'settings',),
63 'default_dashboard': 'project',
64 'user_home': 'openstack_dashboard.views.get_user_home',
65 'ajax_queue_limit': 10,
68 'fade_duration': 1500,
69 'types': ['alert-success', 'alert-info']
71 'help_url': "<%= @help_url %>",
72 'exceptions': {'recoverable': exceptions.RECOVERABLE,
73 'not_found': exceptions.NOT_FOUND,
74 'unauthorized': exceptions.UNAUTHORIZED},
77 # Specify a regular expression to validate user passwords.
78 # HORIZON_CONFIG["password_validator"] = {
80 # "help_text": _("Your password does not meet the requirements.")
83 # Disable simplified floating IP address management for deployments with
84 # multiple floating IP pools or complex network requirements.
85 # HORIZON_CONFIG["simple_ip_management"] = False
87 # Turn off browser autocompletion for the login form if so desired.
88 # HORIZON_CONFIG["password_autocomplete"] = "off"
90 LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
92 # Set custom secret key:
93 # You can either set it to a specific value or you can let horizion generate a
94 # default secret key that is unique on this machine, e.i. regardless of the
95 # amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there
96 # may be situations where you would want to set this explicitly, e.g. when
97 # multiple dashboard instances are distributed on different machines (usually
98 # behind a load-balancer). Either you have to make sure that a session gets all
99 # requests routed to the same dashboard instance or you set the same SECRET_KEY
101 # from horizon.utils import secret_key
102 # SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
103 SECRET_KEY = '<%= @secret_key %>'
105 # We recommend you use memcached for development; otherwise after every reload
106 # of the django development server, you will have to login again. To use
107 # memcached set CACHES to something like
110 # 'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
111 # 'LOCATION' : '127.0.0.1:11211',
117 <% if @cache_server_ip %>
118 # 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
119 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
120 <% if @cache_server_ip.kind_of?(Array) %>
121 <% split = ":" + @cache_server_port + "','" %>
122 'LOCATION': [ <% @cache_server_ip.each do |ip| -%>'<%= ip -%>:<%= @cache_server_port -%>',<% end -%> ],
124 'LOCATION': '<%= @cache_server_ip %>:<%= @cache_server_port %>',
127 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
132 <% if @django_session_engine %>
133 SESSION_ENGINE = "<%= @django_session_engine %>"
136 # Send email to the console by default
137 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
138 # Or send them to /dev/null
139 #EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
141 # Configure these for your outgoing email host
142 # EMAIL_HOST = 'smtp.my-company.com'
144 # EMAIL_HOST_USER = 'djangomail'
145 # EMAIL_HOST_PASSWORD = 'top-secret!'
147 # For multiple regions uncomment this configuration, and add (endpoint, title).
148 <% if @available_regions.kind_of?(Array) %>
149 AVAILABLE_REGIONS = [
150 <% @available_regions.each do |r| -%>
151 ('<%= r[0] -%>', '<%= r[1] -%>'),
157 if (!@keystone_scheme.nil?) || (!@keystone_host.nil?) || (!@keystone_port.nil?)
158 @keystone_scheme ||= "http"
159 @keystone_host ||= "127.0.0.1"
160 @keystone_port ||= "5000"
161 @keystone_url = "#{@keystone_scheme}://#{@keystone_host}:#{@keystone_port}/v2.0"
164 OPENSTACK_KEYSTONE_URL = "<%= @keystone_url %>"
165 OPENSTACK_KEYSTONE_DEFAULT_ROLE = "<%= @keystone_default_role %>"
167 # Disable SSL certificate checks (useful for self-signed certificates):
168 # OPENSTACK_SSL_NO_VERIFY = True
170 # The CA certificate to use to verify SSL connections
171 # OPENSTACK_SSL_CACERT = '/path/to/cacert.pem'
173 # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
174 # capabilities of the auth backend for Keystone.
175 # If Keystone has been configured to use LDAP as the auth backend then set
176 # can_edit_user to False and name to 'ldap'.
178 # TODO(tres): Remove these once Keystone has an API to identify auth backend.
179 OPENSTACK_KEYSTONE_BACKEND = {
181 'can_edit_user': True,
182 'can_edit_group': True,
183 'can_edit_project': True,
184 'can_edit_domain': True,
185 'can_edit_role': True
188 # The OPENSTACK_HYPERVISOR_FEATURES settings can be used to enable optional
189 # services provided by hypervisors.
190 OPENSTACK_HYPERVISOR_FEATURES = {
191 <%- @hypervisor_options = @hypervisor_defaults.merge(@hypervisor_options) -%>
192 'can_set_mount_point': <%= @hypervisor_options['can_set_mount_point'].to_s.capitalize %>,
193 'can_set_password': <%= @hypervisor_options['can_set_password'].to_s.capitalize %>,
196 # The OPENSTACK_CINDER_FEATURES settings can be used to enable optional
197 # # services provided by cinder that is not exposed by its extension API.
198 OPENSTACK_CINDER_FEATURES = {
199 <%- @cinder_options = @cinder_defaults.merge(@cinder_options) -%>
200 'enable_backup': <%= @cinder_options['enable_backup'].to_s.capitalize %>,
203 # The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
204 # services provided by neutron. Options currenly available are load
205 # balancer service, security groups, quotas, VPN service.
206 OPENSTACK_NEUTRON_NETWORK = {
207 <%- @neutron_options = @neutron_defaults.merge(@neutron_options) -%>
208 'enable_lb': <%= @neutron_options['enable_lb'].to_s.capitalize %>,
209 'enable_firewall': <%= @neutron_options['enable_firewall'].to_s.capitalize %>,
210 'enable_quotas': <%= @neutron_options['enable_quotas'].to_s.capitalize %>,
211 'enable_security_group': <%= @neutron_options['enable_security_group'].to_s.capitalize %>,
212 'enable_vpn': <%= @neutron_options['enable_vpn'].to_s.capitalize %>,
213 # The profile_support option is used to detect if an externa lrouter can be
214 # configured via the dashboard. When using specific plugins the
215 # profile_support can be turned on if needed.
216 <%- if @neutron_options['profile_support'] != 'None' -%>
217 'profile_support': '<%= @neutron_options['profile_support'] %>',
219 #'profile_support': 'cisco',
222 # The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
223 # in the OpenStack Dashboard related to the Image service, such as the list
224 # of supported image formats.
225 # OPENSTACK_IMAGE_BACKEND = {
228 # ('aki', _('AKI - Amazon Kernel Image')),
229 # ('ami', _('AMI - Amazon Machine Image')),
230 # ('ari', _('ARI - Amazon Ramdisk Image')),
231 # ('iso', _('ISO - Optical Disk Image')),
232 # ('qcow2', _('QCOW2 - QEMU Emulator')),
236 # ('vmdk', _('VMDK'))
240 # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
241 # in the Keystone service catalog. Use this setting when Horizon is running
242 # external to the OpenStack environment. The default is 'publicURL'.
243 #OPENSTACK_ENDPOINT_TYPE = "publicURL"
244 <% if @openstack_endpoint_type %>
245 OPENSTACK_ENDPOINT_TYPE = "<%= @openstack_endpoint_type %>"
248 # SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
249 # case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
250 # in the Keystone service catalog. Use this setting when Horizon is running
251 # external to the OpenStack environment. The default is None. This
252 # value should differ from OPENSTACK_ENDPOINT_TYPE if used.
253 #SECONDARY_ENDPOINT_TYPE = "publicURL"
254 <% if @secondary_endpoint_type %>
255 SECONDARY_ENDPOINT_TYPE = "<%= @secondary_endpoint_type %>"
258 # The number of objects (Swift containers/objects or images) to display
259 # on a single page before providing a paging element (a "more" link)
260 # to paginate results.
261 API_RESULT_LIMIT = <%= @api_result_limit %>
262 API_RESULT_PAGE_SIZE = 20
264 # The timezone of the server. This should correspond with the timezone
265 # of your entire OpenStack installation, and hopefully be in UTC.
268 # If you have external monitoring links, eg:
269 <% if @horizon_app_links %>
270 EXTERNAL_MONITORING = <%= @horizon_app_links %>
273 # When launching an instance, the menu of available flavors is
274 # sorted by RAM usage, ascending. Provide a callback method here
275 # (and/or a flag for reverse sort) for the sorted() method if you'd
276 # like a different behaviour. For more info, see
277 # http://docs.python.org/2/library/functions.html#sorted
278 # CREATE_INSTANCE_FLAVOR_SORT = {
279 # 'key': my_awesome_callback_method,
283 # The Horizon Policy Enforcement engine uses these values to load per service
284 # policy rule files. The content of these files should match the files the
285 # OpenStack services are using to determine role based access control in the
286 # target installation.
288 # Path to directory containing policy.json files
289 <% if !(@policy_files_path.nil?) %>
290 POLICY_FILES_PATH = '<%= @policy_files_path %>'
291 <% elsif @osfamily == 'RedHat' %>
292 POLICY_FILES_PATH = '/etc/openstack-dashboard'
294 #POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
297 # Map of local copy of service policy files
298 <% if @policy_files.kind_of?(Hash) %>
300 <% @policy_files.sort.each do |service_name,filename| -%>
301 '<%= service_name -%>': '<%= filename -%>',
306 # 'identity': 'keystone_policy.json',
307 # 'compute': 'nova_policy.json'
311 # Trove user and database extension support. By default support for
312 # creating users and databases on database instances is turned on.
313 # To disable these extensions set the permission here to something
314 # unusable such as ["!"].
315 # TROVE_ADD_USER_PERMS = []
316 # TROVE_ADD_DATABASE_PERMS = []
320 # When set to True this will disable all logging except
321 # for loggers specified in this configuration dictionary. Note that
322 # if nothing is specified here and disable_existing_loggers is True,
323 # django.db.backends will still log unless it is disabled explicitly.
324 'disable_existing_loggers': False,
327 'format': '%(asctime)s %(process)d %(levelname)s %(name)s '
334 'class': 'django.utils.log.NullHandler',
337 # Set the level to "DEBUG" for verbose output logging.
339 'class': 'logging.StreamHandler',
342 'level': '<%= @log_level %>',
343 'class': 'logging.FileHandler',
344 'filename': '<%= scope.lookupvar("horizon::params::logdir") %>/horizon.log',
345 'formatter': 'verbose',
349 # Logging from django.db.backends is VERY verbose, send to null
351 'django.db.backends': {
352 'handlers': ['null'],
356 'handlers': ['null'],
360 # 'handlers': ['console'],
361 'handlers': ['file'],
363 'level': '<%= @log_level %>',
366 'openstack_dashboard': {
367 # 'handlers': ['console'],
368 'handlers': ['file'],
370 'level': '<%= @log_level %>',
374 # 'handlers': ['console'],
375 'handlers': ['file'],
377 'level': '<%= @log_level %>',
381 # 'handlers': ['console'],
382 'handlers': ['file'],
384 'level': '<%= @log_level %>',
388 # 'handlers': ['console'],
389 'handlers': ['file'],
391 'level': '<%= @log_level %>',
395 # 'handlers': ['console'],
396 'handlers': ['file'],
398 'level': '<%= @log_level %>',
402 # 'handlers': ['console'],
403 'handlers': ['file'],
405 'level': '<%= @log_level %>',
409 # 'handlers': ['console'],
410 'handlers': ['file'],
412 'level': '<%= @log_level %>',
415 'ceilometerclient': {
416 # 'handlers': ['console'],
417 'handlers': ['file'],
419 'level': '<%= @log_level %>',
423 # 'handlers': ['console'],
424 'handlers': ['file'],
426 'level': '<%= @log_level %>',
430 # 'handlers': ['console'],
431 'handlers': ['file'],
433 'level': '<%= @log_level %>',
437 # 'handlers': ['console'],
438 'handlers': ['file'],
440 'level': '<%= @log_level %>',
443 'nose.plugins.manager': {
444 # 'handlers': ['console'],
445 'handlers': ['file'],
447 'level': '<%= @log_level %>',
451 # 'handlers': ['console'],
452 'handlers': ['file'],
454 'level': '<%= @log_level %>',
460 SECURITY_GROUP_RULES = {
463 'ip_protocol': 'tcp',
469 'ip_protocol': 'udp',
475 'ip_protocol': 'icmp',
481 'ip_protocol': 'tcp',
487 'ip_protocol': 'tcp',
493 'ip_protocol': 'tcp',
499 'ip_protocol': 'tcp',
505 'ip_protocol': 'tcp',
511 'ip_protocol': 'tcp',
517 'ip_protocol': 'tcp',
523 'ip_protocol': 'tcp',
529 'ip_protocol': 'tcp',
535 'ip_protocol': 'tcp',
541 'ip_protocol': 'tcp',
547 'ip_protocol': 'tcp',
553 'ip_protocol': 'tcp',
559 'ip_protocol': 'tcp',
565 LOGIN_URL = '<%= scope.lookupvar("horizon::params::root_url") %>/auth/login/'
566 LOGOUT_URL = '<%= scope.lookupvar("horizon::params::root_url") %>/auth/logout/'
567 LOGIN_REDIRECT_URL = '<%= scope.lookupvar("horizon::params::root_url") %>'
569 # The Ubuntu package includes pre-compressed JS and compiled CSS to allow
570 # offline compression by default. To enable online compression, install
571 # the python-lesscpy package and disable the following option.
572 COMPRESS_OFFLINE = <%= @compress_offline.to_s.capitalize %>
574 # For Glance image upload, Horizon uses the file upload support from Django
575 # so we add this option to change the directory where uploaded files are temporarily
576 # stored until they are loaded into Glance.
577 FILE_UPLOAD_TEMP_DIR = '<%= @file_upload_temp_dir %>'