Commit graph

20 commits

Author SHA1 Message Date
Nuno Duque Nunes
d314ba376e feat: wgctl-conntrack Go daemon
- conntrack/event.go: TrafficEvent type
- conntrack/filter.go: WG subnet filter, IsExternal, ProtoName
- conntrack/subscriber.go: netlink conntrack DESTROY subscriber
- writer/log.go: JSON line writer with mutex
- resolver/peers.go: WG IP → peer name from conf files + endpoint index
- resolver/services.go: IP:port → service name from services.json
- config/config.go: reads wgctl.json, sensible defaults
- cmd/root.go: CLI flags
- main.go: wires everything together
- DESTROY events only: full byte/packet counts per connection
- filters to WireGuard subnet, marks external traffic
2026-05-28 02:51:27 +00:00
Nuno Duque Nunes
0b9f113453 feat: block history tracking
- core/lib/block_history.py: record/unblock/list functions
- ctx::block_history: .wgctl/data/block-history/ path
- block --reason: record block event with reason, endpoint, triggered_by
- unblock --reason: update block event with unblock timestamp
- json::block_history_record/unblock/list/list_all wrappers
- json::endpoint_cache_get: get cached endpoint for peer
- export --all: include block-history in full backup
- import --all: restore block-history files
- tests: section_block_unblock with fixture peer, history field validation
2026-05-28 01:51:37 +00:00
Nuno Duque Nunes
7a544f9019 feat: display config system, table/compact toggle
- modules/display.module.sh: display config loader
- .wgctl/config/display.json: per-view style configuration
- ctx::display: points to .wgctl/config/display.json
- json_helper: display_load() reads view styles
- list: display::render dispatcher, _render_table with dynamic widths/colors
- ui::peer::_row_color/status_color: shared by both table and compact
- table layout: aligned columns, colored status/rows, dynamic separator
2026-05-27 02:48:51 +00:00
Nuno Duque Nunes
8b47e55b4a feat: peer endpoint history tracking and resolution
- daemon: update_peer_history() tracks all endpoints per peer
- daemon: endpoint_index.json for O(1) IP -> peer name lookup
- daemon: poll_handshakes updates history on every cycle
- json_helper: peer_history_lookup() uses index, falls back to scan
- resolve::endpoint_parts: step 3 checks peer history index
- json.sh: json::peer_history_lookup wrapper
- resolve: mobile peer IPs now resolve to peer name via history
2026-05-26 15:51:53 +00:00
Nuno Duque Nunes
3c3f870427 feat: logs descending sort, gap/offline indicator, endpoint resolution
- wg_events: sort_order param (desc default), --ascending/--descending flags
- wg_events: endpoint cache fallback via _endpoint() helper
- wg_events: gap computed ascending always, then sliced/reversed correctly
- fw_events: sort_order param, descending default
- ui::logs::wg_row: gap suffix with 'offline' label when gap > threshold
- logs.command.sh: --ascending/--descending flags, pass sort_order to both functions
- daemon: endpoint cache fallback in poll_handshakes
- json.sh: json::wg_events passes ctx::endpoint_cache as arg
2026-05-26 01:34:48 +00:00
Nuno Duque Nunes
cf71e9f51a test: add tests for all new features, fix bugs found by tests
- integration: logs query flags, hosts command, peer command sections
- unit: fmt::bytes, config::dns_string, parse_since, ui::group::status
- destructive: duplicate rule validation, peer update-dns/tunnel
- fix: config::allowed_ips_for used $2 instead of $1
- fix: identity rule assign exit_code unbound variable
- fix: ctx::identity → ctx::identities in peers::get_identity
- fix: peers::get_identity restored (needed for rule assign duplicate check)
- rule assign: blocks if rule already in peer's identity via peers::get_identity
- identity rule assign: --migrate removes conflicting direct peer rules
2026-05-26 00:09:30 +00:00
Nuno Duque Nunes
86220850c1 fix: handshake session detection, endpoint cache, watch ordering
- wgctl-monitor: update _hs_last_logged on ALL handshakes not just new sessions
- wgctl-monitor: fix endpoint_cache.json absolute path
- wgctl-monitor: move script to wgctl/daemon/ (correct location)
- watch: _poll_handshakes sorts by ts descending, endpoint cache fallback
- watch: empty endpoint uses - not em dash (alignment fix)
- logs: newline between fw and wg sections
- monitor::live extracted, cmd::logs::follow no longer calls cmd::run
- ui.sh: UTF-8 extra byte constants
2026-05-25 16:19:13 +00:00
Nuno Duque Nunes
57e08e88c4 feat: rule list tableless layout with inline extends and +all/-N indicators 2026-05-22 23:12:27 +00:00
Nuno Duque Nunes
4b2f2a846a feat: identity, subnet, policy systems + tableless layouts 2026-05-22 03:42:40 +00:00
Nuno Duque Nunes
de1a44a7e4 finish base implementation 2026-05-20 21:49:44 +00:00
Nuno Duque Nunes
7323bf20f1 feat: main group display, group::has_peer, config validation, full block cleanup on unblock, ui::empty helper, blocks header count 2026-05-17 22:06:21 +00:00
Nuno Duque Nunes
cf90ab22db feat: block system JSON migration, M:N group tracking, block module, block::restore_all, color module, fw refactor 2026-05-15 04:44:53 +00:00
Nuno Duque Nunes
6ac1a7d3a2 feat: rule inheritance, rule groups, rule inspect, ui::center, fw dedup, activity metrics 2026-05-13 22:44:07 +00:00
Nuno Duque Nunes
a09c59a7c4 fix: iptables rule ordering, idempotent fw functions, rule module cleanup, variable leak fixes 2026-05-13 04:14:30 +00:00
Nuno Duque Nunes
a7fd62ce32 refactor: group::each_peer helper, peer existence checks, group remove cleanup, watch multi-peer filter 2026-05-13 00:06:34 +00:00
Nuno Duque Nunes
51e3443357 refactor: rule::show new layout, assign fix, unblock helpers, test improvements 2026-05-12 04:27:47 +00:00
Nuno Duque Nunes
b3a9c69cab refactor: block::run helpers, test --fn mode, param defaults 2026-05-12 01:21:25 +00:00
Nuno Duque Nunes
8ca3669c6c refactor: test suite improvements, peers::get_type, dead code removal, add::run helpers, ui::col_width attempt 2026-05-12 00:49:12 +00:00
Nuno Duque Nunes
0efa6c3a9e feat: date format config, batch optimizations, list refactor, fw:: rename, .wgctl data dir 2026-05-11 22:27:33 +00:00
root
78f9caaf17 add wgctl 2026-05-06 23:02:12 +00:00