Bug 56323 - UCR templating in docker compose file does not work as documented
UCR templating in docker compose file does not work as documented
Status: NEW
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: App Center maintainers
App Center maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-07-17 12:45 CEST by Ole Schwiegert
Modified: 2023-07-19 14:15 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.091
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Schwiegert univentionstaff 2023-07-17 12:45:28 CEST
The Appcenter documentation explains how to access app settings in the docker compose file: https://docs.software-univention.de/app-center/5.0/en/get_started.html#multi-container-setup

This does only work, if the compose file contains a @!@  @!@ block, otherwise the values are empty on the resulting docker compose file!

Example of working compose file:
@!@
# just for the UCR template to work..
@!@
version: '3.1'
services:
  authorization-api:
    image: gitregistry.knut.univention.de/univention/components/authorization-engine/guardian:branch-9-create-appcenter-apps-for-authz-and-management-api
    security_opt:
      - seccomp:/etc/docker/seccomp-systemd.json
    environment:
      GUARDIAN__AUTHZ__ADAPTER__SETTINGS_PORT: env
      GUARDIAN__AUTHZ__ADAPTER__PERSISTENCE_PORT: static_data
      GUARDIAN__AUTHZ__ADAPTER__POLICY_PORT: opa
      STATIC_DATA_ADAPTER__DATA_FILE: /tmp/test_data.json
      OPA_ADAPTER__URL: http://opa:8181/
      GUARDIAN__AUTHZ__LOGGING__LEVEL: @%@guardian-authorization-api/logging/level@%@
      GUARDIAN__AUTHZ__LOGGING__STRUCTURED: @%@guardian-authorization-api/logging/structured@%@
      GUARDIAN__AUTHZ__LOGGING__FORMAT: @%@guardian-authorization-api/logging/format@%@
Comment 1 Ole Schwiegert univentionstaff 2023-07-19 14:15:07 CEST
Okay together with Felix we found the actual problem.

The settings had no `Show` value configured, which means that it defaults to settings.

That actually means that the appsettings are only set after the docker compose file was generated. I could fix this problem by adding `Show=Install,Settings` to my app settings.

Now they were set before the generation of the docker compose file and I can use them with `@%@`.

This should be either documented or changed so that the default values for settings are always available when generating the compose file.


P.S. The weird behavior I stated was due to the fact that my settings were scoped for outside and thus on a reinstall I did for testing my change to @!@ the UCR variables were set already.