Skip to content

incorrect modifications of compose.yaml for preview #906

@B17C0D3

Description

@B17C0D3

⚠️ Please verify that this bug has NOT been reported before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

I started to use the configs within the compose file.
The mode needs to be declared for prometheus. Otherwise the container crashes.
The compose file is saved correctly with the leading 0.
But the preview in dockge is without. If not added on the next edit, the leading 0 is missing and the mode isn't set correctly on startup.
Because the base for the edit isn't the saved compose file, but the preview in the browser.
Without the leading 0, the mode is not set correctly.
The leading 0 should not be removed on display in the browser.

👟 Reproduction steps

  1. create a compose file with configs and define the mode of the config file.
  2. safe and start the compose file, confirm the function
  3. refresh the page and the leading 0 in mode vanishes
  4. edit any line and save the changes
  5. start the compose file. prometheus crashes on startup, because the mode is not set correctly

example compose file

configs:
  prometheus-config:
    content: |
      global:
        scrape_interval: 15s
        evaluation_interval: 15s
      scrape_configs:
        - job_name: 'fbox'
          scrape_interval: 5s
          static_configs:
            - targets: ['fb-exporter:9042']

services:
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    hostname: prometheus
    restart: always
    configs:
      - source: prometheus-config
        target: /etc/prometheus/prometheus.yml
        mode: 0777
    volumes:
      - /mnt/user/appdata/prometheus:/prometheus
    networks:
      - proxy

networks:
  proxy:
    external: true

👀 Expected behavior

The leading 0 should not be removed on display in the browser.
Without the leading 0, the mode is not set correctly.

😓 Actual Behavior

Removes the leading 0 in mode

    configs:
      - source: prometheus-config
        target: /etc/prometheus/prometheus.yml
        mode: 777

Dockge Version

1.5.0

💻 Operating System and Arch

Linux unraid 6.12.54

🌐 Browser

Firefox 146.0

🐋 Docker Version

Docker version 27.5.1, build 9f9e405

🟩 NodeJS Version

📝 Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions