$ show itdoginfo/podkop
Podkop is an OpenWrt package for traffic routing using sing-box as the proxy core. It provides a LuCI web interface (TypeScript frontend compiled to JavaScript) with tabs for Settings, Sections (proxy/VPN/block/exclusion), Dashboard (real-time traffic via Clash API WebSocket), and Diagnostic (checks for DNS, sing-box, nftables, FakeIP). The backend consists of shell scripts: /usr/bin/podkop (main entry), /etc/init.d/podkop (procd init), and libraries in /usr/lib/podkop/ (constants.sh, nft.sh, helpers.sh, sing_box_config_manager.sh, etc.). It uses nftables for traffic marking and TPROXY, dnsmasq for DNS hijacking with FakeIP, and downloads community domain/subnet lists from GitHub. It supports proxy protocols: VLESS, Shadowsocks, Trojan, SOCKS, Hysteria2. The architecture is monolithic: the frontend communicates with the backend via shell commands (exec) and WebSocket to the Clash API. The backend manages sing-box configuration, nftables rules, and list updates via cron. Key entry points include install.sh (installation), /usr/bin/podkop (service management), and the LuCI view files. External dependencies include sing-box, jq, curl, nft, coreutils-base64, bind-dig, and the diagnostic endpoints (ip.podkop.fyi, fakeip.podkop.fyi). The system is in beta, with breaking changes possible; users are advised to clear LuCI cache on updates. The codebase demonstrates solid engineering with modular shell libraries, a well-structured TypeScript frontend with unit tests for validators, and CI/CD pipelines. However, it has some drift risks: hardcoded version requirements, compiled JS committed to the repository, and reliance on external services. The frontend includes reusable components such as a reactive store service, WebSocket manager, and composable validators.
The LLM identified 4 files worth highlighting for reuse:
Reactive state store implementing pub/sub pattern with subscribeKey, patch, and reset methods. Isolated from framework specifics, can be extracted into any TypeScript project for state management.
Composable validator for proxy URLs (vless, ss, trojan, socks, hysteria2). Pure functions with no internal dependencies, easily reusable for URL validation in other projects.
Utility function to convert byte values into human-readable strings (e.g., 1024 -> '1.0 KiB'). Simple, well-tested, and framework-agnostic.
UI component that renders a button with loading state, icon support, and click handler. Uses SVG icons and inline styles, can be extracted as a standalone component.