~ancarda/tls-redirector

Don't run `go mod download' to build container

This commit removes `go mod download' and the corresponding COPY that
made it work. This builds upon work done in 68993931c85d as there are
no third party dependencies aside from:

 * `stretchr/testify' which is used in unit tests
 * `coreos/go-systemd' which is not used in Docker
Remove io/ioutil (Deprecated)
Replace afero with native io/fs

Issue: https://todo.sr.ht/~ancarda/tls-redirector/19
Bump stretchr/testify (1.6.1 -> 1.7.0)
Replace fancy with go embed

This commit removes the fancy subpackage with the native `//go:embed'
functionality in Go 1.16. This does raise the minimum build version to
1.16, however it means simplicity -- all that is necessary to compile
now is just `go build'.
Fancy: Use 644 for generated file

This commit drops the execute bit from autogenerated.go as it is not
necessary and makes no sense as the file isn't executable.
Fancy: rename templates.go to autogenerated.go

This commit changes the generator to produce a file called
`autogenerated' rather than the ambiguous `templates' which at a glance
seems like source code that would be checked in.

This should hopefully make it clearer this file can be discarded and
should not be checked in to source control.
Implement basic man page

This commit adds a simple man page that may be copied into
/usr/share/man/man8 where it will become accessible by typing:

    man tls-redirector

The man page contains the same information that is in README.md.

Issue: https://todo.sr.ht/~ancarda/tls-redirector/18
Tweak systemd files

- Default to using systemd socket activation
- Improve security for service
- Automatically create the folder for ACME usage

This is implemented here:
https://aur.archlinux.org/packages/tls-redirector/
Add a basic Docker healthcheck
Bump dependencies

* Golang       (1.15.1 -> 1.15.6)
* Alpine Linux (3.12.0 -> 3.12.3)
Format all code with mvdan/gofumpt
Run `go generate' before `go test'

The tests for fancy require the generated templates to be present.
Running `go generate' will also ensure the pre-compile step is tested.
2.4: Nice looking HTML error pages

This commit changes tls-redirector to output descriptive, nice looking
HTML error pages rather than the one-line text it used to output. This
is aimed at providing any would-be visitors with information indicating
why they are seeing pages from tls-redirector, and not the website
they (presumably) intended to visit.

The HTML is compiled into the binary by using `go generate' to copy
files on disk into constants.
Run `go build' and `strip' in one layer

Since `go build' will produce a new layer, the later layers will always
run, so we may as well run them in one go.
Sync with PicoTest's CONTRIBUTING file

This adds a short note about GitHub needing accounts and non-free
JavaScript to use.
Run `go mod download' before COPY *

This commit makes `docker build' faster by allowing third party
dependencies to be cached provided the go.{mod,sum} files do not
change and the layers previous to that haven't changed (i.e. version of
Go or Alpine Linux).

Without an explicit download step, `go build' will fetch dependencies.
This is normally skipped the next time you invoke the command, but with
Docker, there will never be a "next time" as the COPY command, provided
there are changes, will result in a new layer.

It's only necessary to pull down dependencies if they have changed,
therefore the build step is now exclusively for compiling and not
pulling down dependencies.
Run `apk add' before COPY

This commit makes `docker build' much faster by allowing the `apk add'
layer to be cached.
Lowercase constants

This commit fixes a golint warning -- the exit constants should not be
uppercased as they aren't exported.
Replace unversioned tags

This commit replaces all the unversioned tags with specific versions as
this should be more stable and easier to debug.
Next