Skip to content

给KernelSU、Apatch用的zerotier,提供UI界面,magisk也能用,但是没界面

License

Notifications You must be signed in to change notification settings

Familyye/ZeroTierForKSU

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZeroTier for KSU

基于KSU WEBUI实现的Zertier客户端,同时支持部分zerotier服务端功能。 Magisk需要搭配5ec1cff/KsuWebUIStandalone使用 自1.14.0之后KSU版本需要在11928以上才能正常使用UI,或者使用5ec1cff/KsuWebUIStandalone

BUG

  • 通过UI启动的zerotier进程会随着KSU Manager的结束而退出
  • 在模块禁用的情况下依然可以操作服务启用和停用(实际上不应该能操作,毕竟都禁用了),这将导致下次启用模块的时候要启停服务两次才能使用zerotier进程正确启动。ps:模块禁用功能是特地保留的,我不想在停用模块的情况下还占用系统资源。
  • 服务停止的情况下,有概率会在首页显示已经禁用的节点。
  • zt切换网络导致全局断网的问题 ZerotierOne 1.14.0版本已修复
  • 管理页在处理Member的时候需要等待处理完才能展开下一个Member的信息,否则后一个会覆盖前一个的配置,导致第一个Member修改的配置不生效。可以提前缓存下要修改的信息,一次发送请求,下次再改。

TODO

  1. 流水线增加自定义zerotier版本编译。据说1.8.9版本没有zt切换网络导致全局断网的问题,经过测试,依然复现,而且还有漏洞,官方推荐1.12.x版本以上有安全补丁,别降级了。
  2. 新建zerotier路由规则表(没学会。先放着吧)
  3. 增加管理页面,需要自行准备API Token
  4. 国际化
  5. 等待新版KSU发布后,重新发版,现在是以补丁的形式提前用上了KSU的某些未修复的API

免责声明

本项目不对以下情况负责:设备变砖、SD 卡损坏或 SoC 烧毁。

使用方法

用UI界面

List Peers Setting

一些可选操作说明

文件说明

Zerotier数据目录:/data/adb/zerotier;在该目录下创建以下文件可以做到

创建文件/data/adb/zerotier/KEEP_ON_UNINSTALL,卸载模块可保留数据目录 创建文件/data/adb/zerotier/MANMANUAL,关闭开机自启 创建文件/data/adb/zerotier/ALLOW_9993,iptables放行UDP 9993入端口 创建文件/data/adb/zerotier/ROUTER_RULE_NEW,zerotier流量路由模式改为新建路由规则表,删除该文件则是提升main表优先级模式

执行脚本说明

执行所有脚本都需要带全路径/Executing all scripts requires a full path

  sh /data/adb/modules/ZeroTierForKSU/zerotier-cli # 同官方
  sh /data/adb/modules/ZeroTierForKSU/zerotier-idtool # 同官方
  sh /data/adb/modules/ZeroTierForKSU/zerotier.inotify # 监听/data/adb/zerotier/state目录,用于启动服务。

ZeroTier for KSU - zerotier.sh

Usage:
  zerotier.sh options

Options:
  -h                                         -- Show this message.
  start                                      -- Start Zerotier Service
  restart                                    -- Retart Zerotier Service
  stop                                       -- Stop Zerotier Service
  status                                     -- Show Node Status
  token                                      -- Show Local Service Token
  apiToken                                   -- Show Remote Service apiToken
  inotifyd                                   -- Start inotifyd Service

Example:
  sh zerotier.sh -h
  sh zerotier.sh start
  sh zerotier.sh restart
  sh zerotier.sh stop
  sh zerotier.sh status
  sh zerotier.sh token
  sh zerotier.sh apiToken
  sh zerotier.sh inotifyd

ZeroTier for KSU - api.sh

Usage:
  api.sh <api_type> [options]

Options:
  -h                                            -- Show this message.
  <api_type>   local/central
    local
      status                                    -- Show Node Status
      service                                    -- Manage Zerotier-One Service Status
        action     value:[ start | stop ]
      network                                   -- When the action is "list", "networkid" and "bodydata" are optional. When the action is "leave", "bodydata" is optional. When the action is "join", "networkid" and "bodydata" are required.
        action     value:[ list | leave | join ]
        networkid  value:[ networkid ](optional)
        bodydata   value:[ JSON object ](optional)
      peer                                      -- All the nodes your node knows about
      firewall                                  -- Control the firewall to allow traffic into port 9993
        action     value:[ A | D ]
      router                                    -- Set the Zerotier traffic routing method
        router     value:[ routing (unrealized) | main ]
        action     value:[ A | D ]
      orbit                                     -- Join Private Root Servers
        moonid     value:[ moonid ]
    central
      status                                    -- Show Center Status
      network                                   -- When the action is "list", "networkid" and "bodydata" are optional. When the action is "remove", "bodydata" is optional. When the action is "add", No parameters are required. When the action is "modify", "networkid" and "bodydata" are required.
        action     value:[ list | remove | add | modify ]
        networkid  value:[ networkid ](optional)
        bodydata   value:[ JSON object ](optional)
      member                                    -- When the action is "list", "bodydata" and "memberID" are optional. When the action is "remove", "bodydata" is optional. When the action is "modify", "networkid", "memberID" and "bodydata" are required.
        action     value:[ list | remove | modify ]
        networkid  value:[ networkid ] (optional)
        memberID   value:[ memberID ] (optional)
        bodydata   value:[ JSON object ] (optional)
    apiToken                                    -- Manage the tokenAuth for accessing the central API
      action       value:[ show | update ]
      key          value:[ apiToken ]

Example:
  help
    sh api.sh -h

  local
    sh api.sh local status
    sh api.sh local service start
    sh api.sh local service stop
    sh api.sh local peer
    sh api.sh local firewall A
    sh api.sh local firewall D
    sh api.sh local router routing A (unrealized)
    sh api.sh local router routing D (unrealized)
    sh api.sh local router main A
    sh api.sh local router main D
    sh api.sh local orbit yourMoonid
    sh api.sh local network list
    sh api.sh local network leave yourNetworkid (suggest: use command `zerotier-cli leave yourNetworkid`)
    sh api.sh local network join  yourNetworkid {} (suggest: use command `zerotier-cli join yourNetworkid`)

  central
    sh api.sh central status
    sh api.sh central network list
    sh api.sh central network remove yourNetworkid
    sh api.sh central network add
    sh api.sh central network modify yourNetworkid {}
    sh api.sh central member list yourNetworkid
    sh api.sh central member remove yourNetworkid memberID
    sh api.sh central member modify yourNetworkid memberID '{"hidden":false,"config":{"authorized":true}}'

  apiToken
    sh api.sh apiToken show
    sh api.sh apiToken update xxxxxxxxx

感谢以下连接提供的帮助,顺序不分先后

About

给KernelSU、Apatch用的zerotier,提供UI界面,magisk也能用,但是没界面

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 71.6%
  • Shell 20.6%
  • JavaScript 5.4%
  • TypeScript 1.3%
  • HTML 1.1%