WishMeLz

生活其实很有趣

使用 github action 编译自定义 rustdesk 客户端指南(内置自己的服务器信息、内置固定密码、内置自定义 api 服务器)

前期准备

rustdeskhbb_common下载下来,建同名仓库,仓库选择私有(因为代码中放了一些密钥信息)
https://github.com/rustdesk/rustdesk
https://github.com/rustdesk/hbb_common

申请一个github 的 token
2025-06-21T16:25:42.png

1、修改 hbb_common 仓库中的内容

在文件 src/config.rs 下修改

将字段RENDEZVOUS_SERVERS RS_PUB_KEY 改为自己的地址

2025-06-21T15:49:17.png

将字段 HARD_SETTINGS 改为如下

pub static ref HARD_SETTINGS: RwLock<HashMap<String, String>> = {
        let mut map = HashMap::new();
        map.insert("password".to_string(), "这是密码".to_string());
        RwLock::new(map)
};

2025-06-21T15:50:52.png

将以上修改 push 即可

2、修改 rustdesk 仓库中的内容

删除libs/hbb_common文件夹,添加上面自己修改过的 hbb_common 子模块

git submodule add https://github.com/WishMelz/hbb_common libs/hbb_common
git submodule sync

2025-06-21T16:07:18.png

查找到 rustdesk 仓库中 src/common.rs 文件的 get_custom_rendezvous_server 这个函数,下面有个官方的 api 地址,将其替换成自己的

修改几个脚本文件的权限

git update-index --chmod=+x ./flutter/build_android_deps.sh
git update-index --chmod=+x ./build.py
git update-index --chmod=+x ./flutter/build_android.sh
git update-index --chmod=+x ./flutter/build_fdroid.sh

2025-06-21T16:36:43.png

由于是私有仓库,所以需要设置token,因为Actions获取不到仓库内容
2025-06-21T16:27:26.png

全局搜索 actions/checkout@v4,会有很多个,每个地址都加上
添加一行:token: ghp_WzxczxcfsdfsdfLNUry30IUGW (ghp_就是你的github token)
2025-06-21T16:29:05.png

3、github 操作

找到 Settings → Actions → General,确保勾选 Allow all actions and reusable workflowsRead and write permissions 两项

编译有两种,tag/分支
1、tag

git tag -a TagName -m "message"
git push --tags

2、分支
直接main分支即可
2025-06-21T16:34:50.png


转至:https://linux.do/t/topic/742121 优化了其中 Actions 编译的问题