Open-Box README

The project's README from github.com/liandu2024/Open-Box. As one markdown file: README.md.

Open-Box

OpenWrt 上的一体化透明代理:一条命令装完 sing-box 内核和管理面板,首次打开面板设个密码、跟引导走,不用手写任何配置文件。

订阅、节点、分流规则、DNS 接管、防火墙改动全部由面板托管,配错了也能一键恢复直连。

界面

代理 · 策略:每个站点集一张卡片,直接看到它此刻走哪条线路、下面这些节点的健康状况。

代理页策略页签

域名穿透:展开任意一条策略,一层层看到「站点集 → 节点组 → 具体节点」的完整链路,每一层都能当场改。

域名穿透

规则 · 真实路由:输入一个域名,先按规则推一遍,再真发一次请求看它实际走了哪条线、DNS 用了哪台服务器、命中第几条规则。

规则调试

订阅管理:Clash 配置和分享链接都能吃,节点按地区自动改名分组。

订阅管理

节点管理:自动择优组和手动组混排,动态组按关键词自动收编新节点,不用每次刷新订阅回来重勾一遍。

节点管理

目标分流:一个站点集 = 一组匹配条件 + 一个同名出口,规则集来自 MetaCubeX 的 meta-rules-dat(含被墙域名表)。

目标分流

后端设置:IPv6、测速地址、自身升级和规则集更新的计划任务都在这里。

后端设置

它能做什么

硬件要求

以上任一条不满足,install.sh 的预检会报错退出,不会碰你的系统。发布包同时提供两种架构,日常验证主要在 x86_64 上进行。

安装

SSH 以 root 登录路由器,二选一:

curl -fsSL https://raw.githubusercontent.com/liandu2024/Open-Box/main/scripts/install.sh | sh

GitHub 访问不畅时用加速版(脚本内置了几个加速站,会依次探测自动挑一个能用的):

curl -fsSL https://ghfast.top/https://raw.githubusercontent.com/liandu2024/Open-Box/main/scripts/install.sh | sh -s -- --mirror

已经有信得过的加速站,也可以指定具体前缀跳过探测:sh -s -- --mirror <镜像前缀>。

安装脚本先做预检(架构、存储、内存、系统),通过才下载对应架构的发布包、校验 SHA256、铺装到 /opt/open-box/ 并启动面板。校验不过或下载失败,系统不会有任何改动。

装完之后:

  1. 浏览器打开脚本输出的地址,一般是 http://<路由器局域网 IP>:2026。
  2. 首次访问强制设置管理密码——安装过程不生成随机密码。
  3. 跟引导走:加订阅、挑分流、启动内核。

面板默认只允许局域网访问,由防火墙规则保证,不会自动开到公网。

升级

面板「设置 → 后端设置」里点「检查更新」就能升,也可以在 SSH 里跑:

curl -fsSL https://raw.githubusercontent.com/liandu2024/Open-Box/main/scripts/update.sh | sh

强制直连 GitHub 加 -s -- --direct,强制走加速加 -s -- --mirror [前缀]。不带参数时沿用安装时选的下载通道。

升级保留 data/(订阅、规则、面板密码)和已生效的运行配置,只替换程序本体。升级前内核在跑的话,升级完会按新版本重新生成配置并自动把内核带起来。

卸载

# 停服务、清理系统改动、删程序文件;默认保留 data/
curl -fsSL https://raw.githubusercontent.com/liandu2024/Open-Box/main/scripts/uninstall.sh | sh

# 连 data/ 一起删,彻底清干净
curl -fsSL https://raw.githubusercontent.com/liandu2024/Open-Box/main/scripts/uninstall.sh | sh -s -- --purge

不加 --purge 且在真实终端里交互执行时,脚本会追问一次是否保留 data/;通过管道非交互执行问不到,按"保留"处理。

LuCI 兜底页

装完之后路由器自带界面里会多一个入口:服务 → Open-Box。面板本身打不开时用它救场:

被自己配的分流规则卡在外面时,先去这一页。

安全提示

面板后端拥有路由器 root 级权限(它要改防火墙、接管 DNS、启停系统服务)。所以:

仓库结构

本地开发

bash scripts/dev-panel.sh                    # 构建并启动面板于 http://127.0.0.1:2026
cd panel && corepack pnpm run test:server    # 服务端测试
cd panel && corepack pnpm run type-check     # 类型检查

Open-Box (liandu2024/Open-Box)

gfw
Searching Database…

What is this?Open-Box is an all-in-one transparent proxy solution for OpenWrt routers: it installs the sing-box core plus a web management panel with a single command, so you can set up proxy routing from a browser without hand-editing any config files.
Is this a router firmware, or something I add on top of OpenWrt?It's not a firmware image — it's an installer script and panel you add to an existing OpenWrt install. It copies the sing-box binary and panel into /opt/open-box/ and manages existing OpenWrt firewall/DNS settings rather than replacing the OS.
How do I install it on my router?SSH into the router as root and run the install script (there's a mirror-accelerated variant if GitHub is slow). It pre-checks architecture, storage, memory and OS, then downloads and SHA256-verifies the release before starting the panel; open the printed address (typically port 2026) in a browser and set an admin password on first visit.
What hardware and OS does it need?The router must actually be running OpenWrt (checked via /etc/openwrt_release), have an x86_64 or arm64/aarch64 CPU (mips/mipsel is unsupported), and at least 512MB of free storage and 512MB of RAM.
Does it verify the TLS certificates of my proxy nodes?No, certificate checking for proxy nodes is skipped by default, since self-signed or mismatched certificates are common among proxy providers and strict validation would just break working nodes. The node's own password/UUID authentication is unaffected.
What if I misconfigure a rule and lock myself out of the panel?The router's native LuCI interface gets an extra Open-Box entry that works even if the panel is unreachable: it can stop/start the core and panel separately, and has an 'emergency stop and restore direct connection' button that undoes routing/firewall/DNS changes.
Which proxy protocols and subscription formats are supported?Subscriptions can be Clash YAML or base64 share links, and protocols cover shadowsocks, vmess, vless (including REALITY), trojan, hysteria2, tuic, anytls and wireguard.
How does the DNS handling work?Open-Box offers three DNS modes: taking over dnsmasq forwarding (default), hijacking via firewall rules, or disabling DNS handling entirely, so domestic domains resolve locally for nearby CDNs while proxied domains resolve through the proxy side.
What happens to my settings when I upgrade or uninstall?Upgrades keep the data/ folder (subscriptions, rules, panel password) and only swap the program binaries, then regenerate config and restart the core if it was running. Uninstalling without --purge asks whether to keep data/, defaulting to keep it when run non-interactively.
Can other devices on my network use this as their proxy too?Yes, the 'shared network' feature opens the sing-box inbound to other devices on the LAN so they can use the router itself as their proxy.
Creator
liandu2024
Size
2.6 MB
Stars
2.2K
Age
2mo
Commits · 90 Days