https://github.com/berbyte/sinkzone
Block everything. Allow only what matters. A DNS tool for productivity, focus, and child safety. Allowlist-only internet for distraction-free work.
https://github.com/berbyte/sinkzone
Last synced: 6 months ago
JSON representation
Block everything. Allow only what matters. A DNS tool for productivity, focus, and child safety. Allowlist-only internet for distraction-free work.
- Host: GitHub
- URL: https://github.com/berbyte/sinkzone
- Owner: berbyte
- License: mit
- Created: 2025-08-06T14:05:14.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-12-04T14:26:38.000Z (7 months ago)
- Last Synced: 2025-12-07T22:37:59.609Z (7 months ago)
- Language: Go
- Size: 2.62 MB
- Stars: 333
- Watchers: 1
- Forks: 16
- Open Issues: 4
-
Metadata Files:
- Readme: README-Docker.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-cli-apps-in-a-csv - Sinkzone - Application that blocks everything by default unless you explicitly allow it; A DNS tool for productivity, focus, and child safety. (<a name="productivity"></a>Productivity)
- awesome-cli-apps - Sinkzone - Application that blocks everything by default unless you explicitly allow it; A DNS tool for productivity, focus, and child safety. (<a name="productivity"></a>Productivity)
README
# Sinkzone with Unbound Docker Setup
A Docker Compose setup for Sinkzone with Unbound as the upstream DNS resolver.
## Quick Start
1. **Create environment file:**
```bash
cat > .env << 'EOF'
DOCKER_NETWORK_SUBNET=172.30.0.0/16
SINKZONE_IP=172.30.0.1
UNBOUND_IP=172.30.0.2
SINKZONE_UPSTREAM_NAMESERVERS=unbound
EOF
```
2. **Start services:**
```bash
docker compose up -d
```
3. **Test DNS resolution:**
```bash
dig @127.0.0.1 -p 5353 google.com
```
## Usage
### DNS Resolution
- **Sinkzone**: `dig @127.0.0.1 -p 5353 google.com`
- **Direct Unbound**: `dig @127.0.0.1 -p 5335 google.com`
### API Access
```bash
# Health check
curl http://localhost:8080/health
# View DNS queries
curl http://localhost:8080/api/queries
# Enable focus mode
curl -X POST http://localhost:8080/api/focus \
-H "Content-Type: application/json" \
-d '{"enabled": true, "duration": "1h"}'
```
### Sinkzone Commands via Docker Exec
```bash
# Terminal UI
docker compose exec -it sinkzone ./sinkzone tui --api-url http://localhost:8080
# Monitor DNS requests
docker compose exec -it sinkzone ./sinkzone monitor --api-url http://localhost:8080
# Add domain to allowlist
docker compose exec -it sinkzone ./sinkzone allowlist add google.com
# Remove domain from allowlist
docker compose exec -it sinkzone ./sinkzone allowlist remove google.com
# List allowlist
docker compose exec -it sinkzone ./sinkzone allowlist list
# Enable focus mode
docker compose exec -it sinkzone ./sinkzone focus start
# Disable focus mode
docker compose exec -it sinkzone ./sinkzone focus --disable
# Check status
docker compose exec -it sinkzone ./sinkzone status
```
## Ports
- **5353**: Sinkzone DNS server
- **8080**: Sinkzone API server
- **5335**: Unbound DNS server (direct access)
## Architecture
```
Client → Sinkzone (5353) → Unbound (172.30.0.2) → Internet
```
## Troubleshooting
```bash
# View logs
docker compose logs -f
# Restart services
docker compose restart
# Rebuild and restart
docker compose up -d --build
```