Configure your development environment for working on Sentinel.
IDE Configuration
VS Code
Install recommended extensions:
# Rust Analyzer - essential
# Additional tools
Create .vscode/settings.json:
Create .vscode/launch.json for debugging:
JetBrains (RustRover/CLion)
- Install the Rust plugin
- Open the project directory
- Configure:
- Settings > Languages & Frameworks > Rust
- Enable “Run clippy on build”
- Enable “Format on save”
Neovim
With lazy.nvim:
Essential Tools
Required
# Formatting
# Linting
# Documentation
Recommended
# Watch for changes and rebuild
# Security audit
# Unused dependencies
# Better test output
# Fast linker (macOS/Linux)
cargo-watch Usage
# Watch and run tests
# Watch and run specific test
# Watch and run with clippy
# Watch multiple commands
Environment Variables
Create a .env file for development:
# Logging
RUST_LOG=sentinel=debug,tower=info
# Backtrace for panics
RUST_BACKTRACE=1
# Colored output
CARGO_TERM_COLOR=always
Load with:
Or use direnv:
# Install direnv
# Create .envrc
# Allow the directory
Git Configuration
Pre-commit Hooks
Create .git/hooks/pre-commit:
#!/bin/sh
Make it executable:
Git Attributes
Create .gitattributes:
*.rs text eol=lf
*.toml text eol=lf
*.kdl text eol=lf
Cargo.lock text eol=lf
Fast Linking
mold (Linux/macOS)
# Install
# Configure in .cargo/config.toml
lld (Cross-platform)
# Install
# Configure in .cargo/config.toml
Workspace Layout
For agent development, consider this layout:
sentinel-workspace/
├── sentinel/ # Main proxy
├── sentinel-agent-protocol/ # Shared protocol
├── sentinel-agent-waf/ # WAF agent
├── sentinel-agent-auth/ # Auth agent
└── Cargo.toml # Workspace manifest
Workspace Cargo.toml:
[]
= [
"sentinel",
"sentinel-agent-protocol",
"sentinel-agent-waf",
"sentinel-agent-auth",
]
= "2"
[]
= { = "1", = ["full"] }
= { = "1", = ["derive"] }
= "0.1"
Development Server
Run Sentinel with live reload:
# Terminal 1: Watch and rebuild
# Terminal 2: Run (restart manually on rebuild)
Or use systemfd for socket handoff:
# Keeps socket open across restarts
Testing Setup
Test Database
Some integration tests need a test backend:
# Simple echo server
Or use the provided test server:
Test Certificates
Generate self-signed certs for TLS testing:
# Create certs directory
# Generate CA
# Generate server cert
Next Steps
- Code Style - Formatting and conventions
- Testing - Run the test suite
- Contributing - Submit your first PR