nip/Makefile

28 lines
625 B
Makefile

tidy:
@GOPROXY=https://goproxy.cn go mod tidy
build: tidy
@go build -o bin/nip cmd/main.go
run-server: build
@NIP_SERVER_ADDR=127.0.0.1:8000 \
NIP_SERVER_TOKEN=xxx \
./bin/nip server
run-agent: build
@NIP_AGENT_ADDR=127.0.0.1:10080 \
NIP_AGENT_TOKEN=xxx \
NIP_AGENT_SERVER_ADDR=127.0.0.1:8000 \
./bin/nip agent
install: build
@yes | cp ./bin/nip /usr/bin/nip
@chmod +x /usr/bin/nip
@yes | cp scripts/nip-server.service /usr/lib/systemd/system/
@yes | cp scripts/nip-agent.service /usr/lib/systemd/system/
@systemctl daemon-reload
test:
@curl -p -x http://127.0.0.1:10080 https://myip.ipip.net -vv