Files
drouter/.gitattributes
liuzhuohua 64df3cf331 feat: Drouter 1.0.0 —— Debian 13 软路由管理系统
一套跑在 Debian 13 (trixie) 上的软路由管理系统,提供 43 个功能页面的
Web 管理面板:WAN 接入、PPPoE 多拨、DHCP/DNS、IPv6、防火墙、QoS 限速、
访问控制、DDNS、文件共享、Docker 管理等。

核心设计原则:不重新实现任何协议
  PPPoE 交给 ppp,DHCP 交给 dnsmasq,IPv6 RA 交给 radvd,NAT 交给 nftables。
  Web 面板只做三件事:渲染原生配置文件 → 语法预检 → 原子写入并 reload。
  面板删掉后,系统仍是一台配置完好的 Debian 路由器。

安全默认值
  · 安装后不接管网络:不改默认路由、不开 IP 转发、不启动 DHCP 服务
  · 所有改网络的动作都需要用户在面板上亲手点「应用」
  · 避开 5900 端口,不触碰 VNC / X 会话
  · 配置写入前先做语法预检,失败则回滚

架构
  · backend/  Python 3 标准库,零第三方依赖(9 个模块)
  · web/      原生 JS/CSS,无构建步骤
  · 常驻 helper 通过 Unix socket 提供 75 个动作,socket 不可用时回退 subprocess
  · 鉴权走 X-Token 请求头

打包
  · packaging/build-deb.sh            → drouter_1.0.0_all.deb(含 6 个 systemd 单元)
  · scripts/make-offline-deps.sh      → 236 个依赖 .deb + 本地仓库索引
  · packaging/build-offline-bundle.sh → 自包含离线包,目标机零外网可装
  · packaging/build-docker.sh         → 容器镜像(体验用)

测试
  40 套单元测试 + 3 个前端检查脚本(菜单映射 / 离线渲染 / 手机适配),
  全部挂在 devtools/sync.sh 的预检链里。

许可:MIT
2026-09-30 19:26:24 +08:00

47 lines
1.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 行尾策略固化在仓库里,不依赖每个人的本地 core.autocrlf 设置。
#
# 背景:这个项目是「Windows 上开发 → Linux 上部署」。如果 shell 脚本被
# 自动转成 CRLF,Linux 上会报 `$'\r': command not found`,而且 deploy.sh
# 会**静默**跑成一堆错误(它不检查每条命令的退出码)。
# 所以:所有要进 Linux 的文本一律 LF。
# 默认:文本文件入库时统一为 LF
* text=auto eol=lf
# 明确声明为 LF(这些文件一旦变 CRLF 就会真的坏掉)
*.sh text eol=lf
*.py text eol=lf
*.js text eol=lf
*.css text eol=lf
*.html text eol=lf
*.svg text eol=lf
*.md text eol=lf
*.service text eol=lf
*.timer text eol=lf
*.conf text eol=lf
*.list text eol=lf
*.rules text eol=lf
LICENSE text eol=lf
.gitignore text eol=lf
.gitattributes text eol=lf
# Windows 用的批处理保留 CRLF
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
# 二进制:不作任何转换
*.deb binary
*.tar binary
*.gz binary
*.xz binary
*.zst binary
*.png binary
*.jpg binary
*.ico binary
*.woff binary
*.woff2 binary
# 让 `git diff` 能认出 .deb 是二进制,不要尝试渲染
*.deb -diff -merge -text