Commit Graph

326 Commits

Author SHA1 Message Date
Radomir Dopieralski caa99b2010 Switch to PyMemcacheCache backend
The new library is already supported in django 3.2 and gives us better
support for IPv6 addresses and encrypted connections.

Also, the same library is being used by all other OpenStack projects.

Depends-on: https://review.opendev.org/c/openstack/devstack/+/898302
Closes-Bug: #2039225
Change-Id: I964ac4d0d62dff4c1f7c1f1373763fbf23024269
2023-10-18 00:07:35 +09:00
Zuul 11a331c372 Merge "local_settings.py: Disable django.template DEBUG messages" 2022-04-08 20:54:23 +00:00
Akihiro Motoki 85e20a62e2 local_settings.py: Disable django.template DEBUG messages
VariableDoesNotExist error in DEBUG messages from django.template are
super noisy. It happens even for cases where variables are not defined
like "default" filter. It also happens with Django built-in templates.
Previously we tried to fix VariableDoesNotExist errors in our templates,
but it tunrs out there is no convenient way to prevent it.

We agreed to disable django.template DEBUG messages by default
in the horizon weekly meeting [1].

Closes-Bug: #1720893

[1] https://meetings.opendev.org/meetings/horizon/2022/horizon.2022-02-23-15.00.log.html#l-105

Change-Id: Ife9a91c7cd050b30d7f1eca8861a0d6629a23827
2022-02-25 17:14:53 +09:00
Akihiro Motoki cd7c1b5110 Address RemovedInDjango40Warning (2)
django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
2022-02-04 16:22:07 +09:00
manchandavishal 6ac31e0ba8 Drop Django based implementation of launch instance
horizon already deprecated launch instance Django based implementation
in the wallaby cycle [1]. This patch remove code for launch instance
Django based implementation as angular based implementation is the
default one from long and all features gaps between angular and Django
implementation is closed.

It also moves SetAdvanced step code to ``resize_instance.py`` as
``workflows/create_instance.py`` file is deleted and remove server_group
option from Advanced Options of resizing instance action because
"server_group" is not required while resizing an instance as per
nova-api reference [2].

Closes-Bug: #1869222

[1] https://review.opendev.org/c/openstack/horizon/+/779125
[2] https://docs.openstack.org/api-ref/compute/?expanded=resize-server-resize-action-detail#resize-server-resize-action

Change-Id: I5e01cd81f309491f1a58ea93911030366a86e3c7
2022-01-24 16:21:18 +05:30
白子玉 3f7fc68085 Changed default identity url to horizon
The keystone doesn't use 5000 port anymore from Newton version. And all
 the references should be changed together.

Change-Id: I3f02686ab5b3abf48f129fde92e90427ca148317
2019-12-06 18:41:38 +08:00
gaofei 5b56dfabef Fix typo
Change-Id: Id5701f2823016d86ec2cd76d64610cc53067c64f
2019-12-04 10:21:20 +08:00
Akihiro Motoki 3282bf20f7 Enable OPENSTACK_NEUTRON_NETWORK[enable_quotas] by default
neutron supports the qutoas API from long ago and most deployments
are expected to enable the neutron quotas support in horizon.
This commit changes the default value of enable_quotas in
OPENSTACK_NEUTRON_NETWORK to True.

Part of blueprint ini-based-configuration

Change-Id: I5923f08752e6a5ccd4c9cf2fa1deb6c879111f43
2019-10-18 14:27:10 +09:00
Akihiro Motoki d8d44de5d3 Relnote: default values are moved to openstack_dashboard/defaults.py
In Train release, we move most settings from local_settings.py.example
to openstack_dashboard/defaults.py. It is worth covered in the Train
release notes so that operators who depend on local_settings.py.example
can be aware of the change.

Also drops settings related to the operation log feature in
local_settings.py.example are as they are defined in
horizon/defaults.py (which is loaded by
openstack_dashboard/defaults.py).

Change-Id: Ib06925aef305ffa1545d10529acd42d04177f5e1
2019-10-03 08:41:12 +00:00
Akihiro Motoki 02d9a05eea Define remaining openstack_dashboard settings
Part of blueprint ini-based-configuration
Change-Id: I20f5b1d347d227f0facbddc8cf91b57ffa8f164d
2019-09-12 15:05:56 +09:00
Akihiro Motoki 5101ebdc28 Remove unused settings in openstack_dashboard
IMAGE_RESERVED_CUSTOM_PROPERTIES has been not used since Juno.
commit 2e3299dc57 drops the usage of
IMAGE_RESERVED_CUSTOM_PROPERTIES.

OPENSTACK_HEAT_STACK is specific to heat-dashboard and
it was moved to heat-dashboard.

FLAVOR_EXTRA_KEYS deprecation notice has been dropped. No code refers to
it for a long time (at least the recent four releases).

Part of blueprint ini-based-configuration
Change-Id: I1b81f3e437feafb18423225a93900b07ae91cc75
2019-09-12 15:05:56 +09:00
Akihiro Motoki e56e076ea8 Define default settings explicitly (openstack_auth)
This commit also moves descriptions of settings defined in openstack_auth
from openstack_dashboard/settings.py and local_settings.py(.example)
to openstack_auth/settings.py.

Note that if openstack_dashboard has different default settings
from openstack_auth defaults, they are now moved to
openstack_dashboard/defaults.py.

Part of blueprint ini-based-configuration
Change-Id: I59eebc388de0bcbd4d1fe35c6138efbd3e04c5b8
2019-09-12 15:05:56 +09:00
Akihiro Motoki 3e12c2cc48 Set log devel to DEBUG in local_settings.py.example
Log level 'DEBUG' is useful to debug our CI.
local_settings.py.example is used as a template of local_settings.py
in our CI and it is not easy to change the log level in
local_settings.py using a shell script.
This commit sets the log level of 'console' to 'DEBUG'
when DEBUG settings is true.

Note that this does not mean the change of the default value.

Change-Id: If767cbc6c027060d564bdc2839bf6e61f6425d01
2019-08-06 21:04:38 +09:00
Akihiro Motoki 2f1e1899d3 Define default settings explicitly (openstack_dashboard 5/5)
This commit mainly covers settings in the remaining files
under openstack_dashboard.

Note that HORIZON_CONFIG, horizon and openstack_auth are not covered.
They will be covered by follow-up patches.

Part of blueprint ini-based-configuration
Change-Id: Ibd70e030445a073d9a62da9867850f4893135a89
2019-07-08 18:20:32 +09:00
Akihiro Motoki 8653f718f2 Define default settings explicitly (openstack_dashboard 4/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/identity/.

Part of blueprint ini-based-configuration
Change-Id: Ibb174f62d0047a10b2832dd2ff350f5f32955b08
2019-07-05 14:49:11 +09:00
Akihiro Motoki fcdc67b819 Define default settings explicitly (openstack_dashboard 3/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/project/.

Part of blueprint ini-based-configuration
Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
2019-07-03 14:54:16 +09:00
Zuul b1a211479c Merge "Define default settings explicitly (openstack_dashboard 2/5)" 2019-06-05 12:57:02 +00:00
Zuul acc36f4958 Merge "Define default settings explicitly (openstack_dashboard 1/5)" 2019-05-29 17:38:13 +00:00
Ivan Kolodyazhny 2e52e4a4e0 Remove deprecated SHOW_KEYSTONE_V2_RC config option
SHOW_KEYSTONE_V2_RC is deprecated since Stein release and it's safe
to remove it now.

Keystone v2 support removal will be implemented in a follow up patch.

Change-Id: Ib3098789a3aef47f4f4b84fd56f03376ce2ea96f
2019-05-14 11:55:53 +00:00
ZhongShengping a569f0faf3 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: I7f5506455ed52e4670b8e428548e931db13b13db
2019-04-24 12:25:40 +08:00
Akihiro Motoki 53486be43f Define default settings explicitly (openstack_dashboard 2/5)
This commit mainly covers settings
in openstack_dashboard/dashboards/admin/.

Part of blueprint ini-based-configuration
Change-Id: Ifb3e9401a926ba9e035e1b498a4a4493c1b594f5
2019-04-24 02:32:47 +09:00
Akihiro Motoki 9c19b07a26 Define default settings explicitly (openstack_dashboard 1/5)
Currently horizon defines default values of settings in the logic
using getattr(settings, <setting name>, <default value>) and
it is not easy to handle the default values of available settings.

This commit starts the effort to define default settings explicitly.
This is a preparation for ini-based-configurations.

It covers settings in openstack_dashboard/api.

Part of blueprint ini-based-configuration
Change-Id: Id4c3287f0a572fd14ea93b54bcab8fabda39e583
2019-04-24 02:32:47 +09:00
Ivan Kolodyazhny b028b5a0aa Change Cinder API version in the documentation
Cinder API v3 is a default version for Horizon so we need
to use it in the documentation.

data-processing API version is removed from the Horizon
documentation since it's availale in a separate plugin.

Change-Id: I5f178b70f73c23f8220f44a418eec689f0bc3b1c
2019-04-11 17:44:22 +03:00
manchandavishal 58211d6284 Updating Note to Setup guide
Due to [1] patch it's better to update [2] file.
Otherwise it create confusion to a new devloper if use
"tox -e runserver" for developments.

[1] https://review.openstack.org/#/c/630790
[2] openstack_dashboard/local/local_settings.py.example

Change-Id: I2146b33f46c417c5f1d61a4958336c92f0c03e9c
2019-03-05 16:32:52 +00:00
Zuul c3d3d28853 Merge "Change the default SESSION_ENGINE to use cached sessions" 2019-02-12 21:50:31 +00:00
Akihiro Motoki a98468bef6 Change the default SESSION_ENGINE to use cached sessions
This commit changes the default SESSION_ENGINE to the cached
sessions and the default cached backend to memcached.

The cached sessions with memcahced is our current recommendation, but
we do not use it in our default settings and do not test it in our CI
(horizon-dsvm-tempest-plugin). It is better to use the recommended
configurations in our CI.
The previous default SESSION_ENGINE, the signed cookies, has
a limitation on the length o cookies and using keystone3 can hit this
easily. It is not ready for production for most cases.

For a cache backend, considering multi-process web server deployments,
memcahced is recommended rather than a local memory backend.

Note for developers: If you use "tox -e runserver" for developments,
SESSION_ENGINE = 'django.contrib.sessions.backends.cache' might not
work expectedly. From my testing, I was forced to log-in frequently
when moving pages. If you hit this, my suggestion is to configure
SESSION_ENGINE to django.contrib.sessions.backends.signed_cookies.

Change-Id: I1c4578ec5a7f70a59c6348d76ad0c12956a18573
Closes-Bug: #1736021
2019-01-15 08:07:54 +09:00
Zuul a1ffa9620e Merge "Allow to hide openrc and clouds.yaml download links" 2019-01-13 16:43:53 +00:00
Zuul c8de4fbe89 Merge "Rework old customization templates and add new blocks" 2019-01-05 15:19:06 +00:00
Adrian Turjak e9f8abb659 Rework old customization templates and add new blocks
From Rocky we can now support Django's recursive template
inheritance. Let's move away from all these stand alone
templates for deployers to override and instead direct them
to recursively extend the existing templates and the blocks they
need.

This adds more blocks, docs on how to use them, and an example
theme which can be turned on and used to show how this works.

blueprint: less-customization-templates
Change-Id: I69f1e16ff1b88cec78580df0911fe3c01b7507dd
2019-01-03 17:45:29 +13:00
Akihiro Motoki c6baf00734 Allow to hide openrc and clouds.yaml download links
Operators now can control whether the links of "Download OpenRC" and
"Download clouds.yaml" are displayed or not via new settings
SHOW_OPENRC_FILE and SHOW_OPENSTACK_CLOUDS_YAML.
openrc and clouds.yaml files provided by horizon now assume
the basic simple deployment and do not cover keystone authentication
like saml2, openid and so on. The default openrc and clouds.yaml
from horizon do not make sense for such environments.

Change-Id: I1407a24387c7d7bd2c20c995cebf1350f8090e72
Partial-Bug: #1795851
2018-12-23 05:58:51 +09:00
Akihiro Motoki d32359e011 SHOW_KEYSTONE_V2_RC defaults to False
In favor of keystone v2 support, SHOW_KEYSTONE_V2_RC now defaults
to False. SHOW_KEYSTONE_V2_RC setting is also deprecated.

Along with this change, "v3" part of "OpenStack RC File (Identity API v3)"
is now unnecessary, so "v3" information is dropped.

Change-Id: If0359e2dc1f2c8fb5f3c87046fd23043f94abc21
2018-12-23 04:02:22 +09:00
Thomas Bechtold 069329eeb2 Drop pki token check from Token class in openstack_auth
PKI Tokens got removed from Keystone in 2016[1] so this check is no
longer needed.

OPENSTACK_TOKEN_HASH_ALGORITHM setting is dropped
as it is used only in PKI token check.

[1] https://review.openstack.org/#/c/374479/

Change-Id: I2de02fe6fab531842752b03c5e17af2bcf502cd8
2018-12-09 16:58:25 +09:00
Guang Yee a53f012fa1 support WEBSSO_KEYSTONE_URL
Add a new optional WEBSSO_KEYSTONE_URL property to facilitate WEBSSO
deployments where network segmentation is used per security requirement.
In this case, the controllers are not reachable from public network.
Therefore, user's browser will not be able to reach OPENSTACK_KEYSTONE_URL
if it is set to the internal endpoint.

If WEBSSO_KEYSTONE_URL is set, it will be used instead of
OPENSTACK_KEYSTONE_URL.

Change-Id: I05ea4227aa4c2cb0a73015ed7fd29cf1a96e696a
Closes-bug: #1544703
2018-10-08 10:44:25 -07:00
Jose Castro Leon 7fc8018956 Allow to specify redirections on single IdP scenarios
In scenarios where the cloud operators have only a single Identity Provider,
we can have a default redirection to remove unnecessary user clicks and
improve user experience.

Closes-bug: #1784368

Change-Id: I251703dcaeac43174fbcba7e0658c6f92098b2e0
2018-08-13 12:11:45 +02:00
Zuul 1a312e86bd Merge "Support can_edit_user and can_edit_role settings in Angularized panels" 2018-07-18 13:46:34 +00:00
Shu Muto e20882d3b3 Support can_edit_user and can_edit_role settings in Angularized panels
The actions on Angularized users panel and roles panel does not support
following setting.

OPENSTACK_KEYSTONE_BACKEND = {
    'can_edit_user': True,
    'can_edit_role': True,
}

This patch enables to support these settings.

To enable this settings, add 'OPENSTACK_KEYSTONE_BACKEND' into
'REST_API_REQUIRED_SETTINGS' setting.

Change-Id: I7888bd2c2977dc010911d2e7ecf42815354e081b
Closes-Bug: #1779268
2018-07-18 11:25:31 +09:00
Adrian Turjak 88fb018840 Rework DEFAULT_SERVICE_REGIONS
DEFAULT_SERVICE_REGIONS is cumbersome when you have
more than one keystone endpoint and all you want to do
is set a global default service region.

This adds '*' as an optional fallback key to mean global default.
If an endpoint matches it will take precedence over the '*' value.

This also fixes the precedence order for DEFAULT_SERVICE_REGIONS
so that a user controlled cookie is used instead when that cookie
is valid for the given catalog. This changes the way the setting
works, but retains the intended result the setting was originally
intended for.

Change-Id: Ieefbd642d853fcfcf22a17d9edcc7daae72790a4
blueprint: global-default-service-region
Closes-Bug: #1772345
Related-Bugs: #1359774 #1703390
2018-07-17 13:58:24 +12:00
Ivan Kolodyazhny 1f80d94459 Use default Django test runner instead of nose
Nose has been in maintenance mode for the past several years. It has
issue with exit code [1] which leads to false positive results for our
seleniun-headless job.

This patch changes test runner for Horizon tests and does the following
things:

* Django test runner  executes test in a different order than Nose does.
  That's why we've got an issue with side-effect in
  horizon.tests.unit.tables.test_tables.MyToggleAction class. This patch
  adds workaround to it.
* Rename filename of test files to names starting with 'test_'
  so that the django test runner can find tests expectedly.
* '--with-html-output' option is temporary dropped and will be added in
  a following patch.
* Integraion tests is marked via django.test.tag mechanism which is
  introduced in Django 1.10
* 'selenium-headless' is broken now because we don't have geckodriver on
  gates, this patch makes it non-voting.
* 'tox -e cover' is fixed
* Remove @memorized decorator from
  dashboards.project.images.images.tables.filter_tenant_ids function.

[1] https://github.com/nose-devs/nose/issues/984

Depends-On: https://review.openstack.org/572095
Depends-On: https://review.openstack.org/572124
Depends-On: https://review.openstack.org/572390
Depends-On: https://review.openstack.org/572391

Related blueprint: improve-horizon-testing
Change-Id: I7fb2fd7dd40f301ea822154b9809a9a07610c507
2018-06-08 15:21:12 +03:00
Akihiro Motoki dd0eba2128 Support simple FIP disassociation (with FIP release)
We previously supported so-called "Simple FIP disassociation"
which allows users to disassociate and release a FIP in a single action.
We no longer support nova-network based features, but I believe it is worth
implemented even in a neutron-only era. This patch introduces a checkbox
"Release floating IP" to support this with neutron.

At the same time, this patch also fixes a bug that the existing FIP
disassociation action disassociates and releases a first FIP of
a requested server. Even though it is a rare case where a single
server has multiple FIPs, this is a bug. After this patch, FIPs
associated with the requested server are listed in the form and
a user can select an FIP to be disassociated.

This patch drops a setting parameter 'simple_ip_management' without
deprecation notice. This is actually no side effect because this setting
just toggled the FIP disassociate action in the instance table and
it provides nothing more than that. We can do the same thing by
the policy file.

Change-Id: Ie8053bdd3a3e4c7897c7c906788d40c2a1d3f708
Closes-Bug: #1226003
2018-04-08 07:29:54 +09:00
Zuul d4c81676a0 Merge "Drop deprecated settings" 2018-03-26 13:12:06 +00:00
Akihiro Motoki 71993e3c98 Drop deprecated settings
- HORIZON_IMAGES_ALLOW_UPLOAD (deprecated in Newton)
- CUSTOM_THEME_PATH (deprecated in Mitaka)
- DEFAULT_THEME_PATH (deprecated in Mitaka)
- OPENSTACK_TOKEN_HASH_ENABLED (deprecated in Mitaka)
- TOKEN_DELETION_DISABLED
  (not documented but it was marked as deprecated in Ocata
   in django-openstack-auth commit 5810f9c6)

The related logics related to dropped deprecated settings
have been dropped too.

- custom_path and default_path of get_available_themes() were
  dropped as they are no longer needed in favor of
  the removal of CUSTOM_THEME_PATH and DEFAULT_THEME_PATH.
- Unused remove_project_cache(), is_token_deletion_disabled()
  and delete_token() have been dropped.

Change-Id: Ic9406623cc092884c4136f78fb967b129bfda487
2018-03-23 18:37:02 +09:00
Akihiro Motoki 0659f9a98a Drop trove/sahara settings from horizon repo
Settings related to horizon plugins should be documented in individual
project repos. We support local_settings.d mechanism, so horizon plugins
can provide their own settings examples.

One example is SAHARA_AUTO_IP_ALLOCATION_ENABLED. This option has been
deprecated and replaced by another setting. It is hard for horizon team
to track this kind of changes.

This is just a change in the example local_settings.py and there is no
feature change, so there is no deprecation required.

Change-Id: Ib28110246567808f9e9c0f99c6032f7bdc931643
2018-03-22 07:09:51 +09:00
Akihiro Motoki 64b67ac9e9 Update the doc links to the newest ones
The docstring of getExtensions service in cinder.service.js
was a copy from nova service and not correct. The docstring was
updated based on the current cinder v2 API.

Thanks to a recent improvement in reno, touching release notes
in older releases in the master branch no longer polute the rendered
release notes. Changing URLs (or other things) in the master branch
does not affect the rendered release notes, but updating URLs to the
latest would help avoiding mechanical patches of updating links :)

Change-Id: I2aec3adeb400323d42a3a5083f8bc0798eeff917
2018-03-20 16:22:05 +09:00
Shu Muto c174036c84 Add Change Password Action for Angular users panel
To Test
 - set 'users_panel' to True in settings.py

Change-Id: I779b26d34658ea5f3222ebf31f1401bc7a43960b
Partially-Implements: blueprint ng-users
2018-01-16 18:15:19 +09:00
Akihiro Motoki cd49510878 Updating default keystone API verson to 3
The keystone API version 3 has become the default API version
for a long time and our CI already uses keystone v3 API only.

In addition, our documentation recommended to use the cached session,
so switching the default API version to 3 does not hit the limitation
on the maximum size of session data when using the cookie-based
sessions.

This is based on django_opensatck_auth review
https://review.openstack.org/#/c/158384/

Implements blueprint: default-keystone-api-3
Change-Id: I79e9fbd3567cc69468694dbf043fecf422347c7e
2017-12-21 03:24:07 +09:00
Zuul 70866a308c Merge "Optional removal of V2 openrc file" 2017-12-14 02:34:07 +00:00
Zuul e23048774b Merge "Allow to skip API calls to Neutron in instance tables" 2017-12-12 21:28:20 +00:00
Amelia Cordwell b0e696cf9a Optional removal of V2 openrc file
* Setting 'SHOW_V2_KEYSTONE_RC' added and will control whether
  or not user's are able to see links for the V2 rc file on both
  the API Access panel and the user menu.

Change-Id: I454fcf578dd8c4d2b9b52c3a9e5426b85e5298b5
2017-12-12 16:40:38 +13:00
Feilong Wang a42f58de50 Allow to skip API calls to Neutron in instance tables
Now instance panel is sending API calls to Neutron to get the addresses
info about network. It take some time until Nova network info cache is
synced when IP address operation like floating IP association is made
in Neutron. The API calls to Neutron exist from this reason.

However, it retrieves a full list of port, so it can potentially leads
to performance issues in large deployments. This commit adds a setting
flag to control whether API calls to Neutron is used or skipped in
the project instance table.

This commits drops a call of servers_update_addresses() in the admin
instance table. In the admin instance table there is no need to retrieve
IP addresses from neutron because the main purpose of the admin panel is
to see all instances and IP addresses in nova network info cache will be
synced soon.

Closes-Bug: #1722417
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ie16784eb6352f70ab644dc8b6ea03fc6a881d3f9
2017-12-11 23:19:01 +09:00
Zuul b4fccffccc Merge "Drop Heat related code from horizon" 2017-12-09 10:27:43 +00:00