Skip to content

Commit 44912b8

Browse files
blink-so[bot]f0ssel
andcommitted
update README to reflect new build tools and release automation
Updated README.md to be accurate with recent changes: ## Installation Section - Added GitHub Releases as primary installation method - Provided download examples for all 4 supported platforms - Updated Go version requirement from 1.21+ to 1.25+ - Reorganized with releases first, build from source second ## Quick Start Section - Added installation options (releases vs build from source) - Updated examples to use 'jail' instead of './jail' (assumes installed) - Mentioned Makefile as build option ## Development Section - Updated to use Makefile targets as primary approach - Added all available make targets (build, build-all, test, etc.) - Kept manual Go commands as secondary option - Added reference to build script for cross-platform builds ## Accuracy Improvements - Corrected Go version requirement to match CI workflows - Added proper installation instructions for all platforms - Made Makefile the recommended development approach - Maintained backward compatibility with direct Go commands The README now accurately reflects the current state of the project with automated releases, Makefile tooling, and proper installation options. Co-authored-by: f0ssel <[email protected]>
1 parent 9ab4f79 commit 44912b8

File tree

1 file changed

+88
-12
lines changed

1 file changed

+88
-12
lines changed

README.md

Lines changed: 88 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,38 @@ jail creates an isolated network environment for target processes, intercepting
1616

1717
## Quick Start
1818

19+
### Installation
20+
21+
**From GitHub Releases (Recommended):**
1922
```bash
20-
# Build the tool
21-
go build -o jail .
23+
# Download the latest release for your platform
24+
wget https://github.com/coder/jail/releases/latest/download/jail-linux-amd64.tar.gz
25+
tar -xzf jail-linux-amd64.tar.gz
26+
chmod +x jail
27+
sudo mv jail /usr/local/bin/
28+
```
29+
30+
**Build from Source:**
31+
```bash
32+
git clone https://github.com/coder/jail
33+
cd jail
34+
make build # or: go build -o jail .
35+
```
2236

37+
### Usage
38+
39+
```bash
2340
# Allow only requests to github.com
24-
./jail --allow "github.com" -- curl https://github.com
41+
jail --allow "github.com" -- curl https://github.com
2542

2643
# Allow full access to GitHub issues API, but only GET/HEAD elsewhere on GitHub
27-
./jail \
44+
jail \
2845
--allow "github.com/api/issues/*" \
2946
--allow "GET,HEAD github.com" \
3047
-- npm install
3148

3249
# Default deny-all: everything is blocked unless explicitly allowed
33-
./jail -- curl https://example.com
50+
jail -- curl https://example.com
3451
```
3552

3653
## Allow Rules
@@ -111,25 +128,56 @@ For more help: https://github.com/coder/jail
111128

112129
## Installation
113130

114-
### Prerequisites
131+
### From GitHub Releases (Recommended)
132+
133+
Download pre-built binaries from [GitHub Releases](https://github.com/coder/jail/releases):
134+
135+
```bash
136+
# Linux x64
137+
wget https://github.com/coder/jail/releases/latest/download/jail-linux-amd64.tar.gz
138+
tar -xzf jail-linux-amd64.tar.gz
139+
chmod +x jail
140+
sudo mv jail /usr/local/bin/
141+
142+
# macOS (Intel)
143+
wget https://github.com/coder/jail/releases/latest/download/jail-darwin-amd64.tar.gz
144+
tar -xzf jail-darwin-amd64.tar.gz
145+
chmod +x jail
146+
sudo mv jail /usr/local/bin/
147+
148+
# macOS (Apple Silicon)
149+
wget https://github.com/coder/jail/releases/latest/download/jail-darwin-arm64.tar.gz
150+
tar -xzf jail-darwin-arm64.tar.gz
151+
chmod +x jail
152+
sudo mv jail /usr/local/bin/
153+
```
154+
155+
### Build from Source
156+
157+
#### Prerequisites
115158

116159
**Linux:**
117160
- Linux kernel 3.8+ (network namespace support)
118161
- iptables
119-
- Go 1.21+ (for building)
162+
- Go 1.25+ (for building)
120163
- sudo access
121164

122165
**macOS:**
123166
- macOS 10.15+ (Catalina or later)
124167
- pfctl (included)
125-
- Go 1.21+ (for building)
168+
- Go 1.25+ (for building)
126169
- sudo access
127170

128-
### Build from Source
171+
#### Building
129172

130173
```bash
131174
git clone https://github.com/coder/jail
132175
cd jail
176+
177+
# Using Makefile (recommended)
178+
make build
179+
180+
# Or directly with Go
133181
go build -o jail .
134182
```
135183

@@ -164,15 +212,43 @@ OPTIONS:
164212
## Development
165213

166214
```bash
167-
# Build
215+
# Build for current platform
216+
make build
217+
218+
# Build for all platforms
219+
make build-all
220+
221+
# Run tests
222+
make test
223+
224+
# Run tests with coverage
225+
make test-coverage
226+
227+
# Clean build artifacts
228+
make clean
229+
230+
# Format code
231+
make fmt
232+
233+
# Lint code (requires golangci-lint)
234+
make lint
235+
```
236+
237+
### Manual Commands
238+
239+
```bash
240+
# Build directly with Go
168241
go build -o jail .
169242

170-
# Test
243+
# Run tests
171244
go test ./...
172245

173-
# Cross-compile
246+
# Cross-compile manually
174247
GOOS=linux GOARCH=amd64 go build -o jail-linux .
175248
GOOS=darwin GOARCH=amd64 go build -o jail-macos .
249+
250+
# Use build script for all platforms
251+
./scripts/build.sh
176252
```
177253

178254
## License

0 commit comments

Comments
 (0)