summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-11-22 11:09:30 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-11-27 10:39:51 -0500
commit64d36f6a9546f0c6d1d2a220b20164e32a03e8a8 (patch)
treee373999f1ebc76d5620f4afb23efa520821738b9 /meta-openstack/recipes-devtools/python
parent8fdbf26a2b1fc798c10699424199663c036745af (diff)
downloadmeta-cloud-services-64d36f6a9546f0c6d1d2a220b20164e32a03e8a8.tar.gz
python-horizon: fixups to get things working with stable/pike
A number of changes to get the openstack-dashboard up and running. We replace the old copy of local_setttings.py with a new version from source. Along with this we avoid touches to settings.py (it 'sources' local_settings.py so we should consolidate our changes there). We run django's 'collectstatic' as a postinst, this matches other distros and the openstack documentation, as well as easing the procedure to move from debug to production. For some operations horizon is attempting to use keystone v2.0 instead of v3 so there remain some issues. Overall, horizon is functional so we will call this 'working' and complete any additional fixups individually which will allow for better tracking of the changes. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python')
-rw-r--r--meta-openstack/recipes-devtools/python/python-horizon/local_settings.py690
-rw-r--r--meta-openstack/recipes-devtools/python/python-horizon/wsgi-horizon.conf14
-rw-r--r--meta-openstack/recipes-devtools/python/python-horizon_git.bb93
3 files changed, 638 insertions, 159 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-horizon/local_settings.py b/meta-openstack/recipes-devtools/python/python-horizon/local_settings.py
index 3ba4ab0..777d1d3 100644
--- a/meta-openstack/recipes-devtools/python/python-horizon/local_settings.py
+++ b/meta-openstack/recipes-devtools/python/python-horizon/local_settings.py
@@ -1,13 +1,39 @@
1# -*- coding: utf-8 -*-
2
1import os 3import os
2 4
3from django.utils.translation import ugettext_lazy as _ 5from django.utils.translation import ugettext_lazy as _
4 6
5from openstack_dashboard import exceptions 7from horizon.utils import secret_key
8
9from openstack_dashboard.settings import HORIZON_CONFIG
6 10
7DEBUG = True 11DEBUG = True
8TEMPLATE_DEBUG = DEBUG
9 12
10# Required for Django 1.5. 13STATIC_ROOT = '%LOCAL_PATH%'
14
15# This setting controls whether or not compression is enabled. Disabling
16# compression makes Horizon considerably slower, but makes it much easier
17# to debug JS and CSS changes
18#COMPRESS_ENABLED = not DEBUG
19
20# This setting controls whether compression happens on the fly, or offline
21# with `python manage.py compress`
22# See https://django-compressor.readthedocs.io/en/latest/usage/#offline-compression
23# for more information
24#COMPRESS_OFFLINE = not DEBUG
25
26# WEBROOT is the location relative to Webserver root
27# should end with a slash.
28WEBROOT = '/horizon/'
29#LOGIN_URL = WEBROOT + 'auth/login/'
30#LOGOUT_URL = WEBROOT + 'auth/logout/'
31#
32# LOGIN_REDIRECT_URL can be used as an alternative for
33# HORIZON_CONFIG.user_home, if user_home is not set.
34# Do not set it to '/home/', as this will cause circular redirect loop
35#LOGIN_REDIRECT_URL = WEBROOT
36
11# If horizon is running in production (DEBUG is False), set this 37# If horizon is running in production (DEBUG is False), set this
12# with the list of host/domain names that the application can serve. 38# with the list of host/domain names that the application can serve.
13# For more information see: 39# For more information see:
@@ -15,96 +41,130 @@ TEMPLATE_DEBUG = DEBUG
15#ALLOWED_HOSTS = ['horizon.example.com', ] 41#ALLOWED_HOSTS = ['horizon.example.com', ]
16 42
17# Set SSL proxy settings: 43# Set SSL proxy settings:
18# For Django 1.4+ pass this header from the proxy after terminating the SSL, 44# Pass this header from the proxy after terminating the SSL,
19# and don't forget to strip it from the client's request. 45# and don't forget to strip it from the client's request.
20# For more information see: 46# For more information see:
21# https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header 47# https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
22# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') 48#SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
23 49
24# If Horizon is being served through SSL, then uncomment the following two 50# If Horizon is being served through SSL, then uncomment the following two
25# settings to better secure the cookies from security exploits 51# settings to better secure the cookies from security exploits
26#CSRF_COOKIE_SECURE = True 52#CSRF_COOKIE_SECURE = True
27#SESSION_COOKIE_SECURE = True 53#SESSION_COOKIE_SECURE = True
28 54
55# The absolute path to the directory where message files are collected.
56# The message file must have a .json file extension. When the user logins to
57# horizon, the message files collected are processed and displayed to the user.
58#MESSAGES_PATH=None
59
29# Overrides for OpenStack API versions. Use this setting to force the 60# Overrides for OpenStack API versions. Use this setting to force the
30# OpenStack dashboard to use a specfic API version for a given service API. 61# OpenStack dashboard to use a specific API version for a given service API.
62# Versions specified here should be integers or floats, not strings.
31# NOTE: The version should be formatted as it appears in the URL for the 63# 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 64# 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". 65# use of the decimal point, so valid options would be 2.0 or 3.
34# OPENSTACK_API_VERSIONS = { 66# Minimum compute version to get the instance locked status is 2.9.
35# "identity": 3 67#OPENSTACK_API_VERSIONS = {
36# } 68# "data-processing": 1.1,
69# "identity": 3,
70# "image": 2,
71# "volume": 2,
72# "compute": 2,
73#}
37 74
38# Set this to True if running on multi-domain model. When this is enabled, it 75# Set this to True if running on a multi-domain model. When this is enabled, it
39# will require user to enter the Domain name in addition to username for login. 76# will require the user to enter the Domain name in addition to the username
40# OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False 77# for login.
78#OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
79
80# Set this to True if you want available domains displayed as a dropdown menu
81# on the login screen. It is strongly advised NOT to enable this for public
82# clouds, as advertising enabled domains to unauthenticated customers
83# irresponsibly exposes private information. This should only be used for
84# private clouds where the dashboard sits behind a corporate firewall.
85#OPENSTACK_KEYSTONE_DOMAIN_DROPDOWN = False
86
87# If OPENSTACK_KEYSTONE_DOMAIN_DROPDOWN is enabled, this option can be used to
88# set the available domains to choose from. This is a list of pairs whose first
89# value is the domain name and the second is the display name.
90#OPENSTACK_KEYSTONE_DOMAIN_CHOICES = (
91# ('Default', 'Default'),
92#)
41 93
42# Overrides the default domain used when running on single-domain model 94# Overrides the default domain used when running on single-domain model
43# with Keystone V3. All entities will be created in the default domain. 95# with Keystone V3. All entities will be created in the default domain.
44# OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default' 96# NOTE: This value must be the name of the default domain, NOT the ID.
97# Also, you will most likely have a value in the keystone policy file like this
98# "cloud_admin": "rule:admin_required and domain_id:<your domain id>"
99# This value must be the name of the domain whose ID is specified there.
100#OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
101
102# Set this to True to enable panels that provide the ability for users to
103# manage Identity Providers (IdPs) and establish a set of rules to map
104# federation protocol attributes to Identity API attributes.
105# This extension requires v3.0+ of the Identity API.
106#OPENSTACK_KEYSTONE_FEDERATION_MANAGEMENT = False
45 107
46# Set Console type: 108# Set Console type:
47# valid options would be "AUTO", "VNC" or "SPICE" 109# valid options are "AUTO"(default), "VNC", "SPICE", "RDP", "SERIAL" or None
48# CONSOLE_TYPE = "AUTO" 110# Set to None explicitly if you want to deactivate the console.
49 111#CONSOLE_TYPE = "AUTO"
50# Default OpenStack Dashboard configuration. 112
51HORIZON_CONFIG = { 113# If provided, a "Report Bug" link will be displayed in the site header
52 'dashboards': ('project', 'admin', 'settings',), 114# which links to the value of this setting (ideally a URL containing
53 'default_dashboard': 'project', 115# information on how to report issues).
54 'user_home': 'openstack_dashboard.views.get_user_home', 116#HORIZON_CONFIG["bug_url"] = "http://bug-report.example.com"
55 'ajax_queue_limit': 10, 117
56 'auto_fade_alerts': { 118# Show backdrop element outside the modal, do not close the modal
57 'delay': 3000, 119# after clicking on backdrop.
58 'fade_duration': 1500, 120#HORIZON_CONFIG["modal_backdrop"] = "static"
59 'types': ['alert-success', 'alert-info']
60 },
61 'help_url': "http://docs.openstack.org",
62 'exceptions': {'recoverable': exceptions.RECOVERABLE,
63 'not_found': exceptions.NOT_FOUND,
64 'unauthorized': exceptions.UNAUTHORIZED},
65}
66 121
67# Specify a regular expression to validate user passwords. 122# Specify a regular expression to validate user passwords.
68# HORIZON_CONFIG["password_validator"] = { 123#HORIZON_CONFIG["password_validator"] = {
69# "regex": '.*', 124# "regex": '.*',
70# "help_text": _("Your password does not meet the requirements.") 125# "help_text": _("Your password does not meet the requirements."),
71# } 126#}
72 127
73# Disable simplified floating IP address management for deployments with 128# Disable simplified floating IP address management for deployments with
74# multiple floating IP pools or complex network requirements. 129# multiple floating IP pools or complex network requirements.
75# HORIZON_CONFIG["simple_ip_management"] = False 130#HORIZON_CONFIG["simple_ip_management"] = False
76 131
77# Turn off browser autocompletion for the login form if so desired. 132# Turn off browser autocompletion for forms including the login form and
78# HORIZON_CONFIG["password_autocomplete"] = "off" 133# the database creation workflow if so desired.
134#HORIZON_CONFIG["password_autocomplete"] = "off"
79 135
80LOCAL_PATH = "/usr/share/openstack-dashboard/openstack_dashboard/static" 136# Setting this to True will disable the reveal button for password fields,
137# including on the login form.
138#HORIZON_CONFIG["disable_password_reveal"] = False
139
140LOCAL_PATH = '%LOCAL_PATH%'
81 141
82# Set custom secret key: 142# Set custom secret key:
83# You can either set it to a specific value or you can let horizion generate a 143# You can either set it to a specific value or you can let horizon generate a
84# default secret key that is unique on this machine, e.i. regardless of the 144# default secret key that is unique on this machine, e.i. regardless of the
85# amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there 145# amount of Python WSGI workers (if used behind Apache+mod_wsgi): However,
86# may be situations where you would want to set this explicitly, e.g. when 146# there may be situations where you would want to set this explicitly, e.g.
87# multiple dashboard instances are distributed on different machines (usually 147# when multiple dashboard instances are distributed on different machines
88# behind a load-balancer). Either you have to make sure that a session gets all 148# (usually behind a load-balancer). Either you have to make sure that a session
89# requests routed to the same dashboard instance or you set the same SECRET_KEY 149# gets all requests routed to the same dashboard instance or you set the same
90# for all of them. 150# SECRET_KEY for all of them.
91from horizon.utils import secret_key 151SECRET_KEY = secret_key.generate_or_read_from_file(
92SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store')) 152 os.path.join(LOCAL_PATH, '.secret_key_store'))
93 153
94# We recommend you use memcached for development; otherwise after every reload 154# 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 155# of the django development server, you will have to login again. To use
96# memcached set CACHES to something like 156# memcached set CACHES to something like
97CACHES = { 157CACHES = {
98 'default': { 158 'default': {
99 'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache', 159 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
100 'LOCATION' : '127.0.0.1:11211', 160 'LOCATION': '127.0.0.1:11211',
101 } 161 },
102} 162}
103 163
104#CACHES = { 164#CACHES = {
105# 'default': { 165# 'default': {
106# 'BACKEND' : 'django.core.cache.backends.locmem.LocMemCache' 166# 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
107# } 167# },
108#} 168#}
109 169
110# Send email to the console by default 170# Send email to the console by default
@@ -113,26 +173,75 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
113#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' 173#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
114 174
115# Configure these for your outgoing email host 175# Configure these for your outgoing email host
116# EMAIL_HOST = 'smtp.my-company.com' 176#EMAIL_HOST = 'smtp.my-company.com'
117# EMAIL_PORT = 25 177#EMAIL_PORT = 25
118# EMAIL_HOST_USER = 'djangomail' 178#EMAIL_HOST_USER = 'djangomail'
119# EMAIL_HOST_PASSWORD = 'top-secret!' 179#EMAIL_HOST_PASSWORD = 'top-secret!'
120 180
121# For multiple regions uncomment this configuration, and add (endpoint, title). 181# For multiple regions uncomment this configuration, and add (endpoint, title).
122# AVAILABLE_REGIONS = [ 182#AVAILABLE_REGIONS = [
123# ('http://cluster1.example.com:5000/v2.0', 'cluster1'), 183# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
124# ('http://cluster2.example.com:5000/v2.0', 'cluster2'), 184# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
125# ] 185#]
126 186
127OPENSTACK_HOST = "127.0.0.1" 187OPENSTACK_HOST = "127.0.0.1"
128OPENSTACK_KEYSTONE_URL = "http://%s:8081/keystone/main/v2.0" % OPENSTACK_HOST 188OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
129OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" 189OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
190
191# For setting the default service region on a per-endpoint basis. Note that the
192# default value for this setting is {}, and below is just an example of how it
193# should be specified.
194DEFAULT_SERVICE_REGIONS = {
195 OPENSTACK_KEYSTONE_URL: 'RegionOne'
196}
197
198# Enables keystone web single-sign-on if set to True.
199#WEBSSO_ENABLED = False
200
201# Determines which authentication choice to show as default.
202#WEBSSO_INITIAL_CHOICE = "credentials"
203
204# The list of authentication mechanisms which include keystone
205# federation protocols and identity provider/federation protocol
206# mapping keys (WEBSSO_IDP_MAPPING). Current supported protocol
207# IDs are 'saml2' and 'oidc' which represent SAML 2.0, OpenID
208# Connect respectively.
209# Do not remove the mandatory credentials mechanism.
210# Note: The last two tuples are sample mapping keys to a identity provider
211# and federation protocol combination (WEBSSO_IDP_MAPPING).
212#WEBSSO_CHOICES = (
213# ("credentials", _("Keystone Credentials")),
214# ("oidc", _("OpenID Connect")),
215# ("saml2", _("Security Assertion Markup Language")),
216# ("acme_oidc", "ACME - OpenID Connect"),
217# ("acme_saml2", "ACME - SAML2"),
218#)
219
220# A dictionary of specific identity provider and federation protocol
221# combinations. From the selected authentication mechanism, the value
222# will be looked up as keys in the dictionary. If a match is found,
223# it will redirect the user to a identity provider and federation protocol
224# specific WebSSO endpoint in keystone, otherwise it will use the value
225# as the protocol_id when redirecting to the WebSSO by protocol endpoint.
226# NOTE: The value is expected to be a tuple formatted as: (<idp_id>, <protocol_id>).
227#WEBSSO_IDP_MAPPING = {
228# "acme_oidc": ("acme", "oidc"),
229# "acme_saml2": ("acme", "saml2"),
230#}
231
232# The Keystone Provider drop down uses Keystone to Keystone federation
233# to switch between Keystone service providers.
234# Set display name for Identity Provider (dropdown display name)
235#KEYSTONE_PROVIDER_IDP_NAME = "Local Keystone"
236# This id is used for only for comparison with the service provider IDs. This ID
237# should not match any service provider IDs.
238#KEYSTONE_PROVIDER_IDP_ID = "localkeystone"
130 239
131# Disable SSL certificate checks (useful for self-signed certificates): 240# Disable SSL certificate checks (useful for self-signed certificates):
132# OPENSTACK_SSL_NO_VERIFY = True 241#OPENSTACK_SSL_NO_VERIFY = True
133 242
134# The CA certificate to use to verify SSL connections 243# The CA certificate to use to verify SSL connections
135# OPENSTACK_SSL_CACERT = '/path/to/cacert.pem' 244#OPENSTACK_SSL_CACERT = '/path/to/cacert.pem'
136 245
137# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the 246# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
138# capabilities of the auth backend for Keystone. 247# capabilities of the auth backend for Keystone.
@@ -146,45 +255,174 @@ OPENSTACK_KEYSTONE_BACKEND = {
146 'can_edit_group': True, 255 'can_edit_group': True,
147 'can_edit_project': True, 256 'can_edit_project': True,
148 'can_edit_domain': True, 257 'can_edit_domain': True,
149 'can_edit_role': True 258 'can_edit_role': True,
150} 259}
151 260
261# Setting this to True, will add a new "Retrieve Password" action on instance,
262# allowing Admin session password retrieval/decryption.
263#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
264
265# This setting allows deployers to control whether a token is deleted on log
266# out. This can be helpful when there are often long running processes being
267# run in the Horizon environment.
268#TOKEN_DELETION_DISABLED = False
269
270# The Launch Instance user experience has been significantly enhanced.
271# You can choose whether to enable the new launch instance experience,
272# the legacy experience, or both. The legacy experience will be removed
273# in a future release, but is available as a temporary backup setting to ensure
274# compatibility with existing deployments. Further development will not be
275# done on the legacy experience. Please report any problems with the new
276# experience via the Launchpad tracking system.
277#
278# Toggle LAUNCH_INSTANCE_LEGACY_ENABLED and LAUNCH_INSTANCE_NG_ENABLED to
279# determine the experience to enable. Set them both to true to enable
280# both.
281#LAUNCH_INSTANCE_LEGACY_ENABLED = True
282#LAUNCH_INSTANCE_NG_ENABLED = False
283
284# A dictionary of settings which can be used to provide the default values for
285# properties found in the Launch Instance modal.
286#LAUNCH_INSTANCE_DEFAULTS = {
287# 'config_drive': False,
288# 'enable_scheduler_hints': True,
289# 'disable_image': False,
290# 'disable_instance_snapshot': False,
291# 'disable_volume': False,
292# 'disable_volume_snapshot': False,
293# 'create_volume': True,
294#}
295
296# The Xen Hypervisor has the ability to set the mount point for volumes
297# attached to instances (other Hypervisors currently do not). Setting
298# can_set_mount_point to True will add the option to set the mount point
299# from the UI.
152OPENSTACK_HYPERVISOR_FEATURES = { 300OPENSTACK_HYPERVISOR_FEATURES = {
153 'can_set_mount_point': True, 301 'can_set_mount_point': False,
302 'can_set_password': False,
303 'requires_keypair': False,
304 'enable_quotas': True
305}
306
307# The OPENSTACK_CINDER_FEATURES settings can be used to enable optional
308# services provided by cinder that is not exposed by its extension API.
309OPENSTACK_CINDER_FEATURES = {
310 'enable_backup': False,
154} 311}
155 312
156# The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional 313# The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
157# services provided by neutron. Options currenly available are load 314# services provided by neutron. Options currently available are load
158# balancer service, security groups, quotas, VPN service. 315# balancer service, security groups, quotas, VPN service.
159OPENSTACK_NEUTRON_NETWORK = { 316OPENSTACK_NEUTRON_NETWORK = {
160 'enable_lb': False, 317 'enable_router': True,
161 'enable_firewall': False,
162 'enable_quotas': True, 318 'enable_quotas': True,
163 'enable_vpn': False, 319 'enable_ipv6': True,
164 # The profile_support option is used to detect if an external router can be 320 'enable_distributed_router': False,
165 # configured via the dashboard. When using specific plugins the 321 'enable_ha_router': False,
166 # profile_support can be turned on if needed. 322 'enable_fip_topology_check': True,
167 'profile_support': None, 323
168 #'profile_support': 'cisco', 324 # Default dns servers you would like to use when a subnet is
325 # created. This is only a default, users can still choose a different
326 # list of dns servers when creating a new subnet.
327 # The entries below are examples only, and are not appropriate for
328 # real deployments
329 # 'default_dns_nameservers': ["8.8.8.8", "8.8.4.4", "208.67.222.222"],
330
331 # Set which provider network types are supported. Only the network types
332 # in this list will be available to choose from when creating a network.
333 # Network types include local, flat, vlan, gre, vxlan and geneve.
334 # 'supported_provider_types': ['*'],
335
336 # You can configure available segmentation ID range per network type
337 # in your deployment.
338 # 'segmentation_id_range': {
339 # 'vlan': [1024, 2048],
340 # 'vxlan': [4094, 65536],
341 # },
342
343 # You can define additional provider network types here.
344 # 'extra_provider_types': {
345 # 'awesome_type': {
346 # 'display_name': 'Awesome New Type',
347 # 'require_physical_network': False,
348 # 'require_segmentation_id': True,
349 # }
350 # },
351
352 # Set which VNIC types are supported for port binding. Only the VNIC
353 # types in this list will be available to choose from when creating a
354 # port.
355 # VNIC types include 'normal', 'direct', 'direct-physical', 'macvtap',
356 # 'baremetal' and 'virtio-forwarder'
357 # Set to empty list or None to disable VNIC type selection.
358 'supported_vnic_types': ['*'],
359
360 # Set list of available physical networks to be selected in the physical
361 # network field on the admin create network modal. If it's set to an empty
362 # list, the field will be a regular input field.
363 # e.g. ['default', 'test']
364 'physical_networks': [],
365
366}
367
368# The OPENSTACK_HEAT_STACK settings can be used to disable password
369# field required while launching the stack.
370OPENSTACK_HEAT_STACK = {
371 'enable_user_pass': True,
169} 372}
170 373
171# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features 374# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
172# in the OpenStack Dashboard related to the Image service, such as the list 375# in the OpenStack Dashboard related to the Image service, such as the list
173# of supported image formats. 376# of supported image formats.
174# OPENSTACK_IMAGE_BACKEND = { 377#OPENSTACK_IMAGE_BACKEND = {
175# 'image_formats': [ 378# 'image_formats': [
176# ('', ''), 379# ('', _('Select format')),
177# ('aki', _('AKI - Amazon Kernel Image')), 380# ('aki', _('AKI - Amazon Kernel Image')),
178# ('ami', _('AMI - Amazon Machine Image')), 381# ('ami', _('AMI - Amazon Machine Image')),
179# ('ari', _('ARI - Amazon Ramdisk Image')), 382# ('ari', _('ARI - Amazon Ramdisk Image')),
180# ('iso', _('ISO - Optical Disk Image')), 383# ('docker', _('Docker')),
181# ('qcow2', _('QCOW2 - QEMU Emulator')), 384# ('iso', _('ISO - Optical Disk Image')),
182# ('raw', _('Raw')), 385# ('ova', _('OVA - Open Virtual Appliance')),
183# ('vdi', _('VDI')), 386# ('qcow2', _('QCOW2 - QEMU Emulator')),
184# ('vhd', _('VHD')), 387# ('raw', _('Raw')),
185# ('vmdk', _('VMDK')) 388# ('vdi', _('VDI - Virtual Disk Image')),
186# ] 389# ('vhd', _('VHD - Virtual Hard Disk')),
187# } 390# ('vhdx', _('VHDX - Large Virtual Hard Disk')),
391# ('vmdk', _('VMDK - Virtual Machine Disk')),
392# ],
393#}
394
395# The IMAGE_CUSTOM_PROPERTY_TITLES settings is used to customize the titles for
396# image custom property attributes that appear on image detail pages.
397IMAGE_CUSTOM_PROPERTY_TITLES = {
398 "architecture": _("Architecture"),
399 "kernel_id": _("Kernel ID"),
400 "ramdisk_id": _("Ramdisk ID"),
401 "image_state": _("Euca2ools state"),
402 "project_id": _("Project ID"),
403 "image_type": _("Image Type"),
404}
405
406# The IMAGE_RESERVED_CUSTOM_PROPERTIES setting is used to specify which image
407# custom properties should not be displayed in the Image Custom Properties
408# table.
409IMAGE_RESERVED_CUSTOM_PROPERTIES = []
410
411# Set to 'legacy' or 'direct' to allow users to upload images to glance via
412# Horizon server. When enabled, a file form field will appear on the create
413# image form. If set to 'off', there will be no file form field on the create
414# image form. See documentation for deployment considerations.
415#HORIZON_IMAGES_UPLOAD_MODE = 'legacy'
416
417# Allow a location to be set when creating or updating Glance images.
418# If using Glance V2, this value should be False unless the Glance
419# configuration and policies allow setting locations.
420#IMAGES_ALLOW_LOCATION = False
421
422# A dictionary of default settings for create image modal.
423#CREATE_IMAGE_DEFAULTS = {
424# 'image_visibility': "public",
425#}
188 426
189# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints 427# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
190# in the Keystone service catalog. Use this setting when Horizon is running 428# in the Keystone service catalog. Use this setting when Horizon is running
@@ -194,9 +432,9 @@ OPENSTACK_NEUTRON_NETWORK = {
194# SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the 432# SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the
195# case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints 433# case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints
196# in the Keystone service catalog. Use this setting when Horizon is running 434# in the Keystone service catalog. Use this setting when Horizon is running
197# external to the OpenStack environment. The default is None. This 435# external to the OpenStack environment. The default is None. This
198# value should differ from OPENSTACK_ENDPOINT_TYPE if used. 436# value should differ from OPENSTACK_ENDPOINT_TYPE if used.
199#SECONDARY_ENDPOINT_TYPE = "publicURL" 437#SECONDARY_ENDPOINT_TYPE = None
200 438
201# The number of objects (Swift containers/objects or images) to display 439# The number of objects (Swift containers/objects or images) to display
202# on a single page before providing a paging element (a "more" link) 440# on a single page before providing a paging element (a "more" link)
@@ -204,19 +442,43 @@ OPENSTACK_NEUTRON_NETWORK = {
204API_RESULT_LIMIT = 1000 442API_RESULT_LIMIT = 1000
205API_RESULT_PAGE_SIZE = 20 443API_RESULT_PAGE_SIZE = 20
206 444
445# The size of chunk in bytes for downloading objects from Swift
446SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024
447
448# The default number of lines displayed for instance console log.
449INSTANCE_LOG_LENGTH = 35
450
451# Specify a maximum number of items to display in a dropdown.
452DROPDOWN_MAX_ITEMS = 30
453
207# The timezone of the server. This should correspond with the timezone 454# The timezone of the server. This should correspond with the timezone
208# of your entire OpenStack installation, and hopefully be in UTC. 455# of your entire OpenStack installation, and hopefully be in UTC.
209TIME_ZONE = "UTC" 456TIME_ZONE = "UTC"
210 457
211# When launching an instance, the menu of available flavors is 458# When launching an instance, the menu of available flavors is
212# sorted by RAM usage, ascending. Provide a callback method here 459# sorted by RAM usage, ascending. If you would like a different sort order,
213# (and/or a flag for reverse sort) for the sorted() method if you'd 460# you can provide another flavor attribute as sorting key. Alternatively, you
214# like a different behaviour. For more info, see 461# can provide a custom callback method to use for sorting. You can also provide
462# a flag for reverse sort. For more info, see
215# http://docs.python.org/2/library/functions.html#sorted 463# http://docs.python.org/2/library/functions.html#sorted
216# CREATE_INSTANCE_FLAVOR_SORT = { 464#CREATE_INSTANCE_FLAVOR_SORT = {
217# 'key': my_awesome_callback_method, 465# 'key': 'name',
218# 'reverse': False, 466# # or
219# } 467# 'key': my_awesome_callback_method,
468# 'reverse': False,
469#}
470
471# Set this to True to display an 'Admin Password' field on the Change Password
472# form to verify that it is indeed the admin logged-in who wants to change
473# the password.
474#ENFORCE_PASSWORD_CHECK = False
475
476# Modules that provide /auth routes that can be used to handle different types
477# of user authentication. Add auth plugins that require extra route handling to
478# this list.
479#AUTHENTICATION_URLS = [
480# 'openstack_auth.urls',
481#]
220 482
221# The Horizon Policy Enforcement engine uses these values to load per service 483# The Horizon Policy Enforcement engine uses these values to load per service
222# policy rule files. The content of these files should match the files the 484# policy rule files. The content of these files should match the files the
@@ -225,18 +487,43 @@ TIME_ZONE = "UTC"
225 487
226# Path to directory containing policy.json files 488# Path to directory containing policy.json files
227#POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf") 489#POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
228# Map of local copy of service policy files 490
491# Map of local copy of service policy files.
492# Please insure that your identity policy file matches the one being used on
493# your keystone servers. There is an alternate policy file that may be used
494# in the Keystone v3 multi-domain case, policy.v3cloudsample.json.
495# This file is not included in the Horizon repository by default but can be
496# found at
497# http://git.openstack.org/cgit/openstack/keystone/tree/etc/ \
498# policy.v3cloudsample.json
499# Having matching policy files on the Horizon and Keystone servers is essential
500# for normal operation. This holds true for all services and their policy files.
229#POLICY_FILES = { 501#POLICY_FILES = {
230# 'identity': 'keystone_policy.json', 502# 'identity': 'keystone_policy.json',
231# 'compute': 'nova_policy.json' 503# 'compute': 'nova_policy.json',
504# 'volume': 'cinder_policy.json',
505# 'image': 'glance_policy.json',
506# 'orchestration': 'heat_policy.json',
507# 'network': 'neutron_policy.json',
232#} 508#}
233 509
510# TODO: (david-lyle) remove when plugins support adding settings.
511# Note: Only used when trove-dashboard plugin is configured to be used by
512# Horizon.
234# Trove user and database extension support. By default support for 513# Trove user and database extension support. By default support for
235# creating users and databases on database instances is turned on. 514# creating users and databases on database instances is turned on.
236# To disable these extensions set the permission here to something 515# To disable these extensions set the permission here to something
237# unusable such as ["!"]. 516# unusable such as ["!"].
238# TROVE_ADD_USER_PERMS = [] 517#TROVE_ADD_USER_PERMS = []
239# TROVE_ADD_DATABASE_PERMS = [] 518#TROVE_ADD_DATABASE_PERMS = []
519
520# Change this patch to the appropriate list of tuples containing
521# a key, label and static directory containing two files:
522# _variables.scss and _styles.scss
523#AVAILABLE_THEMES = [
524# ('default', 'Default', 'themes/default'),
525# ('material', 'Material', 'themes/material'),
526#]
240 527
241LOGGING = { 528LOGGING = {
242 'version': 1, 529 'version': 1,
@@ -245,15 +532,35 @@ LOGGING = {
245 # if nothing is specified here and disable_existing_loggers is True, 532 # if nothing is specified here and disable_existing_loggers is True,
246 # django.db.backends will still log unless it is disabled explicitly. 533 # django.db.backends will still log unless it is disabled explicitly.
247 'disable_existing_loggers': False, 534 'disable_existing_loggers': False,
535 # If apache2 mod_wsgi is used to deploy OpenStack dashboard
536 # timestamp is output by mod_wsgi. If WSGI framework you use does not
537 # output timestamp for logging, add %(asctime)s in the following
538 # format definitions.
539 'formatters': {
540 'console': {
541 'format': '%(levelname)s %(name)s %(message)s'
542 },
543 'operation': {
544 # The format of "%(message)s" is defined by
545 # OPERATION_LOG_OPTIONS['format']
546 'format': '%(message)s'
547 },
548 },
248 'handlers': { 549 'handlers': {
249 'null': { 550 'null': {
250 'level': 'DEBUG', 551 'level': 'DEBUG',
251 'class': 'django.utils.log.NullHandler', 552 'class': 'logging.NullHandler',
252 }, 553 },
253 'console': { 554 'console': {
254 # Set the level to "DEBUG" for verbose output logging. 555 # Set the level to "DEBUG" for verbose output logging.
255 'level': 'INFO', 556 'level': 'INFO',
256 'class': 'logging.StreamHandler', 557 'class': 'logging.StreamHandler',
558 'formatter': 'console',
559 },
560 'operation': {
561 'level': 'INFO',
562 'class': 'logging.StreamHandler',
563 'formatter': 'operation',
257 }, 564 },
258 }, 565 },
259 'loggers': { 566 'loggers': {
@@ -272,6 +579,11 @@ LOGGING = {
272 'level': 'DEBUG', 579 'level': 'DEBUG',
273 'propagate': False, 580 'propagate': False,
274 }, 581 },
582 'horizon.operation_log': {
583 'handlers': ['operation'],
584 'level': 'INFO',
585 'propagate': False,
586 },
275 'openstack_dashboard': { 587 'openstack_dashboard': {
276 'handlers': ['console'], 588 'handlers': ['console'],
277 'level': 'DEBUG', 589 'level': 'DEBUG',
@@ -307,16 +619,6 @@ LOGGING = {
307 'level': 'DEBUG', 619 'level': 'DEBUG',
308 'propagate': False, 620 'propagate': False,
309 }, 621 },
310 'ceilometerclient': {
311 'handlers': ['console'],
312 'level': 'DEBUG',
313 'propagate': False,
314 },
315 'troveclient': {
316 'handlers': ['console'],
317 'level': 'DEBUG',
318 'propagate': False,
319 },
320 'swiftclient': { 622 'swiftclient': {
321 'handlers': ['console'], 623 'handlers': ['console'],
322 'level': 'DEBUG', 624 'level': 'DEBUG',
@@ -341,24 +643,30 @@ LOGGING = {
341 'handlers': ['null'], 643 'handlers': ['null'],
342 'propagate': False, 644 'propagate': False,
343 }, 645 },
344 } 646 'scss': {
647 'handlers': ['null'],
648 'propagate': False,
649 },
650 },
345} 651}
346 652
653# 'direction' should not be specified for all_tcp/udp/icmp.
654# It is specified in the form.
347SECURITY_GROUP_RULES = { 655SECURITY_GROUP_RULES = {
348 'all_tcp': { 656 'all_tcp': {
349 'name': 'ALL TCP', 657 'name': _('All TCP'),
350 'ip_protocol': 'tcp', 658 'ip_protocol': 'tcp',
351 'from_port': '1', 659 'from_port': '1',
352 'to_port': '65535', 660 'to_port': '65535',
353 }, 661 },
354 'all_udp': { 662 'all_udp': {
355 'name': 'ALL UDP', 663 'name': _('All UDP'),
356 'ip_protocol': 'udp', 664 'ip_protocol': 'udp',
357 'from_port': '1', 665 'from_port': '1',
358 'to_port': '65535', 666 'to_port': '65535',
359 }, 667 },
360 'all_icmp': { 668 'all_icmp': {
361 'name': 'ALL ICMP', 669 'name': _('All ICMP'),
362 'ip_protocol': 'icmp', 670 'ip_protocol': 'icmp',
363 'from_port': '-1', 671 'from_port': '-1',
364 'to_port': '-1', 672 'to_port': '-1',
@@ -448,3 +756,143 @@ SECURITY_GROUP_RULES = {
448 'to_port': '3389', 756 'to_port': '3389',
449 }, 757 },
450} 758}
759
760# Deprecation Notice:
761#
762# The setting FLAVOR_EXTRA_KEYS has been deprecated.
763# Please load extra spec metadata into the Glance Metadata Definition Catalog.
764#
765# The sample quota definitions can be found in:
766# <glance_source>/etc/metadefs/compute-quota.json
767#
768# The metadata definition catalog supports CLI and API:
769# $glance --os-image-api-version 2 help md-namespace-import
770# $glance-manage db_load_metadefs <directory_with_definition_files>
771#
772# See Metadata Definitions on: http://docs.openstack.org/developer/glance/
773
774# TODO: (david-lyle) remove when plugins support settings natively
775# Note: This is only used when the Sahara plugin is configured and enabled
776# for use in Horizon.
777# Indicate to the Sahara data processing service whether or not
778# automatic floating IP allocation is in effect. If it is not
779# in effect, the user will be prompted to choose a floating IP
780# pool for use in their cluster. False by default. You would want
781# to set this to True if you were running Nova Networking with
782# auto_assign_floating_ip = True.
783#SAHARA_AUTO_IP_ALLOCATION_ENABLED = False
784
785# The hash algorithm to use for authentication tokens. This must
786# match the hash algorithm that the identity server and the
787# auth_token middleware are using. Allowed values are the
788# algorithms supported by Python's hashlib library.
789#OPENSTACK_TOKEN_HASH_ALGORITHM = 'md5'
790
791# AngularJS requires some settings to be made available to
792# the client side. Some settings are required by in-tree / built-in horizon
793# features. These settings must be added to REST_API_REQUIRED_SETTINGS in the
794# form of ['SETTING_1','SETTING_2'], etc.
795#
796# You may remove settings from this list for security purposes, but do so at
797# the risk of breaking a built-in horizon feature. These settings are required
798# for horizon to function properly. Only remove them if you know what you
799# are doing. These settings may in the future be moved to be defined within
800# the enabled panel configuration.
801# You should not add settings to this list for out of tree extensions.
802# See: https://wiki.openstack.org/wiki/Horizon/RESTAPI
803REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES',
804 'LAUNCH_INSTANCE_DEFAULTS',
805 'OPENSTACK_IMAGE_FORMATS',
806 'OPENSTACK_KEYSTONE_DEFAULT_DOMAIN',
807 'CREATE_IMAGE_DEFAULTS']
808
809# Additional settings can be made available to the client side for
810# extensibility by specifying them in REST_API_ADDITIONAL_SETTINGS
811# !! Please use extreme caution as the settings are transferred via HTTP/S
812# and are not encrypted on the browser. This is an experimental API and
813# may be deprecated in the future without notice.
814#REST_API_ADDITIONAL_SETTINGS = []
815
816# DISALLOW_IFRAME_EMBED can be used to prevent Horizon from being embedded
817# within an iframe. Legacy browsers are still vulnerable to a Cross-Frame
818# Scripting (XFS) vulnerability, so this option allows extra security hardening
819# where iframes are not used in deployment. Default setting is True.
820# For more information see:
821# http://tinyurl.com/anticlickjack
822#DISALLOW_IFRAME_EMBED = True
823
824# Help URL can be made available for the client. To provide a help URL, edit the
825# following attribute to the URL of your choice.
826#HORIZON_CONFIG["help_url"] = "http://openstack.mycompany.org"
827
828# Settings for OperationLogMiddleware
829# OPERATION_LOG_ENABLED is flag to use the function to log an operation on
830# Horizon.
831# mask_targets is arrangement for appointing a target to mask.
832# method_targets is arrangement of HTTP method to output log.
833# format is the log contents.
834#OPERATION_LOG_ENABLED = False
835#OPERATION_LOG_OPTIONS = {
836# 'mask_fields': ['password'],
837# 'target_methods': ['POST'],
838# 'ignored_urls': ['/js/', '/static/', '^/api/'],
839# 'format': ("[%(client_ip)s] [%(domain_name)s]"
840# " [%(domain_id)s] [%(project_name)s]"
841# " [%(project_id)s] [%(user_name)s] [%(user_id)s] [%(request_scheme)s]"
842# " [%(referer_url)s] [%(request_url)s] [%(message)s] [%(method)s]"
843# " [%(http_status)s] [%(param)s]"),
844#}
845
846# The default date range in the Overview panel meters - either <today> minus N
847# days (if the value is integer N), or from the beginning of the current month
848# until today (if set to None). This setting should be used to limit the amount
849# of data fetched by default when rendering the Overview panel.
850#OVERVIEW_DAYS_RANGE = 1
851
852# To allow operators to require users provide a search criteria first
853# before loading any data into the views, set the following dict
854# attributes to True in each one of the panels you want to enable this feature.
855# Follow the convention <dashboard>.<view>
856#FILTER_DATA_FIRST = {
857# 'admin.instances': False,
858# 'admin.images': False,
859# 'admin.networks': False,
860# 'admin.routers': False,
861# 'admin.volumes': False,
862# 'identity.users': False,
863# 'identity.projects': False,
864# 'identity.groups': False,
865# 'identity.roles': False
866#}
867
868# Dict used to restrict user private subnet cidr range.
869# An empty list means that user input will not be restricted
870# for a corresponding IP version. By default, there is
871# no restriction for IPv4 or IPv6. To restrict
872# user private subnet cidr range set ALLOWED_PRIVATE_SUBNET_CIDR
873# to something like
874#ALLOWED_PRIVATE_SUBNET_CIDR = {
875# 'ipv4': ['10.0.0.0/8', '192.168.0.0/16'],
876# 'ipv6': ['fc00::/7']
877#}
878ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []}
879
880# Projects and users can have extra attributes as defined by keystone v3.
881# Horizon has the ability to display these extra attributes via this setting.
882# If you'd like to display extra data in the project or user tables, set the
883# corresponding dict key to the attribute name, followed by the display name.
884# For more information, see horizon's customization (http://docs.openstack.org/developer/horizon/topics/customizing.html#horizon-customization-module-overrides)
885#PROJECT_TABLE_EXTRA_INFO = {
886# 'phone_num': _('Phone Number'),
887#}
888#USER_TABLE_EXTRA_INFO = {
889# 'phone_num': _('Phone Number'),
890#}
891
892# Password will have an expiration date when using keystone v3 and enabling the
893# feature.
894# This setting allows you to set the number of days that the user will be alerted
895# prior to the password expiration.
896# Once the password expires keystone will deny the access and users must
897# contact an admin to change their password.
898#PASSWORD_EXPIRES_WARNING_THRESHOLD_DAYS = 0
diff --git a/meta-openstack/recipes-devtools/python/python-horizon/wsgi-horizon.conf b/meta-openstack/recipes-devtools/python/python-horizon/wsgi-horizon.conf
new file mode 100644
index 0000000..9c2111c
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-horizon/wsgi-horizon.conf
@@ -0,0 +1,14 @@
1WSGIScriptAlias /horizon %DATADIR%/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi process-group=horizon
2WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10 display-name=%{GROUP}
3WSGIProcessGroup horizon
4
5Alias /static %LOCALSTATEDIR%/lib/openstack-dashboard/static/
6Alias /horizon/static %LOCALSTATEDIR%/lib/openstack-dashboard/static/
7
8<Directory %DATADIR%/openstack-dashboard/openstack_dashboard/wsgi>
9 Require all granted
10</Directory>
11
12<Directory %LOCALSTATEDIR%/lib/openstack-dashboard/static>
13 Require all granted
14</Directory>
diff --git a/meta-openstack/recipes-devtools/python/python-horizon_git.bb b/meta-openstack/recipes-devtools/python/python-horizon_git.bb
index 51025e7..5e12e87 100644
--- a/meta-openstack/recipes-devtools/python/python-horizon_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-horizon_git.bb
@@ -74,18 +74,25 @@ RDEPENDS_${PN} += " \
74SRCNAME = "horizon" 74SRCNAME = "horizon"
75 75
76SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/pike \ 76SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/pike \
77 file://horizon.init \ 77 file://wsgi-horizon.conf \
78 file://fix_bindir_path.patch \ 78 file://fix_bindir_path.patch \
79 file://openstack-dashboard-apache.conf \
80 file://local_settings.py \ 79 file://local_settings.py \
81 file://horizon-use-full-package-path-to-test-directories.patch \ 80 file://horizon-use-full-package-path-to-test-directories.patch \
82 " 81 "
82# file://openstack-dashboard-apache.conf
83 83
84SRCREV = "246ff9f81248a00a434e66d18fad70519ba811cc" 84SRCREV = "246ff9f81248a00a434e66d18fad70519ba811cc"
85PV = "12.0.0+git${SRCPV}" 85PV = "12.0.0+git${SRCPV}"
86S = "${WORKDIR}/git" 86S = "${WORKDIR}/git"
87 87
88inherit setuptools update-rc.d python-dir default_configs monitor 88inherit setuptools systemd python-dir default_configs monitor useradd
89
90USER = "horizon"
91GROUP = "horizon"
92
93USERADD_PACKAGES = "${PN}"
94GROUPADD_PARAM_${PN} = "--system ${GROUP}"
95USERADD_PARAM_${PN} = "--system -m -d ${localstatedir}/lib/openstack-dashboard -s /bin/false -g ${GROUP} ${USER}"
89 96
90# no longer required. kept as reference. 97# no longer required. kept as reference.
91# do_install[dirs] += "${D}/usr/share/bin" 98# do_install[dirs] += "${D}/usr/share/bin"
@@ -94,56 +101,70 @@ do_install_append() {
94 SYSCONF_DIR=${D}${sysconfdir} 101 SYSCONF_DIR=${D}${sysconfdir}
95 DASHBOARD_CONF_DIR=${SYSCONF_DIR}/openstack-dashboard 102 DASHBOARD_CONF_DIR=${SYSCONF_DIR}/openstack-dashboard
96 DASHBOARD_SHARE_DIR=${D}${datadir}/openstack-dashboard 103 DASHBOARD_SHARE_DIR=${D}${datadir}/openstack-dashboard
97 HORIZON_CONF_DIR=${D}${sysconfdir}/horizon 104 APACHE_CONF_DIR=${D}${sysconfdir}/apache2/conf.d/
98
99 install -d ${HORIZON_CONF_DIR}
100 105
106 # Fixup to allow running standalone. Currently broken.
101 DASHBOARD_DIR=${D}${PYTHON_SITEPACKAGES_DIR}/openstack_dashboard 107 DASHBOARD_DIR=${D}${PYTHON_SITEPACKAGES_DIR}/openstack_dashboard
102 sed -e "s:^LANGUAGE_CODE =.*:LANGUAGE_CODE = 'en-us':g" \ 108 #sed -e "s:^LANGUAGE_CODE =.*:LANGUAGE_CODE = 'en-us':g" \
103 -i ${DASHBOARD_DIR}/settings.py 109 # -i ${DASHBOARD_DIR}/settings.py
104 sed -e "s:^# from horizon.utils:from horizon.utils:g" \ 110 #sed -e "s:^# from horizon.utils:from horizon.utils:g" \
105 ${DASHBOARD_DIR}/local/local_settings.py.example > \ 111 # ${DASHBOARD_DIR}/local/local_settings.py.example > \
106 ${DASHBOARD_DIR}/local/local_settings.py 112 # ${DASHBOARD_DIR}/local/local_settings.py
107 sed -e "s:^# SECRET_KEY =:SECRET_KEY =:g" \ 113 #sed -e "s:^# SECRET_KEY =:SECRET_KEY =:g" \
108 -i ${DASHBOARD_DIR}/local/local_settings.py 114 # -i ${DASHBOARD_DIR}/local/local_settings.py
109 install -m 644 ${S}/manage.py ${DASHBOARD_DIR}/manage.py 115 install -m 644 ${S}/manage.py ${DASHBOARD_DIR}/manage.py
110 116
111 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)};
112 then
113 install -d ${D}${sysconfdir}/init.d
114 sed 's:@PYTHON_SITEPACKAGES@:${PYTHON_SITEPACKAGES_DIR}:' \
115 ${WORKDIR}/horizon.init >${WORKDIR}/horizon
116 install -m 0755 ${WORKDIR}/horizon ${D}${sysconfdir}/init.d/horizon
117 fi
118 sed -i -e 's#%PYTHON_SITEPACKAGES%#${PYTHON_SITEPACKAGES_DIR}#g' \ 117 sed -i -e 's#%PYTHON_SITEPACKAGES%#${PYTHON_SITEPACKAGES_DIR}#g' \
119 ${D}${PYTHON_SITEPACKAGES_DIR}/horizon/test/settings.py 118 ${D}${PYTHON_SITEPACKAGES_DIR}/horizon/test/settings.py
120 119
121 # no longer required. kept as reference. 120 # no longer required. kept as reference.
122 # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin 121 # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin
123 122
124 cp run_tests.sh ${HORIZON_CONF_DIR} 123 install -d ${DASHBOARD_CONF_DIR}
124 cp run_tests.sh ${DASHBOARD_CONF_DIR}
125 125
126 # the following are setup required for horizon-apache 126 # The following allows horizon to be run from apache. This
127 # is the preffered way to run horizon.
127 install -d ${DASHBOARD_SHARE_DIR} 128 install -d ${DASHBOARD_SHARE_DIR}
128 cp -a --no-preserve=ownership ${S}/openstack_dashboard ${DASHBOARD_SHARE_DIR} 129 cp -a --no-preserve=ownership ${S}/openstack_dashboard ${DASHBOARD_SHARE_DIR}
129 cp ${S}/manage.py ${DASHBOARD_SHARE_DIR} 130 cp ${S}/manage.py ${DASHBOARD_SHARE_DIR}
130 131
131 install -D -m 644 ${WORKDIR}/local_settings.py \ 132 # Copy our version of the local-settings.py file, create a convienence link
132 ${DASHBOARD_CONF_DIR}/local_settings.py 133 # between /etc/openstack-dashboard and the apache2 files installed above,
134 # lastly make a few substitions to match our installation locations.
135 SETTINGS_FILE=${DASHBOARD_CONF_DIR}/local_settings.py
136 install -D -m 644 ${WORKDIR}/local_settings.py ${SETTINGS_FILE}
137 # Link only valid on the target.
133 ln -fs ${sysconfdir}/openstack-dashboard/local_settings.py \ 138 ln -fs ${sysconfdir}/openstack-dashboard/local_settings.py \
134 ${DASHBOARD_SHARE_DIR}/openstack_dashboard/local/local_settings.py 139 ${DASHBOARD_SHARE_DIR}/openstack_dashboard/local/local_settings.py
135 140 # Be sure to edit the real file in ${D}${sysconfdir}
136 install -D -m 644 ${WORKDIR}/openstack-dashboard-apache.conf \ 141 sed -e "s:%LOCAL_PATH%:${localstatedir}/lib/openstack-dashboard/static:g" \
137 ${SYSCONF_DIR}/apache2/conf.d/openstack-dashboard-apache.conf 142 -i ${SETTINGS_FILE}
138 sed -i -e 's#%PYTHON_SITEPACKAGES%#${PYTHON_SITEPACKAGES_DIR}#' \ 143
139 ${SYSCONF_DIR}/apache2/conf.d/openstack-dashboard-apache.conf 144 # Configure apache to run horizon at http://localhost/horizon
140 sed -i -e 's#%LIBDIR%#${libdir}#' \ 145 install -m 755 -d ${APACHE_CONF_DIR}
141 ${SYSCONF_DIR}/apache2/conf.d/openstack-dashboard-apache.conf 146 APACHE_WSGI_FILE=${APACHE_CONF_DIR}/openstack-dashboard.conf
147 install -m 644 ${WORKDIR}/wsgi-horizon.conf ${APACHE_WSGI_FILE}
148 sed -e "s#%DATADIR%#${datadir}#g" -i ${APACHE_WSGI_FILE}
149 sed -e "s#%USER%#${USER}#g" -i ${APACHE_WSGI_FILE}
150 sed -e "s#%GROUP%#${GROUP}#g" -i ${APACHE_WSGI_FILE}
151 sed -e "s#%LOCALSTATEDIR%#${localstatedir}#g" -i ${APACHE_WSGI_FILE}
152
153 #HZ_SETTINGS_FILE=${DASHBOARD_SHARE_DIR}/openstack_dashboard/settings.py
154 #sed -e "s:^\(WEBROOT\ =\ \).*$:\1'/horizon':" -i ${HZ_SETTINGS_FILE}
155 #sed -e "s:^\(STATIC_ROOT\ =\ \).*$:\1'${localstatedir}/lib/openstack-dashboard/static':" \
156 # -i ${HZ_SETTINGS_FILE}
142 157
143 ln -fs openstack_dashboard/static ${DASHBOARD_SHARE_DIR}/static 158 ln -fs openstack_dashboard/static ${DASHBOARD_SHARE_DIR}/static
159}
144 160
145 # daemon is UID 1 161pkg_postinst_${SRCNAME} () {
146 chown -R 1 ${DASHBOARD_SHARE_DIR}/openstack_dashboard/static 162 if [ -n "$D" ]; then
163 exit 1
164 else
165 # Regenerate the django static files
166 sudo -u horizon /usr/bin/env python ${datadir}/openstack-dashboard/manage.py collectstatic --noinput --clear
167 fi
147} 168}
148 169
149PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-apache ${SRCNAME}-standalone" 170PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-apache ${SRCNAME}-standalone"
@@ -153,7 +174,7 @@ RDEPENDS_${SRCNAME}-tests += " bash"
153 174
154FILES_${PN} = "${libdir}/*" 175FILES_${PN} = "${libdir}/*"
155 176
156FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" 177FILES_${SRCNAME}-tests = "${sysconfdir}/openstack-dashboard/run_tests.sh"
157 178
158FILES_${SRCNAME} = "${bindir}/* \ 179FILES_${SRCNAME} = "${bindir}/* \
159 ${datadir}/* \ 180 ${datadir}/* \
@@ -179,10 +200,6 @@ RDEPENDS_${PN} += " \
179 200
180RDEPENDS_${SRCNAME} = "${PN}" 201RDEPENDS_${SRCNAME} = "${PN}"
181 202
182INITSCRIPT_PACKAGES = "${SRCNAME}"
183INITSCRIPT_NAME_${SRCNAME} = "horizon"
184INITSCRIPT_PARAMS_${SRCNAME} = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
185
186RDEPENDS_${SRCNAME}-apache = "\ 203RDEPENDS_${SRCNAME}-apache = "\
187 apache2 \ 204 apache2 \
188 mod-wsgi \ 205 mod-wsgi \