fix: remove binary, add Makefile, document validators
This commit is contained in:
@@ -52,3 +52,4 @@ __debug_bin
|
|||||||
# OS
|
# OS
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
.sisyphus/
|
.sisyphus/
|
||||||
|
caddy-mcp-server
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -78,6 +78,14 @@ ssh -L 2019:localhost:2019 server-1 &
|
|||||||
- `REVIEW_DOMAIN` - Domain for WIP review environments (default: `review.example.com`)
|
- `REVIEW_DOMAIN` - Domain for WIP review environments (default: `review.example.com`)
|
||||||
|
|
||||||
## Architecture
|
## 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
|
- `client.go` - Caddy Admin API client
|
||||||
- `server.go` - MCP server setup
|
- `server.go` - MCP server setup
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user