The current horizon_settings.py in devstack is out-of-date and we
tend to forget to update this file. This commit changes devstack
to use the example settings in horizon repo.
Change-Id: I0bb6af21a806a72ed59f31b094dd21da85ca335e
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,169 +0,0 @@ |
| 1 |
-import os |
|
| 2 |
- |
|
| 3 |
-from django.utils.translation import ugettext_lazy as _ |
|
| 4 |
- |
|
| 5 |
-DEBUG = True |
|
| 6 |
-TEMPLATE_DEBUG = DEBUG |
|
| 7 |
-PROD = False |
|
| 8 |
-USE_SSL = False |
|
| 9 |
- |
|
| 10 |
-# Set SSL proxy settings: |
|
| 11 |
-# For Django 1.4+ pass this header from the proxy after terminating the SSL, |
|
| 12 |
-# and don't forget to strip it from the client's request. |
|
| 13 |
-# For more information see: |
|
| 14 |
-# https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header |
|
| 15 |
-# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https')
|
|
| 16 |
- |
|
| 17 |
-# Specify a regular expression to validate user passwords. |
|
| 18 |
-# HORIZON_CONFIG = {
|
|
| 19 |
-# "password_validator": {
|
|
| 20 |
-# "regex": '.*', |
|
| 21 |
-# "help_text": _("Your password does not meet the requirements.")
|
|
| 22 |
-# }, |
|
| 23 |
-# 'help_url': "http://docs.openstack.org" |
|
| 24 |
-# } |
|
| 25 |
- |
|
| 26 |
-LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) |
|
| 27 |
- |
|
| 28 |
-# FIXME: We need to change this to mysql, instead of sqlite. |
|
| 29 |
-DATABASES = {
|
|
| 30 |
- 'default': {
|
|
| 31 |
- 'ENGINE': 'django.db.backends.sqlite3', |
|
| 32 |
- 'NAME': os.path.join(LOCAL_PATH, 'dashboard_openstack.sqlite3'), |
|
| 33 |
- 'TEST_NAME': os.path.join(LOCAL_PATH, 'test.sqlite3'), |
|
| 34 |
- }, |
|
| 35 |
-} |
|
| 36 |
- |
|
| 37 |
-# Set custom secret key: |
|
| 38 |
-# You can either set it to a specific value or you can let horizion generate a |
|
| 39 |
-# default secret key that is unique on this machine, e.i. regardless of the |
|
| 40 |
-# amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there |
|
| 41 |
-# may be situations where you would want to set this explicitly, e.g. when |
|
| 42 |
-# multiple dashboard instances are distributed on different machines (usually |
|
| 43 |
-# behind a load-balancer). Either you have to make sure that a session gets all |
|
| 44 |
-# requests routed to the same dashboard instance or you set the same SECRET_KEY |
|
| 45 |
-# for all of them. |
|
| 46 |
-from horizon.utils import secret_key |
|
| 47 |
-SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store')) |
|
| 48 |
- |
|
| 49 |
-# We recommend you use memcached for development; otherwise after every reload |
|
| 50 |
-# of the django development server, you will have to login again. To use |
|
| 51 |
-# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/' |
|
| 52 |
-CACHE_BACKEND = 'dummy://' |
|
| 53 |
-SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db' |
|
| 54 |
- |
|
| 55 |
-# Send email to the console by default |
|
| 56 |
-EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
|
| 57 |
-# Or send them to /dev/null |
|
| 58 |
-#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' |
|
| 59 |
- |
|
| 60 |
-# django-mailer uses a different settings attribute |
|
| 61 |
-MAILER_EMAIL_BACKEND = EMAIL_BACKEND |
|
| 62 |
- |
|
| 63 |
-# Configure these for your outgoing email host |
|
| 64 |
-# EMAIL_HOST = 'smtp.my-company.com' |
|
| 65 |
-# EMAIL_PORT = 25 |
|
| 66 |
-# EMAIL_HOST_USER = 'djangomail' |
|
| 67 |
-# EMAIL_HOST_PASSWORD = 'top-secret!' |
|
| 68 |
- |
|
| 69 |
-# For multiple regions uncomment this configuration, and add (endpoint, title). |
|
| 70 |
-# AVAILABLE_REGIONS = [ |
|
| 71 |
-# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
|
|
| 72 |
-# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
|
|
| 73 |
-# ] |
|
| 74 |
- |
|
| 75 |
-OPENSTACK_HOST = "127.0.0.1" |
|
| 76 |
-OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST |
|
| 77 |
-OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" |
|
| 78 |
- |
|
| 79 |
-# Disable SSL certificate checks (useful for self-signed certificates): |
|
| 80 |
-# OPENSTACK_SSL_NO_VERIFY = True |
|
| 81 |
- |
|
| 82 |
-HORIZON_CONFIG = {
|
|
| 83 |
- 'dashboards': ('project', 'admin', 'settings',),
|
|
| 84 |
- 'default_dashboard': 'project', |
|
| 85 |
-} |
|
| 86 |
- |
|
| 87 |
-# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the |
|
| 88 |
-# capabilities of the auth backend for Keystone. |
|
| 89 |
-# If Keystone has been configured to use LDAP as the auth backend then set |
|
| 90 |
-# can_edit_user to False and name to 'ldap'. |
|
| 91 |
-# |
|
| 92 |
-# TODO(tres): Remove these once Keystone has an API to identify auth backend. |
|
| 93 |
-OPENSTACK_KEYSTONE_BACKEND = {
|
|
| 94 |
- 'name': 'native', |
|
| 95 |
- 'can_edit_user': True |
|
| 96 |
-} |
|
| 97 |
- |
|
| 98 |
-OPENSTACK_HYPERVISOR_FEATURES = {
|
|
| 99 |
- 'can_set_mount_point': True |
|
| 100 |
-} |
|
| 101 |
- |
|
| 102 |
-# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints |
|
| 103 |
-# in the Keystone service catalog. Use this setting when Horizon is running |
|
| 104 |
-# external to the OpenStack environment. The default is 'internalURL'. |
|
| 105 |
-#OPENSTACK_ENDPOINT_TYPE = "publicURL" |
|
| 106 |
- |
|
| 107 |
-# The number of objects (Swift containers/objects or images) to display |
|
| 108 |
-# on a single page before providing a paging element (a "more" link) |
|
| 109 |
-# to paginate results. |
|
| 110 |
-API_RESULT_LIMIT = 1000 |
|
| 111 |
-API_RESULT_PAGE_SIZE = 20 |
|
| 112 |
- |
|
| 113 |
-SWIFT_PAGINATE_LIMIT = 100 |
|
| 114 |
- |
|
| 115 |
-# The timezone of the server. This should correspond with the timezone |
|
| 116 |
-# of your entire OpenStack installation, and hopefully be in UTC. |
|
| 117 |
-TIME_ZONE = "UTC" |
|
| 118 |
- |
|
| 119 |
-#LOGGING = {
|
|
| 120 |
-# 'version': 1, |
|
| 121 |
-# # When set to True this will disable all logging except |
|
| 122 |
-# # for loggers specified in this configuration dictionary. Note that |
|
| 123 |
-# # if nothing is specified here and disable_existing_loggers is True, |
|
| 124 |
-# # django.db.backends will still log unless it is disabled explicitly. |
|
| 125 |
-# 'disable_existing_loggers': False, |
|
| 126 |
-# 'handlers': {
|
|
| 127 |
-# 'null': {
|
|
| 128 |
-# 'level': 'DEBUG', |
|
| 129 |
-# 'class': 'django.utils.log.NullHandler', |
|
| 130 |
-# }, |
|
| 131 |
-# 'console': {
|
|
| 132 |
-# # Set the level to "DEBUG" for verbose output logging. |
|
| 133 |
-# 'level': 'INFO', |
|
| 134 |
-# 'class': 'logging.StreamHandler', |
|
| 135 |
-# }, |
|
| 136 |
-# }, |
|
| 137 |
-# 'loggers': {
|
|
| 138 |
-# # Logging from django.db.backends is VERY verbose, send to null |
|
| 139 |
-# # by default. |
|
| 140 |
-# 'django.db.backends': {
|
|
| 141 |
-# 'handlers': ['null'], |
|
| 142 |
-# 'propagate': False, |
|
| 143 |
-# }, |
|
| 144 |
-# 'horizon': {
|
|
| 145 |
-# 'handlers': ['console'], |
|
| 146 |
-# 'propagate': False, |
|
| 147 |
-# }, |
|
| 148 |
-# 'openstack_dashboard': {
|
|
| 149 |
-# 'handlers': ['console'], |
|
| 150 |
-# 'propagate': False, |
|
| 151 |
-# }, |
|
| 152 |
-# 'novaclient': {
|
|
| 153 |
-# 'handlers': ['console'], |
|
| 154 |
-# 'propagate': False, |
|
| 155 |
-# }, |
|
| 156 |
-# 'keystoneclient': {
|
|
| 157 |
-# 'handlers': ['console'], |
|
| 158 |
-# 'propagate': False, |
|
| 159 |
-# }, |
|
| 160 |
-# 'glanceclient': {
|
|
| 161 |
-# 'handlers': ['console'], |
|
| 162 |
-# 'propagate': False, |
|
| 163 |
-# }, |
|
| 164 |
-# 'nose.plugins.manager': {
|
|
| 165 |
-# 'handlers': ['console'], |
|
| 166 |
-# 'propagate': False, |
|
| 167 |
-# } |
|
| 168 |
-# } |
|
| 169 |
-#} |
| ... | ... |
@@ -29,6 +29,10 @@ set +o xtrace |
| 29 | 29 |
# Set up default directories |
| 30 | 30 |
HORIZON_DIR=$DEST/horizon |
| 31 | 31 |
|
| 32 |
+# local_settings.py is used to customize Dashboard settings. |
|
| 33 |
+# The example file in Horizon repo is used by default. |
|
| 34 |
+HORIZON_SETTINGS=${HORIZON_SETTINGS:-$HORIZON_DIR/openstack_dashboard/local/local_settings.py.example}
|
|
| 35 |
+ |
|
| 32 | 36 |
# Allow overriding the default Apache user and group, default to |
| 33 | 37 |
# current user and his default group. |
| 34 | 38 |
APACHE_USER=${APACHE_USER:-$USER}
|
| ... | ... |
@@ -77,7 +81,7 @@ function init_horizon() {
|
| 77 | 77 |
|
| 78 | 78 |
# ``local_settings.py`` is used to override horizon default settings. |
| 79 | 79 |
local_settings=$HORIZON_DIR/openstack_dashboard/local/local_settings.py |
| 80 |
- cp $FILES/horizon_settings.py $local_settings |
|
| 80 |
+ cp $HORIZON_SETTINGS $local_settings |
|
| 81 | 81 |
|
| 82 | 82 |
# enable loadbalancer dashboard in case service is enabled |
| 83 | 83 |
if is_service_enabled q-lbaas; then |