Thanks for helping improve greywall!
If you have any questions, feel free to open an issue.
-
Requirements:
- Go 1.25+
- macOS or Linux
-
Clone and prepare:
git clone https://github.com/GreyhavenHQ/greywall cd greywall make setup # Install deps and lint tools make build # Build the binary ./greywall --help
Common targets:
| Command | Description |
|---|---|
make build |
Build the binary (./greywall) |
make run |
Build and run |
make test |
Run tests |
make test-ci |
Run tests with coverage |
make deps |
Download/tidy modules |
make fmt |
Format code with gofumpt |
make lint |
Run golangci-lint |
make build-ci |
Build with version info (used in CI) |
make help |
Show all available targets |
See ARCHITECTURE.md for the full project structure and component details.
- Keep edits focused and covered by tests where possible.
- Update ARCHITECTURE.md when adding features or changing behavior.
- Prefer small, reviewable PRs with a clear rationale.
- Run
make fmtandmake lintbefore committing. This project usesgolangci-lintv1.64.8.
# Run all tests
make test
# Run with verbose output
go test -v ./...
# Run with coverage
make test-ci# Test blocked network request
./greywall curl https://example.com
# Test with proxy configured
echo '{"network":{"proxyUrl":"socks5://localhost:43052"}}' > /tmp/test.json
./greywall -s /tmp/test.json curl https://example.com
# Test monitor mode
./greywall -m -c "touch /etc/test"Requires bubblewrap and socat (plus optional xdg-dbus-proxy for notify-send):
# Ubuntu/Debian
sudo apt install bubblewrap socat xdg-dbus-proxy
# Test in Colima or VM
./greywall curl https://example.com"command not found" after go install:
- Add
$GOPATH/binto your PATH - Or use
go env GOPATHto find the path
Module issues:
go mod tidy # Clean up dependenciesBuild cache issues:
go clean -cache
go clean -modcachemacOS sandbox issues:
- Check
log stream --predicate 'eventMessage ENDSWITH "_SBX"'for violations - Ensure you're not running as root
Linux bwrap issues:
- May need
sudoorkernel.unprivileged_userns_clone=1 - Check that socat and bwrap are installed
Releases are automated using GoReleaser via GitHub Actions.
Use the release script to create and push a new version tag:
# Patch release (v1.0.0 → v1.0.1)
./scripts/release.sh patch
# Minor release (v1.0.0 → v1.1.0)
./scripts/release.sh minorThe script runs preflight checks, calculates the next version, and prompts for confirmation before tagging.
Once the tag is pushed, GitHub Actions will automatically:
- Build binaries for all supported platforms
- Create archives with README, LICENSE, and ARCHITECTURE.md
- Generate checksums
- Create a GitHub release with changelog
- Upload all artifacts
The release workflow builds for:
- Linux: amd64, arm64
- macOS (darwin): amd64, arm64
# Build for current platform
make build
# Cross-compile
make build-linux
make build-darwin
# With version info (mimics CI builds)
make build-ciTo test the GoReleaser configuration locally:
goreleaser release --snapshot --clean