mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-06 00:18:38 -05:00
[GH-ISSUE #737] Trailing newline at the end of ***_FILE env variable #5117
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @warthan07 on GitHub (Aug 16, 2025).
Original GitHub issue: https://github.com/moghtech/komodo/issues/737
When using ***_FILE environment variables for use with docker secrets, the read variable will include a trailing newline character if the associated file also includes a trailing end-of-file newline (for example, saving the file in neovim by default will always include such a newline character, for POSIX compliance I think). This can break things, for example when connecting to the mongo database which will not expect such newline characters in the username and/or password.
If this is intended behaviour, I think a warning should be mentioned somewhere in the docs that docker secret files should not include such trailing newline characters (for example with a redirection to the file using echo -n).
If this is not intended behaviour, maybe one could modify the maybe_read_item_from_file function from komodo/lib/environment_file/src/lib.rs to remove ending newline characters if found? I think most docker packages I am using always strip such newline characters when reading secret files.
In any case, thanks for the excellent software!
@mbecker20 commented on GitHub (Aug 17, 2025):
Good catch, fixed in this commit which will be included in upcoming v1.19.0 release.
@warthan07 commented on GitHub (Aug 17, 2025):
Perfect, thanks!