initial: ZeroTier-like P2P mesh VPN server with multi-tenant Web UI

This commit is contained in:
xieyao
2026-06-17 03:50:23 +08:00
commit ee5f036325
74 changed files with 9517 additions and 0 deletions

43
Makefile Normal file
View File

@@ -0,0 +1,43 @@
GO ?= /usr/local/go/bin/go
APP_NAME ?= zeromesh
VERSION ?= 1.0.0
LDFLAGS = -s -w -X main.Version=$(VERSION)
.PHONY: all build controller agent relay cli clean test lint vet
all: build
build: controller agent relay cli
controller:
$(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-controller ./cmd/zeromesh-controller/
agent:
$(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-agent ./cmd/zeromesh-agent/
relay:
$(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-relay ./cmd/zeromesh-relay/
cli:
$(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-cli ./cmd/zeromesh-cli/
test:
$(GO) test ./... -v
vet:
$(GO) vet ./...
lint:
golangci-lint run ./...
clean:
rm -rf bin/
rm -rf data/
cross-linux-amd64:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-controller-linux-amd64 ./cmd/zeromesh-controller/
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-agent-linux-amd64 ./cmd/zeromesh-agent/
cross-linux-arm64:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 $(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-controller-linux-arm64 ./cmd/zeromesh-controller/
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 $(GO) build -ldflags="$(LDFLAGS)" -o bin/zeromesh-agent-linux-arm64 ./cmd/zeromesh-agent/