Univention Bugzilla – Bug 53609
App Settings in outside scope should be applied before containers are created and started
Last modified: 2021-08-04 13:21:12 CEST
+++ This bug was initially created as a clone of Bug #52506 +++ The apps Jitsi and Bitwarden use App Settings with the outside scope and store the values in UCR variables. Furthermore, both apps use an environment file which is a UCR template referring to UCR variables that are created by the app settings. The problem is that app settings are evaluated after the Docker containers are created and started. The environment file is not yet updated and therefore the containers are initialized with the wrong values. The workaround for the problem is to add the following if block to the `configure_host` lifecycle script in the app: if [ "$1" = "install" ]; then univention-app reinitialize $appid fi This causes the the re-evaluation of the app settings and the UCR templates like compose and environment file for the app during the installation process. The containers are thrown away and recreated with the correct settings. The UCR variables are still configured from the initial installation run. Afterwards, the join script is run. The order of certain tasks during the installation process needs to be reviewed. As administrator and app provider I expect that app settings made before installation are correctly applied to the Docker containers regardless of the App Settings' scope. UCR template files like the app's Docker compose and the environment file also need to be taken into account.
f5325ecc1a8ed8af6f87a1553e0f94cbf817fd12 - univention-appcenter set outside settings before preinst e0da1bb7c6f26e3950c0f97a6048f2c8a3157b2c - univention-appcenter pep8 c5e055814cba31c720570ed4cbd2cec0efd9f284 - ucs-test added 20_appcenter/100_settings.py::test_outside_settings_in_preinst 387b24641789c5e7111e628c4c5bd7e26ac81e41 - yaml
As discussed, while the patch works, it would be much cleaner to use the method "_configure". This method seems to be broken, though. It overwrites explicitly set variables with the default ones. We should first fix the method and then use it to fix this bug right here.
Done as advised. Reverted f5325ecc1a8ed8af6f87a1553e0f94cbf817fd12 Instead, we fixed _configure and use it in becdcddc The tests still work. We do not yet test InitialValue and Upgrade/Remove yet. It should work, though.
OK: univention-appcenter 8.0.11-148A~4.4.0.202107270037 OK: Fix _configure call OK: Testcases in 20_appcenter/100_settings.py Verified
<https://errata.software-univention.de/#/?erratum=4.4x1017>