You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixed
The env file is now uploaded over SFTP. Before, it was written with echo '<content>' > file, so every secret showed in the server's process
list while the command ran, and a ' in a secret broke the command.
The env file is now created with mode 0600. Before, it was 0644, so any user
on the server could read the secrets. Existing env files are tightened on
the next deploy.
The env file is now written in a format systemd reads back exactly. Values
are double-quoted, so newlines (such as in a PEM key), leading and trailing
spaces, and # survive. Before, systemd turned \n into n and stripped
surrounding spaces. Exact on systemd 239 and 247+; on 241-246 (Debian 10,
Ubuntu 20.04) a backslash in a value comes back doubled.
mix xamal.app.exec and mix xamal.iex no longer source the env file as
shell code. Before, a secret like pa$sword;touch /x set pa and ran touch on the server, and a " in a secret printed part of it in an error.
Xamal now also writes env/app.sh with every value single-quoted, mode
0600, and sources that. Hosts not deployed since this change keep the old
behavior until their next deploy.
Env var names that systemd or the shell can't use, and values with a NUL
byte or invalid UTF-8, now fail the deploy with an error that names the key
but not the value. Before, systemd dropped such names, and a non-UTF-8 value
raised an error that printed part of it, or made systemd ignore the whole
env file and log the value to the journal.
A failed $(...) command substitution in the secrets file no longer puts
the command's output, or any literal text around the $(...), in the error
or the log. The error still names the command, so keep secrets out of the
command itself. Its stderr now goes to the terminal instead of into the
secret value.
Removed
Xamal.Commands.App.start/3 and start_version/4, which were unused and
sourced the env file through the shell.