Skip to content

Commit

Permalink
Merge pull request #63 from chenx-dust/main
Browse files Browse the repository at this point in the history
feat: Switch to Mihomo
  • Loading branch information
YukiCoco authored Apr 24, 2024
2 parents 67f33d4 + 371016a commit b64e06d
Show file tree
Hide file tree
Showing 17 changed files with 962 additions and 403 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,30 @@ jobs:
linux_amd64:
name: Linux AMD64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
#build tomoon start
- uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: download asset files
run: wget https://github.com/YukiCoco/ToMoon/releases/download/build/build_assets.zip
- run: unzip -n build_assets.zip -d tmp/
- name: Download Clash and Yacd
run: |
mkdir tmp && cd tmp
mkdir core && cd core
# Mihomo (Clash Meta)
wget -O clash.gz https://github.com/MetaCubeX/mihomo/releases/download/v1.18.3/mihomo-linux-amd64-v1.18.3.gz
gzip -d clash.gz
# country.mmdb & geosite.dat
wget https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb
wget https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat
wget -O asn.mmdb https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb
# yacd
wget -O yacd.zip https://github.com/MetaCubeX/yacd/archive/gh-pages.zip
unzip yacd.zip
mv Yacd-meta-gh-pages web
# build front-end start
- uses: actions/setup-node@v3
with:
Expand All @@ -27,7 +42,7 @@ jobs:
version: 7.12.2
- name: Install Requestment
run: |
cp -r tmp/usdpl src/
cp -r usdpl src/
pnpm i
- name: build front end
run: pnpm run build
Expand All @@ -40,13 +55,12 @@ jobs:
# build front-end end
# build backend start
- uses: dtolnay/rust-toolchain@stable
- uses: ClementTsang/[email protected].2
- uses: ClementTsang/[email protected].6
with:
command: build
directory: ./backend
args: --target x86_64-unknown-linux-gnu --release
use-cross: true
cross-version: 0.2.4
use-cross: false
# build backend end
#build tomoon stop
#output: # ToMoon/backend/target/x86_64-unknown-linux-gnu/release/tomoon
Expand All @@ -65,7 +79,7 @@ jobs:
# with:
# node-version: 16
# - run: pnpm run build
- name: colect files
- name: collect files
run: |
mkdir -p ./release/tomoon/bin/core/web
mkdir -p ./release/tomoon/dist
Expand All @@ -75,7 +89,6 @@ jobs:
cp plugin.json ./release/tomoon/plugin.json
cp package.json ./release/tomoon/package.json
cp -r ./tmp/core ./release/tomoon/bin/
cp -r ./tmp/smartdns ./release/tomoon/bin/
cp -r ./tomoon-web/dist ./release/tomoon/web
cp -r ./py_modules ./release/tomoon/py_modules
cd ./release
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
## 功能
**使用 ToMoon,让您在恶劣的网络环境下可以打开任何界面,体验到完整的 Steam Deck**
1. 提供开箱即用的 Clash SteamOS 客户端,由 Rust 驱动
2. 自动配置 DNS,使用 [SmartDNS](https://pymumu.github.io/smartdns/) 作为 DNS 上游,基于分流规则绕过 DNS 污染
3. 自动配置 FAKE-IP 模式,让游戏流量通过 TCP / UDP 加速
4. 基于 [yacd](https://github.com/haishanh/yacd) 的策略管理仪表盘
2. 自动配置 FAKE-IP 模式,让游戏流量通过 TCP / UDP 加速
3. 基于 [yacd](https://github.com/MetaCubeX/Yacd-meta) 的策略管理仪表盘

## 安装
如果已经安装过 Plugin Loader 2.0 以上版本,直接从第 8 点开始即可。
Expand Down
7 changes: 3 additions & 4 deletions backend/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn set_clash_status(runtime: &ControlRuntime) -> impl Fn(Vec<Primitive>) ->
}
}
if *enabled {
match clash.run(&settings.current_sub, settings.skip_proxy) {
match clash.run(&settings.current_sub, settings.skip_proxy, settings.override_dns) {
Ok(_) => (),
Err(e) => {
log::error!("Run clash error: {}", e);
Expand Down Expand Up @@ -560,9 +560,8 @@ pub fn create_debug_log() -> impl Fn(Vec<Primitive>) -> Vec<Primitive> {
//let update_status = runtime.update_status_clone();
move |_| {
let running_status = format!(
"Clash status : {}, SmartDNS status: {} \n",
helper::is_clash_running(),
helper::is_samrtdns_running()
"Clash status : {}\n",
helper::is_clash_running()
);
let tomoon_config = match fs::read_to_string("/home/deck/.config/tomoon/tomoon.json") {
Ok(x) => x,
Expand Down
Loading

0 comments on commit b64e06d

Please sign in to comment.