gistfile1.txt
· 3.7 KiB · Text
Raw
Directory Structure
/etc/wireguard/wgctl/
├── core/
│ ├── core.sh — bootstrap, module/command loader
│ ├── context.sh — path constants (ctx:: functions)
│ ├── utils.sh — shared utilities
│ ├── json.sh — Python helper wrappers (json:: functions)
│ ├── json_helper.py — all Python data functions
│ ├── fmt.sh — date/number formatting
│ ├── fmt_helper.py — Python formatting helpers
│ ├── ui.sh — display primitives (ui:: functions)
│ ├── log.sh — logging functions (log:: functions)
│ ├── flag.sh — flag parsing
│ ├── module.sh — module loader
│ ├── command.sh — command loader
│ └── color.module.sh — color helpers (color:: functions)
├── modules/
│ ├── config.module.sh — config reading/defaults
│ ├── peers.module.sh — peer queries, status, formatting
│ ├── firewall.module.sh — iptables wrappers (fw:: functions)
│ ├── keys.module.sh — key generation/reading
│ ├── ip.module.sh — IP allocation, validation
│ ├── monitor.module.sh — endpoint cache, watchlist, events
│ ├── rule.module.sh — rule resolution with inheritance
│ ├── group.module.sh — group queries
│ ├── block.module.sh — block state management
│ └── net.module.sh — service registry, annotations
├── commands/
│ ├── add.command.sh
│ ├── remove.command.sh
│ ├── rename.command.sh
│ ├── list.command.sh
│ ├── inspect.command.sh
│ ├── block.command.sh
│ ├── unblock.command.sh
│ ├── rule.command.sh
│ ├── group.command.sh
│ ├── net.command.sh
│ ├── fw.command.sh
│ ├── audit.command.sh
│ ├── watch.command.sh
│ ├── logs.command.sh
│ ├── config.command.sh
│ ├── qr.command.sh
│ ├── service.command.sh
│ ├── shell.command.sh
│ └── test.command.sh
└── install/
/etc/wireguard/.wgctl/
├── wgctl.conf — config overrides
├── rules/ — assignable rule files
│ ├── user.rule
│ ├── guest.rule
│ ├── admin.rule
│ ├── zephyr.rule — example per-user rule
│ └── base/ — base rules (not directly assignable)
│ ├── no-nginx.rule
│ ├── no-proxmox.rule
│ ├── no-truenas.rule
│ ├── no-lan.rule
│ ├── dns-restricted.rule
│ └── moonlight-02.rule
├── groups/ — group definition files
│ ├── family.group
│ ├── arctic.group
│ └── test.group
├── blocks/ — per-peer block state (JSON)
│ └── phone-test.block
├── meta/ — per-peer metadata
│ └── phone-nuno.meta
├── services.json — network services registry
└── daemon/
├── events.log — WireGuard events (JSONL)
├── fw_events.log — firewall drops (JSONL, via ulogd2)
├── watchlist.json — blocked peer IPs for monitor
├── endpoint_cache.json — cached real endpoints
├── transfer_cache.json — activity delta cache
└── wgctl-monitor.py — scapy packet capture daemon
| 1 | Directory Structure |
| 2 | /etc/wireguard/wgctl/ |
| 3 | ├── core/ |
| 4 | │ ├── core.sh — bootstrap, module/command loader |
| 5 | │ ├── context.sh — path constants (ctx:: functions) |
| 6 | │ ├── utils.sh — shared utilities |
| 7 | │ ├── json.sh — Python helper wrappers (json:: functions) |
| 8 | │ ├── json_helper.py — all Python data functions |
| 9 | │ ├── fmt.sh — date/number formatting |
| 10 | │ ├── fmt_helper.py — Python formatting helpers |
| 11 | │ ├── ui.sh — display primitives (ui:: functions) |
| 12 | │ ├── log.sh — logging functions (log:: functions) |
| 13 | │ ├── flag.sh — flag parsing |
| 14 | │ ├── module.sh — module loader |
| 15 | │ ├── command.sh — command loader |
| 16 | │ └── color.module.sh — color helpers (color:: functions) |
| 17 | ├── modules/ |
| 18 | │ ├── config.module.sh — config reading/defaults |
| 19 | │ ├── peers.module.sh — peer queries, status, formatting |
| 20 | │ ├── firewall.module.sh — iptables wrappers (fw:: functions) |
| 21 | │ ├── keys.module.sh — key generation/reading |
| 22 | │ ├── ip.module.sh — IP allocation, validation |
| 23 | │ ├── monitor.module.sh — endpoint cache, watchlist, events |
| 24 | │ ├── rule.module.sh — rule resolution with inheritance |
| 25 | │ ├── group.module.sh — group queries |
| 26 | │ ├── block.module.sh — block state management |
| 27 | │ └── net.module.sh — service registry, annotations |
| 28 | ├── commands/ |
| 29 | │ ├── add.command.sh |
| 30 | │ ├── remove.command.sh |
| 31 | │ ├── rename.command.sh |
| 32 | │ ├── list.command.sh |
| 33 | │ ├── inspect.command.sh |
| 34 | │ ├── block.command.sh |
| 35 | │ ├── unblock.command.sh |
| 36 | │ ├── rule.command.sh |
| 37 | │ ├── group.command.sh |
| 38 | │ ├── net.command.sh |
| 39 | │ ├── fw.command.sh |
| 40 | │ ├── audit.command.sh |
| 41 | │ ├── watch.command.sh |
| 42 | │ ├── logs.command.sh |
| 43 | │ ├── config.command.sh |
| 44 | │ ├── qr.command.sh |
| 45 | │ ├── service.command.sh |
| 46 | │ ├── shell.command.sh |
| 47 | │ └── test.command.sh |
| 48 | └── install/ |
| 49 | |
| 50 | /etc/wireguard/.wgctl/ |
| 51 | ├── wgctl.conf — config overrides |
| 52 | ├── rules/ — assignable rule files |
| 53 | │ ├── user.rule |
| 54 | │ ├── guest.rule |
| 55 | │ ├── admin.rule |
| 56 | │ ├── zephyr.rule — example per-user rule |
| 57 | │ └── base/ — base rules (not directly assignable) |
| 58 | │ ├── no-nginx.rule |
| 59 | │ ├── no-proxmox.rule |
| 60 | │ ├── no-truenas.rule |
| 61 | │ ├── no-lan.rule |
| 62 | │ ├── dns-restricted.rule |
| 63 | │ └── moonlight-02.rule |
| 64 | ├── groups/ — group definition files |
| 65 | │ ├── family.group |
| 66 | │ ├── arctic.group |
| 67 | │ └── test.group |
| 68 | ├── blocks/ — per-peer block state (JSON) |
| 69 | │ └── phone-test.block |
| 70 | ├── meta/ — per-peer metadata |
| 71 | │ └── phone-nuno.meta |
| 72 | ├── services.json — network services registry |
| 73 | └── daemon/ |
| 74 | ├── events.log — WireGuard events (JSONL) |
| 75 | ├── fw_events.log — firewall drops (JSONL, via ulogd2) |
| 76 | ├── watchlist.json — blocked peer IPs for monitor |
| 77 | ├── endpoint_cache.json — cached real endpoints |
| 78 | ├── transfer_cache.json — activity delta cache |
| 79 | └── wgctl-monitor.py — scapy packet capture daemon |