Agent-readable wiki

S-UI Wiki: Your Friendly Guide to the Sing-Box Panel

S-UI is a web-based management panel built on top of SagerNet/Sing-Box, a universal proxy platform. It gives you a browser dashboard to configure proxies, manage clients, track traffic, and generate subscription links — all without touching config files by hand.

Pages

  1. Welcome! So What Is S-UI?Imagine sing-box is a powerful but silent robot that routes internet traffic. S-UI is the friendly remote control you use to tell that robot what to do — through a web browser, not a command line. This opening page asks "why does this exist?" and maps out every other page in the wiki so you always know where to look next.
  2. How Do All the Pieces Fit Together?If S-UI were a pizza restaurant, what would the kitchen, the waiter, and the cash register each do? This page walks through the major Go packages — cmd, core, api, web, sub, database, cronjob — and asks "what question does each one answer?" so you build a mental map before diving into details.
  3. The Robot Inside: How Sing-Box Starts and StopsWhen you press "Start" in the dashboard, what actually happens under the hood? This page follows a single button-click all the way down to the sing-box instance, asking at each step: "who tells whom, and how?" Covers core/main.go, box.go, register*.go, and the outbound-check safety net.
  4. The Memory and the Alarm Clock: Database & Cron JobsWhere does S-UI remember your settings when you restart the server? And who cleans up old traffic stats at 3 a.m.? This page explores the SQLite/GORM database layer and the five scheduled jobs (stats, depletion check, WAL checkpoint, core health check, stats deletion), asking "what problem would happen if this job didn't exist?"
  5. The Waiter: How Your Browser Commands Reach the EngineWhen you click a button in the web panel, a request travels from your browser to a Gin HTTP handler to a service function. This page traces that journey, explaining the v2 token-based API, the admin command handlers, and the domain-validation middleware — asking "what could go wrong at each door, and how is it guarded?"
  6. The Gift Bag: How Subscription Links Are BuiltA subscription link is a URL your VPN app fetches to learn which servers to use. This closing page asks: "how does S-UI turn raw database records into a Clash YAML, a JSON config, or a base64 share-link?" It walks through sub/subService.go, clashService.go, jsonService.go, and linkService.go — then leaves you with the key question to keep exploring: what new formats could you add, and where would you start?

Complete Markdown

The complete agent-readable Markdown files are published separately from this HTML page.