$ show koho/frpmgr
FRP Manager is a Windows desktop application that provides a graphical interface for managing FRP (Fast Reverse Proxy) client configurations. It allows users to create, edit, launch, stop, and monitor multiple FRP proxy configurations, supporting both legacy INI and modern TOML formats. The application can run as a standard GUI or as a Windows service, with real-time status updates via IPC between the GUI and the service process. It includes features such as quick-add proxy presets (SSH, RDP, FTP, etc.), import/export via file, URL, or clipboard, NAT type discovery, master password protection, and multi-language support (6 languages). The installer is a native Windows bootstrapper that extracts an MSI and handles service lifecycle during upgrades. The architecture is monolithic: the main entry point in `cmd/frpmgr/main.go` decides whether to launch the GUI or run as a service. The UI layer uses the `lxn/walk` library (a custom fork) for native Win32 controls, organized into pages (configuration, log, preferences, about). The service layer wraps the official `fatedier/frp` client library and manages Windows service installation, start/stop, and configuration reload. IPC is implemented via named pipes for status updates. Configuration parsing and validation are handled in the `pkg/config` package, with conversion between INI and TOML. The project also includes a comprehensive i18n system using `gotext`, a set of reusable validators, and utility functions for file operations, string manipulation, and reflection-based config pruning. External dependencies include the FRP library (`fatedier/frp` v0.71.0), the forked `lxn/walk` GUI library, Windows API bindings (`golang.org/x/sys/windows`, `github.com/Microsoft/go-winio`), and WiX Toolset for the installer. The build process requires Go 1.25, MinGW, Node.js, and Windows SDK. The codebase is well-structured with clear separation of concerns, though it is tightly coupled to Windows and the forked walk library, limiting portability. Test coverage is present for core packages (config, validators, utilities) but sparse for UI and service components.
The LLM identified 3 files worth highlighting for reuse:
Implements a password strength validator and a silent tooltip error presenter. The PasswordValidator checks for minimum length and character classes, while the SilentToolTipErrorPresenter provides a non-intrusive way to display validation errors in a GUI context. This pattern is reusable in any application requiring password validation with user-friendly error feedback, and is decoupled from the rest of the codebase.
Contains the `PruneByTag` function that uses reflection to remove fields from a struct based on struct tags. This is a non-obvious technique for dynamically cleaning configuration structs before serialization or display, reducing boilerplate. The function is self-contained and can be extracted for use in any Go project that needs to filter struct fields by tag annotations.
Provides a thin abstraction over Go's `gotext` library for multi-language support. It handles language detection from OS settings or user configuration, loads the appropriate translation catalog, and exposes a simple `Tr` function for message translation. This pattern is reusable in any Go application needing i18n, and is independent of the rest of the codebase.