microstack/snap-overlay/templates/05_snap_tweaks.j2

57 lines
1.9 KiB
Django/Jinja

# Tweaks to make this run nicely in a snap.
# TODO(wolsen): This should be turned off, but doing so will cause django
# to no longer serve static files by default. When turning this from True
# to False, django will need to be told to serve the static files or the
# nginx will need to be configured to serve these static files in order
# for things like css, js, and images to be retrievable.
DEBUG = True
# Set our webroot.
WEBROOT = '/'
# Django wants to write out compressed files even when we turn
# compression off (either a bug or something that I'm not
# understanding). Tell it to write them some place writeable.
STATIC_ROOT = '/var/snap/microstack/common/var/horizon/static'
# Disable extra themes for now. TODO: Re-enable when
# https://github.com/CanonicalLtd/microstack/issues/39 is
# addressed. (You'll need to uncomment the material theme below when testing
# the fix.)
AVAILABLE_THEMES = [
('default', 'Default', 'themes/default'),
# ('material', 'Material', 'themes/material'),
('ubuntu', 'Ubuntu', 'themes/ubuntu'),
]
# Point us at keystone.
OPENSTACK_HOST = "10.20.20.1"
OPENSTACK_KEYSTONE_URL = "https://%s:5000/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "member"
# Turn off external access for now. (This should be turned on once we
# have hooks for setting a non default password.)
ALLOWED_HOSTS = "{{ dashboard_allowed_hosts }}".split(",")
# Use memcached as our caching backend.
CACHES = {
'default': {
#
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '10.20.20.1:11211',
}
}
SESSION_ENGINE='django.contrib.sessions.backends.cache'
# SSL config
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
{% if tls_generate_self_signed|lower == "false" %}
# TODO(coreycb): Can we verify cert if self-signed certs
# include a ca-cert and cert?
OPENSTACK_SSL_CACERT = "{{ tls_cacert_path }}"
{% else %}
OPENSTACK_SSL_NO_VERIFY = True
{% endif %}