@@ -496,117 +496,7 @@ If you encounter issues, try reproducing the problem locally to get detailed log
496496
497497## Development
498498
499- ### Testing
500-
501- ``` bash
502- # Audit mode test (start → build → verify → clean up)
503- make test_audit_mode
504-
505- # Restrict mode test (start → build → verify → clean up)
506- make test_restrict_mode
507- ```
508-
509- ### Viewing Logs
510-
511- ``` bash
512- # All communication logs
513- docker compose logs builder
514-
515- # Real-time log monitoring
516- docker compose logs -f builder
517- ```
518-
519- ** Log format:**
520-
521- ```
522- [28/Jan/2026:10:15:30 +0000] [ALLOWED] TCP 200 1234 5678 0.123 "github.com:443"
523- [28/Jan/2026:10:15:31 +0000] [BLOCKED] TCP 502 0 0 0.001 "malicious.com:443"
524- [28/Jan/2026:10:15:32 +0000] [AUDIT] HTTP 200 2345 6789 0.234 "npmjs.org:80"
525- ```
526-
527- Fields: ` [timestamp] [status] protocol http_status bytes_sent bytes_received duration "domain:port" `
528-
529- ### Makefile Commands
530-
531- | Command | Description |
532- | ---------| -------------|
533- | ` make help ` | Show available commands |
534- | ` make run_audit_mode ` | Start in audit mode |
535- | ` make run_restrict_mode ` | Start in restrict mode (default domains) |
536- | ` make test_audit_mode ` | Run audit mode tests (start → build → verify → clean up) |
537- | ` make test_restrict_mode ` | Run restrict mode tests (start → build → verify → clean up) |
538- | ` make clean ` | Remove all resources |
539-
540- ### Directory Structure
541-
542- ```
543- .
544- ├── setup/
545- │ ├── action.yml # GitHub Action: dash14/buildcage/setup@v1
546- │ └── compose.yml # Compose config for GitHub Actions (with image tag)
547- ├── report/
548- │ ├── action.yml # GitHub Action: dash14/buildcage/report@v1
549- │ └── main.mjs # Log analysis and Job Summary output
550- ├── compose.yml # Docker Compose config
551- ├── compose.test.yml # Test override config
552- ├── Makefile # Operational commands
553- ├── docker/
554- │ ├── Dockerfile # Multi-stage BuildKit + nginx + dnsmasq
555- │ └── files/ # Builder container config files
556- │ ├── entrypoint.sh # iptables/dnsmasq/nginx/buildkitd startup
557- │ ├── buildkitd.toml # BuildKit config
558- │ ├── cni.conflist # CNI config (isolated-net)
559- │ ├── dnsmasq.conf # DNS config (all domains → gateway)
560- │ └── nginx.conf.template # Dynamic nginx config (HTTP/HTTPS)
561- └── test/
562- ├── Dockerfile.audit # Audit mode test
563- ├── Dockerfile.restrict # Restrict mode test
564- ├── assert-audit-mode.sh # Audit mode verification script
565- ├── assert-restrict-mode.sh # Restrict mode verification script
566- ├── helpers.sh # Test helpers
567- ├── test-server/ # Test HTTP server
568- └── test-dns/ # Test DNS server
569- ```
570-
571- ### Local Usage (without GitHub Actions)
572-
573- GitHub Actions inputs use lowercase names (e.g., ` proxy_mode ` ), while environment variables for local/Docker Compose usage use uppercase (e.g., ` PROXY_MODE ` ).
574-
575- #### Starting the Builder
576-
577- ** Audit mode** (log all connections):
578-
579- ``` bash
580- make run_audit_mode
581- ```
582-
583- ** Restrict mode** (allowlist-based):
584-
585- ``` bash
586- make run_restrict_mode
587- ```
588-
589- ** Start with custom domains** :
590-
591- ``` bash
592- ALLOWED_HTTPS_DOMAINS=" github.com,npmjs.org,example.com" make run_restrict_mode
593- ```
594-
595- #### End-to-End Local Workflow
596-
597- ``` bash
598- # 1. Start buildcage
599- make run_audit_mode
600-
601- # 2. Build
602- docker buildx build --builder buildcage --progress=plain -f Dockerfile .
603-
604- # 3. View report
605- docker compose logs builder
606-
607- # 4. Clean up
608- make clean
609- ```
499+ See the [ Development Guide] ( ./docs/development.md ) for local usage, testing, viewing logs, and directory structure.
610500
611501## Contributing
612502
0 commit comments