Commit Graph

124 Commits

Author SHA1 Message Date
Razvan Dimescu
14a9e9e7e3 add numa service restart command
Kills the running process and lets launchd/systemd respawn it
with the updated binary. DNS stays configured throughout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:26:56 +02:00
Razvan Dimescu
48657aec6c update CLAUDE.md and development plan with current state
Reflects: EDNS fix, 4096 buffer, system DNS auto-detect, service
management, domain check, query log filtering, install script,
launchctl bootstrap note, Rust 2021 edition, 19 endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:23:56 +02:00
Razvan Dimescu
dcaceddfd3 fix domain check input, add query log search and filter
- Fix: checkDomain input ID shadowed the JS function (caused page redirect)
- Add domain search box and path dropdown filter to Recent Queries panel
- Client-side filtering for instant response (no extra API calls)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:21:08 +02:00
Razvan Dimescu
ee776938c5 add auto-detect upstream, install script, release workflow
- Default upstream auto-detected from system resolver (scutil/resolv.conf)
  instead of hardcoding Google 8.8.8.8. Falls back to Quad9 (9.9.9.9).
- Single scutil --dns pass for both upstream detection and forwarding rules
- Linux: reads backup resolv.conf if current only has loopback
- Service start/stop now couples DNS config (install on start, uninstall on stop)
- Install script for one-line binary install from GitHub Releases
- GitHub Actions release workflow: builds for macOS/Linux x86_64/aarch64

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:14:20 +02:00
Razvan Dimescu
5eec8915d4 fix FORMERR: filter UNKNOWN records and increase buffer to 4096
Root cause: upstream resolvers return EDNS OPT records (type 41) in
the additional section. Our parser reads them as UNKNOWN, but write()
silently skips them — creating a header that claims N additional records
but a body with 0, producing FORMERR on the client side.

Fix: filter out UNKNOWN records before serialization and adjust header
counts to match. Also increase BytePacketBuffer from 512 to 4096 bytes
to handle modern DNS responses with many records.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:11:46 +02:00
Razvan Dimescu
7e29f3cb57 add domain check endpoint and dashboard search box
GET /blocking/check/{domain} — returns whether a domain is blocked,
the reason (exact match, parent domain, allowlist, disabled), and
the matching rule. Dashboard sidebar has a "Check Domain" search
box with inline results and one-click allow button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 12:58:25 +02:00
Razvan Dimescu
0658ed7310 add service management CLI, log path in dashboard footer
- numa service start/stop/status commands (launchd + systemd)
- Dashboard footer shows log paths (macOS + Linux) and GitHub link
- Help text updated with all service commands

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 12:41:16 +02:00
Razvan Dimescu
57c4742f09 harden Linux DNS config and fix review findings
- Detect systemd-resolved: use drop-in config instead of overwriting
  /etc/resolv.conf (which gets regenerated)
- Warn if /etc/resolv.conf is a symlink (NetworkManager, etc.)
- Fix TOCTOU: attempt copy/remove directly, handle NotFound
- Remove side-effect from backup_path_linux (no eager mkdir)
- Fix macOS $HOME fallback: /var/root instead of /tmp
- Log warnings on launchctl/systemctl failures instead of silencing
- Delete plist before unloading (prevents zombie restarts)
- Extract ensure_binary_installed helper on Linux

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 12:32:20 +02:00
Razvan Dimescu
4645df50e0 add Linux systemd service and DNS configuration
Linux:
- numa install: backs up /etc/resolv.conf, sets nameserver to 127.0.0.1
- numa uninstall: restores original /etc/resolv.conf from backup
- numa service start: installs systemd unit, enables + starts
- numa service stop: stops, disables, removes unit file
- numa service status: shows systemctl status

macOS: launchd plist (already working)

Both platforms: Restart=always / KeepAlive=true for crash recovery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 12:24:03 +02:00
Razvan Dimescu
c74afe9450 Merge pull request #2 from razvandimescu/feat/async-tokio
Add ad blocking, live dashboard, and system DNS auto-discovery
2026-03-20 11:53:00 +02:00
Razvan Dimescu
ae9edb3593 fix CI: gate macOS-only helpers behind cfg(target_os = macos)
Move HashMap, PathBuf, numa_data_dir, backup_path inside macOS
cfg blocks so Linux builds don't see unused imports/functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 11:48:33 +02:00
Razvan Dimescu
b0f4bb9dc0 fix README: show how to actually run install/uninstall
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 11:42:30 +02:00
Razvan Dimescu
7b4bde7d84 update README with install/uninstall commands and roadmap checkmark
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 11:39:50 +02:00
Razvan Dimescu
2db44bd7d0 add system DNS auto-configuration (install/uninstall)
numa install  — saves current DNS, sets all network services to 127.0.0.1
numa uninstall — restores original DNS from ~/.numa/original-dns.json
numa help — shows usage

macOS: uses networksetup to enumerate services and set/restore DNS.
Linux: stubs with instructions for manual setup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 11:39:30 +02:00
Razvan Dimescu
27d867df98 improve README with copy-paste quick start and roadmap
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 11:33:27 +02:00
Razvan Dimescu
87ca4f095d fix CI: gate macOS-only imports and functions behind cfg
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 11:11:32 +02:00
Razvan Dimescu
4dc5b94c7a add ad blocking, live dashboard, system DNS auto-discovery
- DNS-level ad blocking: 385K+ domains via Hagezi Pro blocklist, subdomain
  matching, one-click allowlist, pause/toggle, background refresh every 24h
- Live dashboard at :5380 with real-time stats, query log, override
  management (create/edit/delete), blocking controls
- System DNS auto-discovery: parses scutil --dns on macOS to find
  conditional forwarding rules (Tailscale, VPN split-DNS)
- REST API expanded to 18 endpoints (blocking, overrides, diagnostics)
- Startup banner with colored system info
- Performance benchmarks (bench/dns-bench.sh)
- Landing page updated with new positioning and comparison table
- CI, Dockerfile, LICENSE, development plan docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 10:54:23 +02:00
Razvan Dimescu
13ce7a591d Merge pull request #1 from razvandimescu/feat/async-tokio
Async tokio runtime with modular architecture
2026-03-10 05:35:26 +02:00
Razvan Dimescu
e31188fb88 gitignore docs/ directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:18:59 +02:00
Razvan Dimescu
89e7cbd989 add Makefile with clippy/rustfmt linting, fix all warnings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:04:31 +02:00
Razvan Dimescu
3816cf644d gitignore CLAUDE.md and update README for async tokio
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 04:58:11 +02:00
Razvan Dimescu
9c71e9bb3f refactor to async tokio with modular architecture
- Replace synchronous std::net::UdpSocket with tokio async runtime
- Spawn concurrent task per incoming DNS query via tokio::spawn
- Extract monolithic main.rs into modules: buffer, header, question,
  record, packet, config, cache, forward, stats
- Share state across tasks via Arc<ServerCtx> with scoped Mutex locks
- Add TOML config loading, TTL-aware cache, structured logging, stats
- Add CLAUDE.md, README, dns_fun.toml config, and design docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 04:50:16 +02:00
razvandimescu
4e61caac45 first commit 2020-12-29 12:29:09 +02:00
Razvan Dimescu
c4306f446d Create README.md 2020-12-29 07:08:01 +02:00