MCPcopy
hub / github.com/XZB-1248/Spark

github.com/XZB-1248/Spark @v0.2.1 sqlite

repository ↗ · DeepWiki ↗ · release v0.2.1 ↗
763 symbols 2,120 edges 82 files 157 documented · 21%
README

[English] [中文] [API Document] [API文档]


Spark

Spark 是一个免费、安全、开源、基于网页、跨平台且功能丰富的远程管理工具,可以让你通过浏览器,随时随地管理设备。

本项目收集你的任何信息,无论是服务端或是客户端。因此,服务端永远不会自动更新,客户端永远只会与服务端通信。


GitHub repo size GitHub issues GitHub closed issues
GitHub downloads GitHub release (latest by date)

免责声明

本项目及其源代码和发行版,旨在用于学习和交流。

禁止用于任何非法用途!

使用本项目所带来的风险由使用者本人承担。

作者和开发者不会对你错误使用而造成的损害承担任何责任。

数据无价,在点击任何按钮、输入任何命令之前,请三思。


快速开始

本地安装

  • 下载服务端,按照配置文件说明,设置好配置文件。
  • 运行服务端,访问IP:端口,例如 http://localhost:8000/
  • 在管理页面中生成客户端,并部署到设备上。
  • 现在就可以控制这个设备了。

配置文件

在服务端的根目录下,创建config.json文件,按照以下格式填写:

json { "listen": ":8000", "salt": "123456abcdefg", "auth": { "username": "password" }, "log": { "level": "info", "path": "./logs", "days": 7 } }

  • listen 必填,格式为 IP:端口
  • salt 必填,修改后需要重新部署客户端,长度不大于24
  • auth 选填,格式为 用户名:密码
    • 密码强烈建议使用hash加密
    • 格式为$算法$密文,例如$sha256$123456abcdefg
    • 支持的算法有:sha256sha512bcrypt
    • 如果不按照格式填写,将会被视为明文密码
  • log 选填,日志配置
    • level 选填,可选值:disable, fatal, error, warn, info, debug
    • path 选填,默认为./logs
    • days 选填,默认为7

特性

特性/OS Windows Linux MacOS
进程管理
结束进程
网络状态
文件浏览
文件传输
文件编辑
删除文件
代码高亮
屏幕监控
屏幕快照
系统信息
远程终端
* 关机
* 重启
* 注销
* 睡眠
* 休眠
* 锁屏
  • 空单元格代表目前暂未测试。
  • 星号代表该功能可能需要管理员或root权限才能使用。

截图

overview

terminal

desktop

procmgr

explorer

overview.cpu

explorer.editor


开发

注意

本项目由三个部分组成,你必须把它们都编译一下。

如果你不想陷入无止尽的安装、配置的过程,建议去 快速开始

  • 客户端
  • 服务端
  • 前端页面

如果要让客户端支持除了Linux和Windows之外的系统,你必须要安装对应的C交叉编译工具链。

例如,如果要给Android系统编译客户端,那就必须安装 Android NDK

指南

# Clone该项目。
$ git clone https://github.com/XZB-1248/Spark
$ cd ./Spark


# 开始编译前端页面。
$ cd ./web
# 安装所有的依赖,然后编译。
$ npm install
$ npm run build-prod


# 通过statik,将前端文件嵌入到服务端里。
$ cd ..
$ go install github.com/rakyll/statik
$ statik -m -src="https://github.com/XZB-1248/Spark/raw/v0.2.1/web/dist" -f -dest="./server/embed" -p web -ns web


# 开始编译客户端。
# 在使用类Unix系统时,运行以下命令。
$ mkdir ./built
$ go mod tidy
$ go mod download
$ ./scripts/build.client.sh


# 最终开始编译服务端。
$ mkdir ./releases
$ ./scripts/build.server.sh

另外新建一个目录,将releases目录中对应的服务端版本复制进去。

回到项目目录,把整个built目录复制到新建的目录中。

最后,把开头提到的配置文件也复制进去,即可运行服务端。


项目依赖

Spark使用了许多第三方的开源项目。

依赖列表可以在 go.modpackage.json 里面找到。

一些主要的依赖项如下列所示。

后端

前端

感谢

  • natpass (MIT License)
  • 图像差异算法部分参考了natpass项目的有关部分。

Star趋势

Stargazers over time


开源协议

本项目基于 BSD-2 协议

Extension points exported contracts — how you extend this code

UpsertCb (FuncType)
UpsertCb is callback to return new element to be inserted into the map It is called while lock is held, therefore it MUS
utils/cmap/concurrent_map.go
EventCallback (FuncType)
(no doc)
server/common/event.go
Sender (FuncType)
(no doc)
server/handler/utility/utility.go
RemoveCb (FuncType)
RemoveCb is a callback executed in a map.RemoveCb() call, while Lock is held If returns true, the element will be remove
utils/cmap/concurrent_map.go
IterCb (FuncType)
IterCb is iterator callback, called for every key,value found in maps. RLock is held for all calls for a given shard the
utils/cmap/concurrent_map.go

Core symbols most depended-on inside this repo

e
called by 244
web/public/ace.js
o
called by 121
web/public/ace.js
on
called by 89
web/src/vendors/zmodem.js/zsession.js
splice
called by 60
web/src/vendors/zmodem.js/zdle.js
Close
called by 55
utils/melody/melody.go
off
called by 52
web/src/vendors/zmodem.js/zsession.js
SendCallback
called by 48
client/common/common.go
Get
called by 46
utils/melody/session.go

Shape

Function 416
Method 232
Class 68
Struct 35
FuncType 10
TypeAlias 2

Languages

TypeScript52%
Go48%

Modules by API surface

web/src/vendors/zmodem.js/zsession.js95 symbols
web/src/vendors/zmodem.js/zheader.js60 symbols
web/public/ace.js48 symbols
utils/melody/melody.go35 symbols
web/src/vendors/zmodem.js/zsubpacket.js29 symbols
web/src/components/terminal/terminal.jsx29 symbols
utils/cmap/concurrent_map.go29 symbols
client/core/handler.go27 symbols
web/src/vendors/zmodem.js/zsentry.js18 symbols
web/src/utils/utils.js18 symbols
web/src/components/explorer/explorer.jsx18 symbols
utils/utils.go17 symbols

Dependencies from manifests, versioned

github.com/creack/ptyv1.1.18 · 1×
github.com/denisbrodbeck/machineidv1.0.1 · 1×
github.com/gen2brain/shmv0.0.0-2021051110595 · 1×
github.com/gin-contrib/ssev0.1.0 · 1×
github.com/go-ole/go-olev1.2.6 · 1×
github.com/go-playground/localesv0.13.0 · 1×
github.com/go-playground/universal-translatorv0.17.0 · 1×
github.com/hashicorp/errwrapv1.0.0 · 1×

For agents

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

⬇ download graph artifact