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!
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!
Good catch, fixed in this commit which will be included in upcoming v1.19.0 release.
<!-- gh-comment-id:3194147077 -->
@mbecker20 commented on GitHub (Aug 17, 2025):
Good catch, fixed in this commit which will be included in upcoming v1.19.0 release.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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!