MCPcopy Index your code
hub / github.com/GitCourser/XuanWu

github.com/GitCourser/XuanWu @0.2.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.3 ↗ · + Follow
98 symbols 287 edges 20 files 84 documented · 86%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

玄武

跨平台定时任务管理系统

(Docker, Linux, Windows)

image

功能

  • 各种命令行工具
  • 在线管理文件
  • 在线查看任务日志
  • 任务日志按期自动清理
  • 任务导入导出
  • Cron支持秒级扩展

版本

docker

镜像中包含 python 3.11nodejs 20 环境

docker pull dkcourser/xuanwu

建一个目录用于保存数据,挂载路径 /app/data,默认端口:4165,可用环境变量 XW_PORT 修改容器端口,也可不要端口直接用 UDS 监听

docker run -d \
  -p 4165:4165 \
  -v $PWD/xuanwu:/app/data \
  --name xuanwu \
  dkcourser/xuanwu

二进制程序

下载:Releases
提供 Linux(amd64,arm64),Windows(amd64)
脚本环境需要自己安装,pythonnodejs,或其他脚本

Windows 特殊说明

  • 可用 -hide 参数隐藏命令窗口(在快捷方式中添加)

安全相关

  • 单用户系统,默认用户名和密码都是 admin
  • 如果公网能访问此服务,请务必修改用户名和密码
  • 除了在系统设置中更改,也可以在启动程序前直接添加配置文件 data/config.json

配置文件

配置文件在程序数据目录 data/config.json,如果手动修改要重启程序
密码为 sha256 加密后的值,可添加 "port": 12345 修改默认端口
示例:

{
    "name": "xuanwu",
    "username": "admin",
    "password": "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918",
    "cookie_expire_days": 30,
    "log_clean_days": 7,
    "task": [
        {
            "enable": true,
            "exec": "dir",
            "name": "test_task_1740128994",
            "times": [
                "0 */1 * * * *"
            ],
            "workdir": ""
        }
    ]
}

端口设置

优先级:环境变量 XW_PORT > 配置文件 port > 默认 4165
XW_PORTLinux 中可设置为 Unix Domain Socket (UDS) 用于 caddy/nginx 反代

XW_PORT=8080
XW_PORT=/tmp/xuanwu.sock

Caddy:reverse_proxy unix//tmp/xuanwu.sock
Nginx:proxy_pass unix:/tmp/xuanwu.sock;

自编译

前端UI 构建后将 dist 放入后端项目的 public 中,也可直接下载构建好的 Releases
后端用 go 1.24 编译

Extension points exported contracts — how you extend this code

TaskLogWriter (Interface)
TaskLogWriter 导出的接口 [1 implementers]
log/xwlog.go

Core symbols most depended-on inside this repo

ErrMesage
called by 40
gin/response/response.go
Set
called by 27
gin/cron/allTask.go
ReadConfigFileToJson
called by 13
config/config.go
validatePath
called by 10
gin/file.go
Close
called by 10
log/xwlog.go
GetConfigPath
called by 8
lib/pathutil/pathutil.go
WriteConfigFile
called by 8
config/config.go
OkMesage
called by 5
gin/response/response.go

Shape

Function 69
Method 15
Struct 13
Interface 1

Languages

Go100%

Modules by API surface

gin/file.go12 symbols
log/xwlog.go10 symbols
lib/pathutil/pathutil.go10 symbols
gin/userProfile.go8 symbols
lib/aes.go7 symbols
gin/cron/runTask.go7 symbols
xuanwu/executor.go6 symbols
gin/response/response.go6 symbols
gin/cron/allTask.go5 symbols
gin/auth.go5 symbols
xuanwu/cron_task.go4 symbols
lib/token.go4 symbols

For agents

$ claude mcp add XuanWu \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page