The new `-tls` parameter is empty by default, retaining the current behavior (no change).
If `-tls=self-signed` is specified, the packer generates and signs a RSA4096 certificate, stored in the host-specific config directory, e.g. typically `~/.config/gokrazy/<hostname>/{cert,key}.pem` on Linux.
If `-tls=<certpath>[,<keypath>]` is specified, the packer uses the specified certificate and key.
When TLS is used, the certificate/key is included in the gokrazy root file system at `/etc/ssl/{web,web_key}.pem`.
To switch an unencrypted (HTTP) installation to HTTPS, use the `-insecure` flag for the first update, e.g.:
`gokr-packer -tls=self-signed -insecure …`
…then remove it for all subsequent updates, which will now be done via HTTPS:
`gokr-packer -tls=self-signed …`
The gokrazy configuration directory is named “gokrazy” underneath
https://golang.org/pkg/os/#UserConfigDir, which on Linux typically
resolves to ~/.config/gokrazy.
The global HTTP password stored in http-password.txt within that
directory will still be used, but in case a host-specific override
directory exists, that directory has priority.
E.g., if you wanted to set up a gokrazy installation named “dev”
for live-coding on a public twitch stream, you could:
% host_specific=~/.config/gokrazy/hosts/dev/
% mkdir -p $host_specific
% echo -n publicly-leaked-on-stream > $host_specific/http-password.txt
This technique was originally contributed by @janisstreib in
https://github.com/gokrazy/tools/pull/14
This makes the packer more flexible with regards to permissions: write
permissions for the target device are now sufficient.
The downside is that the SD card needs to be unplugged and re-plugged before the
persistent file system can be created (if desired).
related to https://github.com/gokrazy/tools/issues/9
The special value UART0 is still supported for backwards compatibility.
This change makes using the serial console possible on platforms which don’t use
ttyAMA0.
This paves the way for a bunch of other cleanups, such as full file names (no
more 8.3) or symbolic links, allowing us to clean up our directory structure.
Also, thanks to Squashfs’s compression, images are smaller and hence updates are
faster: a 95M FAT image shrinks to a 36M Squashfs image, reducing the update
time from about 20s to about 7s.