Bug 49647

Summary: Do not use environment variables names with '/' in key
Product: UCS Reporter: Nico Gulden <gulden>
Component: App CenterAssignee: Jannik Ahlers <ahlers>
Status: CLOSED FIXED QA Contact: Johannes Keiser <keiser>
Severity: normal    
Priority: P5 CC: ahlers, best, dfr
Version: UCS 4.4   
Target Milestone: UCS 4.4-1-errata   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=51050
What kind of report is it?: Bug Report What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 2: Will only affect a few installed domains How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.114 Enterprise Customer affected?:
School Customer affected?: ISV affected?: Yes
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:

Description Nico Gulden univentionstaff 2019-06-13 17:03:04 CEST
For multi container apps the App Center adds a bunch of environment variables to the compose file before it is used by Docker compose.

See this excerpt:

    environment:
    - SERVER_ROLE=memberserver
    - server/role=memberserver
    - NAMESERVER_EXTERNAL=false
    - nameserver/external=false
    - UPDATE_SECURE_APT=false
    - update/secure_apt=false
    - LDAP_SERVER_IP=127.0.0.1
    - ldap/server/ip=127.0.0.1
    - LDAP_SERVER_TYPE=master
    - ldap/server/type=master
    - UPDATER_IDENTIFY=Docker App
    - updater/identify=Docker App
    - …

The problem are the duplicate variables with small letters and the '/' in their key. The usual convention for environment variable names is capitals separated by underscore '_'. Variables in this format already exist.

Docker apps may rely on this convention as now is the case with seafile now where the container refuses to start because it cannot parse the environment variable key correctly.

With this issue the duplicate environment variable with the '/' in it (the UCR variable key format) should be removed from the docker-compose.yml created by the App Center on the UCS target host.
Comment 1 Jannik Ahlers univentionstaff 2019-07-23 15:59:40 CEST
I added a new App Setting "DockerUcrStyleEnv" that can disable passing environment variables into docker containers that are not in format of capital letters and underscores.

Successful build
Package: univention-appcenter
Version: 8.0.11-45A~4.4.0.201907231554
Branch: ucs_4.4-0
Scope: errata4.4-1
Comment 2 Johannes Keiser univentionstaff 2019-07-29 15:17:25 CEST
OK: if DockerUcrStyleEnv is false, the environment variables are only added with uppercase and underscore
OK: default of DockerUcrStyleEnv is true (old behaviour)
OK: single container: <app>.env file multi-container: docker-compose.yml
OK: yaml
-> verified
Comment 3 Arvid Requate univentionstaff 2019-07-31 13:58:41 CEST
<http://errata.software-univention.de/ucs/4.4/200.html>