diff --git a/.gitignore b/.gitignore index 50fe530..85d95d7 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ __debug_bin # OS Thumbs.db .sisyphus/ +caddy-mcp-server diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..63bc36d --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +.PHONY: build test clean install lint + +BINARY_NAME=caddy-mcp-server +GO=go +GOFLAGS=-ldflags="-s -w" + +build: + $(GO) build $(GOFLAGS) -o $(BINARY_NAME) . + +test: + ./test.sh + +clean: + rm -f $(BINARY_NAME) + $(GO) clean + +install: build + cp $(BINARY_NAME) $(GOPATH)/bin/ + +lint: + $(GO) vet ./... + gofmt -l . + +dev: + $(GO) run . + +all: clean build test diff --git a/README.md b/README.md index a20aed4..1df6b3f 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,14 @@ ssh -L 2019:localhost:2019 server-1 & - `REVIEW_DOMAIN` - Domain for WIP review environments (default: `review.example.com`) ## Architecture +### Input Validation (validators.go) +The server includes comprehensive input validation to prevent security issues: +- **Domain validation**: Ensures valid domain format +- **Path validation**: Prevents directory traversal attacks +- **Port validation**: Validates port ranges (1-65535) +- **Header validation**: Validates HTTP header names + + - `client.go` - Caddy Admin API client - `server.go` - MCP server setup diff --git a/caddy-mcp-server b/caddy-mcp-server deleted file mode 100755 index 82caf99..0000000 Binary files a/caddy-mcp-server and /dev/null differ