To Reproduce
Repro Steps:
- Create a standard Dokploy instance.
- Navigate to Home > Traefik File System.
- Find any file in the dynamic/ directory and open it in the editor.
- Remove all contents.
- Paste the example from the Traefik documentation that involves Go templating.
Current vs. Expected behavior
Current: File is saved because it is a valid Traefik configuration.
Expected:
I see this error:
All mapping items must start at the same column at line 4, column 1:
{{range $i, $e := until 100 }}
router{{ $e }}-{{ env "MY_ENV_VAR" }}:
^
Provide environment information
DigitalOcean. Pretty sure this happens with any deployment.
Which area(s) are affected? (Select all that apply)
Traefik
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
I suspect that the root cause is this line, where we assume that vanilla YAML is the only valid input for Traefik dynamic config files. This contradicts Traefik's documentation, which states that, "Traefik supports using Go templating to automatically generate repetitive sections of configuration files. These sections must be a valid Go template, and can use sprig template functions."
Just filing to raise awareness. It's unclear what we could do here. A few options:
- Do nothing. At minimum add a warning to the UI that not all valid configs can be saved via the UI.
- Add an option to allow users to save anyway, even when parsing fails.
- Incorporate parsing of Traefik files. I think this would be tricky because I'm not aware of libraries that would allow this "Go templating" flavor of YAML. For example, traefik-config-validator does not support it and apparently has no plans to. I'm also not aware of any CLIs that could potentially be invoked under-the-hood. Also, this seems like a rare enough feature that it may not be worth the effort...
Will you send a PR to fix it?
No
To Reproduce
Repro Steps:
Current vs. Expected behavior
Current: File is saved because it is a valid Traefik configuration.
Expected:
I see this error:
Provide environment information
Which area(s) are affected? (Select all that apply)
Traefik
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
I suspect that the root cause is this line, where we assume that vanilla YAML is the only valid input for Traefik dynamic config files. This contradicts Traefik's documentation, which states that, "Traefik supports using Go templating to automatically generate repetitive sections of configuration files. These sections must be a valid Go template, and can use sprig template functions."
Just filing to raise awareness. It's unclear what we could do here. A few options:
Will you send a PR to fix it?
No