-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (58 loc) · 1.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
UID=$(shell id -u)
GID=$(shell id -g)
GOVERSION=1.13
build:
docker container run --rm -it \
-v $(PWD):/dnsserv \
-w /dnsserv \
golang:$(GOVERSION) \
go build -o dnsserv main.go
build-pi:
docker container run --rm -it \
-v $(PWD):/dnsserv \
-w /dnsserv \
-e GOOS=linux \
-e GOARCH=arm \
-e GOARM=5 \
golang:$(GOVERSION) \
go build -o dnsserv main.go
serve:
sudo ./dnsserv serve \
--ca-path $(PWD)/certs/ca.pem \
--cert-path $(PWD)/certs/client.pem \
--key-path $(PWD)/certs/client-key.pem \
--dns-port 53 \
--https-port 443
test-serve:
docker container run --rm -it \
-v $(PWD):/dnsserv \
-w /dnsserv \
--net=host \
golang:$(GOVERSION) \
./dnsserv serve \
--ca-path /dnsserv/certs/ca.pem \
--cert-path /dnsserv/certs/devserver.pem \
--key-path /dnsserv/certs/devserver-key.pem \
--dns-port 2012 \
--https-port 3242 \
--logtostderr=true
test-client:
docker container run --rm -it \
-v $(PWD):/dnsserv \
-w /dnsserv \
--net=host \
golang:$(GOVERSION) \
./dnsserv update \
--ca-path /dnsserv/certs/ca.pem \
--cert-path /dnsserv/certs/client.pem \
--key-path /dnsserv/certs/client-key.pem \
--dns-server https://localhost:3242 \
--domain pi.joshchorlton.com
deploy: build
scp $(PWD)/dnsserv $(PWD)/Makefile dnsserv:dnsserv/
scp $(PWD)/certs/ca.pem $(PWD)/certs/server-key.pem $(PWD)/certs/server.pem dnsserv:dnsserv/certs/
scp $(PWD)/scripts/dnsserv-server.service dnsserv:dnsserv/scripts/
deploy-pi: build-pi
scp $(PWD)/dnsserv $(PWD)/Makefile nas:dnsserv/
scp $(PWD)/certs/ca.pem $(PWD)/certs/client-key.pem $(PWD)/certs/client.pem nas:dnsserv/certs/
scp -r $(PWD)/scripts nas:dnsserv/