From 2f013f5e9c1df58af5b29337dddeae20d6bafdd5 Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:36:18 +0800 Subject: [PATCH] rename exe to overtls-bin make rust compiler happy --- .github/workflows/mips-unknown-linux-gnu.yml | 2 +- .github/workflows/release.yml | 6 +++--- Cargo.toml | 4 ++++ Dockerfile | 2 +- docker/run.sh | 2 +- install/overtls-install-musl.sh | 4 ++-- install/overtls-install-selfsign.sh | 4 ++-- install/overtls-install.sh | 4 ++-- readme-cn.md | 6 +++--- readme.md | 6 +++--- src/bin/{overtls.rs => main.rs} | 0 11 files changed, 22 insertions(+), 18 deletions(-) rename src/bin/{overtls.rs => main.rs} (100%) diff --git a/.github/workflows/mips-unknown-linux-gnu.yml b/.github/workflows/mips-unknown-linux-gnu.yml index bf8bddf..6527043 100644 --- a/.github/workflows/mips-unknown-linux-gnu.yml +++ b/.github/workflows/mips-unknown-linux-gnu.yml @@ -33,7 +33,7 @@ jobs: run: | ./.github/workflows/mips-unknown-linux-gnu.sh cbindgen -c cbindgen.toml -l C --cpp-compat -o ./overtls.h - zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls ./config.json ./overtls.h target/${{ matrix.target }}/release/libovertls.so + zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls-bin ./config.json ./overtls.h target/${{ matrix.target }}/release/libovertls.so - name: Upload uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0850a29..9423a53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,9 +69,9 @@ jobs: fi cbindgen -c cbindgen.toml -l C --cpp-compat -o ./overtls.h if [[ "${{ matrix.host_os }}" == "windows-latest" ]]; then - powershell Compress-Archive -Path target/${{ matrix.target }}/release/overtls.exe, ./config.json, ./overtls.h, target/${{ matrix.target }}/release/overtls.dll -DestinationPath release/overtls-${{ matrix.target }}.zip + powershell Compress-Archive -Path target/${{ matrix.target }}/release/overtls-bin.exe, ./config.json, ./overtls.h, target/${{ matrix.target }}/release/overtls.dll -DestinationPath release/overtls-${{ matrix.target }}.zip elif [[ "${{ matrix.host_os }}" == "macos-latest" ]]; then - zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls ./config.json ./overtls.h target/${{ matrix.target }}/release/libovertls.dylib + zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls-bin ./config.json ./overtls.h target/${{ matrix.target }}/release/libovertls.dylib if [[ "${{ matrix.target }}" == "x86_64-apple-darwin" ]]; then ./build-aarch64-apple-ios.sh zip -r release/overtls-aarch64-apple-ios-xcframework.zip ./overtls.xcframework/ @@ -79,7 +79,7 @@ jobs: zip -r release/overtls-apple-xcframework.zip ./overtls.xcframework/ fi elif [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then - zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls ./config.json ./overtls.h target/${{ matrix.target }}/release/libovertls.so + zip -j release/overtls-${{ matrix.target }}.zip target/${{ matrix.target }}/release/overtls-bin ./config.json ./overtls.h target/${{ matrix.target }}/release/libovertls.so fi if [[ "${{ matrix.target }}" == "x86_64-unknown-linux-gnu" ]]; then diff --git a/Cargo.toml b/Cargo.toml index b8ce82a..af3ecd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,10 @@ rust-version = "1.80" [lib] crate-type = ["staticlib", "cdylib", "lib"] +[[bin]] +name = "overtls-bin" +path = "src/bin/main.rs" + [dependencies] async-shared-timeout = "0.2" base64 = "0.22" diff --git a/Dockerfile b/Dockerfile index 1c84450..e3f1e72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN git clone https://github.com/shadowsocksr-live/overtls.git && \ ENV CONFIG=/app/config.json -CMD bash /app/overtls -r server -c ${CONFIG} +CMD bash /app/overtls-bin -r server -c ${CONFIG} diff --git a/docker/run.sh b/docker/run.sh index cb2ae60..3e42851 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -126,4 +126,4 @@ EOF echolog "开始启动-----------------------------" echolog "使用的tunnel_path=$TUNNEL_PATH-------" checkssl && initIndex && initConfig && nginx && \ -cd /default && chmod +x ./overtls && ./overtls -v $OVERTLS_LOG_LEVEL -r server -c config.json +cd /default && chmod +x ./overtls-bin && ./overtls-bin -v $OVERTLS_LOG_LEVEL -r server -c config.json diff --git a/install/overtls-install-musl.sh b/install/overtls-install-musl.sh index 510a91c..096effb 100755 --- a/install/overtls-install-musl.sh +++ b/install/overtls-install-musl.sh @@ -62,8 +62,8 @@ nginx_conf_dir="/etc/nginx/conf.d" nginx_conf_file="${nginx_conf_dir}/overtls.conf" site_dir="/fakesite" site_cert_dir="/fakesite_cert" -target_bin_path="/usr/local/bin/overtls" -bin_name=overtls +target_bin_path="/usr/local/bin/overtls-bin" +bin_name=overtls-bin INSTALL_CMD="apt" diff --git a/install/overtls-install-selfsign.sh b/install/overtls-install-selfsign.sh index 16b19f4..08d97cb 100755 --- a/install/overtls-install-selfsign.sh +++ b/install/overtls-install-selfsign.sh @@ -66,8 +66,8 @@ nginx_conf_dir="/etc/nginx/conf.d" nginx_conf_file="${nginx_conf_dir}/overtls.conf" site_dir="/fakesite" site_cert_dir="/fakesite_cert" -target_bin_path="/usr/local/bin/overtls" -bin_name=overtls +target_bin_path="/usr/local/bin/overtls-bin" +bin_name=overtls-bin INSTALL_CMD="apt" diff --git a/install/overtls-install.sh b/install/overtls-install.sh index ff2f772..e109b0d 100755 --- a/install/overtls-install.sh +++ b/install/overtls-install.sh @@ -67,8 +67,8 @@ nginx_conf_dir="/etc/nginx/conf.d" nginx_conf_file="${nginx_conf_dir}/overtls.conf" site_dir="/fakesite" site_cert_dir="/fakesite_cert" -target_bin_path="/usr/bin/overtls" -bin_name=overtls +target_bin_path="/usr/bin/overtls-bin" +bin_name=overtls-bin INSTALL_CMD="apt" diff --git a/readme-cn.md b/readme-cn.md index f551d56..0454b6a 100644 --- a/readme-cn.md +++ b/readme-cn.md @@ -57,7 +57,7 @@ cargo install overtls git clone https://github.com/shadowsocksr-live/overtls.git cd overtls cargo build --release -sudo cp target/release/overtls /usr/local/bin/ +sudo cp target/release/overtls-bin /usr/local/bin/ ``` ### 服務端一鍵安裝腳本 @@ -80,13 +80,13 @@ sudo systemctl start overtls ### 服務端 ```bash -overtls -r server -c config.json +overtls-bin -r server -c config.json ``` ### 客戶端 ```bash -overtls -r client -c config.json +overtls-bin -r client -c config.json ``` 如果想查看日志信息,你可以在你当前的工作目录 (`pwd`) 里创建文件 `.env` 写入这些内容 `RUST_LOG=overtls=trace` 即可. diff --git a/readme.md b/readme.md index d592fc5..21ce26d 100644 --- a/readme.md +++ b/readme.md @@ -72,7 +72,7 @@ programming language environment first, and then run the following commands to c git clone https://github.com/shadowsocksr-live/overtls.git cd overtls cargo build --release -sudo cp target/release/overtls /usr/local/bin/ +sudo cp target/release/overtls-bin /usr/local/bin/ ``` ## Server-side one-click installation script @@ -97,12 +97,12 @@ sudo systemctl start overtls ### Server ```bash -overtls -r server -c config.json +overtls-bin -r server -c config.json ``` ### Client ```bash -overtls -r client -c config.json +overtls-bin -r client -c config.json ``` If you want to see log info, you can create a `.env` file in current dir (`pwd`) diff --git a/src/bin/overtls.rs b/src/bin/main.rs similarity index 100% rename from src/bin/overtls.rs rename to src/bin/main.rs