Both C2Hat server and client can be packaged as Docker images, where Docker is available.
The easy way to do this is by running
make dockerto build both imagesmake docker/serverto build a server imagemake docker/clientto build a client imagemake docker/cleanto remove all related images
If you want to build manually you can build the server with
docker build --target server -t c2hat/server .and the client with
docker build --target client -t c2hat/client .Both client and server images have the Mozilla TLS CA certificates installed in /etc/ssl/certs.
The server image is configured to start the server in foreground on port 10000 on all IP addresses (0.0.0.0).
It will look for TLS certificates and configuration files in the default locations so those can be injected with the -v switch.
The minimum command needed to run the server is
docker run --rm -it \
-v /path/to/certificate.pem:/etc/c2hat/ssl/cert.pem \
-v /path/to/privkey.pem:/etc/c2hat/ssl/key.pem \
-p <host port>:10000 \
c2hat/serverThe default locale is en_GB.UTF-8, to override this, for example with US English, you need to add to the above
-e LANG=en_US.UTF-8 -e LANGUAGE=en_US.UTF-8To use a custom configuration file, you need to inject it by adding
-v /path/to/your-server.conf:/etc/c2hat/server.confIf you feel curious and want to open a shell with the server image, you can run
docker run --rm -it --entrypoint sh c2hat/serverThe client is pre-configured to look for CA certificates in the default location (/etc/ssl/certs) so unless you need to inject your own certificates you just need to run
docker run --rm -it c2hat/client <host> <port>Just like the server you can change language using environment variables and look into the image with
docker run --rm -it --entrypoint sh c2hat/client