This repo implements the job server specified in design.md as development practice. It is "hand-written" because, at the time of implementation I had hardly written Go for a year.
Requirements: quite roughly, go 1.26 on a Linux machine. It's difficult to guarantee support even for that as "Linux" isn't a very well-defined target and the software has only been run with go 1.26 on a single machine.
cd server/
go build -o server
./serverYou can alternatively run the server as follows (if you have docker instead of podman, that should work equally well):
podman build -t int-backend-matt-1-server .
# --cap-add NET_RAW is required for ping; which is a nice demonstration of the program functionality
podman run --cap-add NET_RAW -p 8080:8080 int-backend-matt-1-servercd client/
go build -o job
./job start my-ping -- ping 127.0.0.1
./job status my-ping
./job stream my-ping
./job stop my-pinggo test -v ./...If command tests are failing, it's possibly (hopefully) because the hard-coded allowlist in jobserver.go has binaries at a different location to the binaries in your system. Try to update the allowlist to match your system binary locations (you can use which to determine that, with e.g. which ping) and re-run the tests.
go generate ./...pushd server
../gen-ca-and-self-signed-cert.bash "server" "DNS:localhost,IP:127.0.0.1"
mv server-ca.crt ../client/
popd
pushd client
../gen-ca-and-self-signed-cert.bash "client" "email:int-backend-matt-1-client@domain.local"
mv client-ca.crt ../server/
popd- share allowlists with clients (statically, as in a file, or dynamically, as in a request)- as implemented, it's trial-and-error