[GH-ISSUE #738] [Feature] Support multi line environment variables #7469

Open
opened 2026-04-27 21:11:32 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @june012006 on GitHub (Aug 16, 2025).
Original GitHub issue: https://github.com/moghtech/komodo/issues/738

I receive in the "Write Stack" step of deployment the following error

ERROR: Invalid environment

TRACE:
1: line 3 missing assignment character ('=' or ':')

If I set the environment variables in the terminal, and manually run docker compose up, it works without issue
My compose file:

services:
  labels:
    image: "11notes/traefik-labels:amd64-latest"
    container_name: "labels"
    environment:
      DEBUG: false
      TZ: America/Chicago
    configs:
      - source: ca.pem
        target: /labels/ssl/ca-public.pem
      - source: client.pem
        target: /labels/ssl/client-certificate.pem
      - source: key.pem
        target: /labels/ssl/client-key.pem
      - source: config.yaml
        target: /labels/etc/config.yaml
    restart: always
configs:
  ca.pem:
    content: |
      ${TLS_CA_PUBLIC}
  client.pem:
    content: |
      ${TLS_CLIENT_CERT}
  key.pem:
    content: |
      ${TLS_CLIENT_KEY}
  config.yaml: 
    content: |
      labels:
        redis:
          url: redis://${REV_PROXY}:6379/0
        # webhook:
        #   url: https://my.cool.webhook/v1
        #   # optional
        #   auth:
        #     # supports basic authentication
        #     basic: labels:*****
        nodes:
          # use FQDN and add the FQDN to your certificates SAN list (or IP)
          - 192.168.25.4
          - 192.168.25.8
          - 192.168.128.249
          - 192.168.128.3
          - 192.168.128.167
        # reload labels.nodes every {n} seconds (0 = disabled)
        interval: 0
        # timeout in seconds for the connection to a Docker node
        timeout: 2.5
        rfc2136:
          # only nsupdate on entries which are different (do not update same data)
          verify: true
          # remove DNS entry if container is unreachable
          remove: false
        poll:
          # polling all containers on a node every {n} seconds
          interval: 300
        ping:
          # ping all nodes every {n} seconds to see if they are still online
          interval: 10
        tls:
          # path for TLS certificates
          ca: /labels/ssl/ca-public.pem
          crt: /labels/ssl/client-certificate.pem
          key: /labels/ssl/client-key.pem

My stack toml

[[stack]]
name = "traefik-labels"
[stack.config]
server = "server-dns2"
linked_repo = "modular_gitea_dns2"
run_directory = "docker-compose/app/traefik-labels"
environment = """
  # VARIABLE = value
DNS_TSIG = [[DNS_TSIG]]
TLS_CA_PUBLIC = [[TLS_CA_PUBLIC]]
TLS_CLIENT_CERT = [[TLS_CLIENT_CERT]]
TLS_CLIENT_KEY = [[TLS_CLIENT_KEY]]
REV_PROXY = 192.168.128.3
"""

What am I missing?

Originally created by @june012006 on GitHub (Aug 16, 2025). Original GitHub issue: https://github.com/moghtech/komodo/issues/738 I receive in the "Write Stack" step of deployment the following error > ERROR: Invalid environment > > TRACE: > 1: line 3 missing assignment character ('=' or ':') If I set the environment variables in the terminal, and manually run docker compose up, it works without issue My compose file: ``` services: labels: image: "11notes/traefik-labels:amd64-latest" container_name: "labels" environment: DEBUG: false TZ: America/Chicago configs: - source: ca.pem target: /labels/ssl/ca-public.pem - source: client.pem target: /labels/ssl/client-certificate.pem - source: key.pem target: /labels/ssl/client-key.pem - source: config.yaml target: /labels/etc/config.yaml restart: always configs: ca.pem: content: | ${TLS_CA_PUBLIC} client.pem: content: | ${TLS_CLIENT_CERT} key.pem: content: | ${TLS_CLIENT_KEY} config.yaml: content: | labels: redis: url: redis://${REV_PROXY}:6379/0 # webhook: # url: https://my.cool.webhook/v1 # # optional # auth: # # supports basic authentication # basic: labels:***** nodes: # use FQDN and add the FQDN to your certificates SAN list (or IP) - 192.168.25.4 - 192.168.25.8 - 192.168.128.249 - 192.168.128.3 - 192.168.128.167 # reload labels.nodes every {n} seconds (0 = disabled) interval: 0 # timeout in seconds for the connection to a Docker node timeout: 2.5 rfc2136: # only nsupdate on entries which are different (do not update same data) verify: true # remove DNS entry if container is unreachable remove: false poll: # polling all containers on a node every {n} seconds interval: 300 ping: # ping all nodes every {n} seconds to see if they are still online interval: 10 tls: # path for TLS certificates ca: /labels/ssl/ca-public.pem crt: /labels/ssl/client-certificate.pem key: /labels/ssl/client-key.pem ``` My stack toml ``` [[stack]] name = "traefik-labels" [stack.config] server = "server-dns2" linked_repo = "modular_gitea_dns2" run_directory = "docker-compose/app/traefik-labels" environment = """ # VARIABLE = value DNS_TSIG = [[DNS_TSIG]] TLS_CA_PUBLIC = [[TLS_CA_PUBLIC]] TLS_CLIENT_CERT = [[TLS_CLIENT_CERT]] TLS_CLIENT_KEY = [[TLS_CLIENT_KEY]] REV_PROXY = 192.168.128.3 """ ``` What am I missing?
GiteaMirror added the enhancement label 2026-04-27 21:11:32 -05:00
Author
Owner

@mbecker20 commented on GitHub (Aug 17, 2025):

Do any of the Komodo variables include multiple lines? That would lead to this issue

<!-- gh-comment-id:3194204931 --> @mbecker20 commented on GitHub (Aug 17, 2025): Do any of the Komodo variables include multiple lines? That would lead to this issue
Author
Owner

@june012006 commented on GitHub (Aug 17, 2025):

Yes, all three "TLS" variables. Multiline variables don't work then?

<!-- gh-comment-id:3194243550 --> @june012006 commented on GitHub (Aug 17, 2025): Yes, all three "TLS" variables. Multiline variables don't work then?
Author
Owner

@mbecker20 commented on GitHub (Aug 19, 2025):

Variables containing multiple lines can be used in some situations, like in commands when wrapping in quotes, but not environment like this, unfortunately it will lead to this parsing issue. You have to find another way to pass these in.

<!-- gh-comment-id:3202233082 --> @mbecker20 commented on GitHub (Aug 19, 2025): Variables containing multiple lines can be used in some situations, like in commands when wrapping in quotes, but not environment like this, unfortunately it will lead to this parsing issue. You have to find another way to pass these in.
Author
Owner

@6ixfalls commented on GitHub (Sep 20, 2025):

I'm curious why the environment variables are even parsed instead of just being passed into the Docker command - I would like to contribute a fix to this, but I don't understand the current architecture.

<!-- gh-comment-id:3315275920 --> @6ixfalls commented on GitHub (Sep 20, 2025): I'm curious why the environment variables are even parsed instead of just being passed into the Docker command - I would like to contribute a fix to this, but I don't understand the current architecture.
Author
Owner

@dieser-niko commented on GitHub (Nov 19, 2025):

I'm curious why the environment variables are even parsed instead of just being passed into the Docker command

My guess is that they needed to unify the output, because, for some reason you can use a YAML list format:
34a9f8eb9e/client/core/rs/src/parsers.rs (L16-L18)

I have to agree with @6ixfalls, why is this even necessary? The field description in the UI doesn't even mention YAML and I wouldn't have known about it myself if I hadn't checked out the code.

<!-- gh-comment-id:3552657507 --> @dieser-niko commented on GitHub (Nov 19, 2025): > I'm curious why the environment variables are even parsed instead of just being passed into the Docker command My guess is that they needed to unify the output, because, for some reason you can use a YAML list format: https://github.com/moghtech/komodo/blob/34a9f8eb9ef305103b678c1b46782700313f637f/client/core/rs/src/parsers.rs#L16-L18 I have to agree with @6ixfalls, why is this even necessary? The field description in the UI doesn't even mention YAML and I wouldn't have known about it myself if I hadn't checked out the code.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#7469