Problem
The User Secrets page currently does not preserve multiline values when creating a secret from the web UI.
This makes it difficult or impossible to create file-target secrets for common multiline files such as:
- kubeconfig files
- PEM certificates or keys
- YAML configuration files
For example, if I paste a kubeconfig into the Value field and set the file target to ~/.kube/config, the value is collapsed into a single line. The resulting file in the workspace is not a valid kubeconfig.
Steps to reproduce
- Go to
Account -> Secrets.
- Click
Add secret.
- Paste a multiline value into the
Value field, for example a kubeconfig.
- Set
File path to ~/.kube/config.
- Save the secret.
- Start or restart a workspace.
- Inspect the generated file.
Expected behavior
The pasted value should be preserved exactly, including newline characters between lines, so the file target receives the same content that was pasted into the UI.
Actual behavior
The pasted value is treated as a single-line input, so newlines are not preserved. This breaks file-target secrets that are intended to write multiline files.
Workaround
Using the CLI works because stdin is preserved verbatim:
coder secret create kubeconfig --file ~/.kube/config < ./kubeconfig
However, this is not discoverable for users who manage secrets through the dashboard.
Additional context
File-target secrets imply that users can store file contents, but many useful secret files are multiline.
Problem
The User Secrets page currently does not preserve multiline values when creating a secret from the web UI.
This makes it difficult or impossible to create file-target secrets for common multiline files such as:
For example, if I paste a kubeconfig into the
Valuefield and set the file target to~/.kube/config, the value is collapsed into a single line. The resulting file in the workspace is not a valid kubeconfig.Steps to reproduce
Account->Secrets.Add secret.Valuefield, for example a kubeconfig.File pathto~/.kube/config.Expected behavior
The pasted value should be preserved exactly, including newline characters between lines, so the file target receives the same content that was pasted into the UI.
Actual behavior
The pasted value is treated as a single-line input, so newlines are not preserved. This breaks file-target secrets that are intended to write multiline files.
Workaround
Using the CLI works because stdin is preserved verbatim:
However, this is not discoverable for users who manage secrets through the dashboard.
Additional context
File-target secrets imply that users can store file contents, but many useful secret files are multiline.