From 82c0efd139da17f1591af5899f4c4b07bc70b8f5 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Fri, 3 Nov 2023 16:34:28 +0100 Subject: [PATCH] Set HORIZON_IMAGES_UPLOAD_MODE to direct by default Change-Id: I4aa6dc90c6e6da6cd5fa94ad9ea02396e9c60a8b --- ansible/roles/glance/templates/glance-api.conf.j2 | 3 +++ ansible/roles/horizon/templates/local_settings.j2 | 2 +- ...orizon-image-upload-direct-5a697772e5f8c4b3.yaml | 13 +++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/horizon-image-upload-direct-5a697772e5f8c4b3.yaml diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2 index 9f892c5d26..9f603a7150 100644 --- a/ansible/roles/glance/templates/glance-api.conf.j2 +++ b/ansible/roles/glance/templates/glance-api.conf.j2 @@ -151,3 +151,6 @@ auth_endpoint = {{ keystone_internal_url }} barbican_endpoint_type = internal verify_ssl_path = {{ openstack_cacert }} {% endif %} + +[cors] +allowed_origin = {{ horizon_public_endpoint }} diff --git a/ansible/roles/horizon/templates/local_settings.j2 b/ansible/roles/horizon/templates/local_settings.j2 index b4fbbf99d5..7e47a5cfe9 100644 --- a/ansible/roles/horizon/templates/local_settings.j2 +++ b/ansible/roles/horizon/templates/local_settings.j2 @@ -415,7 +415,7 @@ IMAGE_RESERVED_CUSTOM_PROPERTIES = [] # Horizon server. When enabled, a file form field will appear on the create # image form. If set to 'off', there will be no file form field on the create # image form. See documentation for deployment considerations. -#HORIZON_IMAGES_UPLOAD_MODE = 'legacy' +HORIZON_IMAGES_UPLOAD_MODE = 'direct' # OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints # in the Keystone service catalog. Use this setting when Horizon is running diff --git a/releasenotes/notes/horizon-image-upload-direct-5a697772e5f8c4b3.yaml b/releasenotes/notes/horizon-image-upload-direct-5a697772e5f8c4b3.yaml new file mode 100644 index 0000000000..de11f7f5cb --- /dev/null +++ b/releasenotes/notes/horizon-image-upload-direct-5a697772e5f8c4b3.yaml @@ -0,0 +1,13 @@ +--- +features: + - | + ``HORIZON_IMAGES_UPLOAD_MODE`` is now set to ``'direct'`` by default. + This improves image uploads from clients, because these no longer use + Horizon's webserver as a staging area - the image upload goes directly + to Glance API. +upgrade: + - | + ``HORIZON_IMAGES_UPLOAD_MODE`` is now set to ``'direct'`` by default. + In order to retain the previous default (``'legacy'``) - please + set ``HORIZON_IMAGES_UPLOAD_MODE: 'legacy'`` in your + ``custom_local_settings`` file.