Commit Graph

267 Commits

Author SHA1 Message Date
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