.PHONY: gen-cert


build:
	go build -o bin/weather cmd/weather/main.go

gen-cert:
	cfssl gencert -config certs/client-config.json -profile server -hostname weather.localdomain certs/client-csr.json | cfssljson -bare certs/out/weather

dependencies:
	go get github.com/cloudflare/cfssl/cmd/cfssl
	go get github.com/cloudflare/cfssl/cmd/cfssljson
	go get github.com/cloudflare/cfssl/cmd/mkbundle

cert-info:
	cfssl certinfo -cert certs/out/weather.pem

cert-info-remote:
	cfssl certinfo -domain weather.localdomain:8080

curl-test:
	curl --cacert certs/out/ca.pem https://weather.localdomain:8080

clean:
	rm -rf bin/*

get-root-ca:
	cfssl info -remote rasp1.localdomain:444 -config certs/client-config.json | cfssljson -bare -stdout /dev/stdout | tee certs/out/ca.pem