diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9851a32..0af0061 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,9 +52,6 @@ jobs: name: Release needs: [build-api, build-agent] runs-on: ubuntu-latest - strategy: - matrix: - os: [ubuntu-20.04, ubuntu-22.04] steps: - name: Checkout uses: actions/checkout@v1 @@ -70,8 +67,14 @@ jobs: - name: Install protobuf-compiler run: sudo apt-get install -y protobuf-compiler - - name: Build - run: cargo build --all --release --features agent,api + - name: Install musl-tools + run: sudo apt-get update && sudo apt-get install -y musl-tools + + - name: Add musl target + run: rustup target add x86_64-unknown-linux-musl + + - name: Build statically linked binary + run: cargo build --release --target x86_64-unknown-linux-musl - name: Get architecture id: arch @@ -79,8 +82,8 @@ jobs: - name: Rename binaries with architecture run: | - mv target/release/api target/release/api-${{ env.ARCH }}-${{ matrix.os }} - mv target/release/agent target/release/agent-${{ env.ARCH }}-${{ matrix.os }} + mv target/release/api target/release/api-${{ env.ARCH }} + mv target/release/agent target/release/agent-${{ env.ARCH }} - name: Release uses: softprops/action-gh-release@v1 diff --git a/Cargo.lock b/Cargo.lock index 008f7f3..72e3be2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1877,7 +1877,7 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "pony" -version = "0.0.7-dev" +version = "0.0.8-dev" dependencies = [ "base64 0.22.1", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 6e8028b..aa8b017 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pony" -version = "0.0.7-dev" +version = "0.0.8-dev" edition = "2021" build = "build.rs" diff --git a/deploy/install b/deploy/install index 893a539..2dd5b28 100755 --- a/deploy/install +++ b/deploy/install @@ -36,6 +36,7 @@ PG_DB="${PG_DB:-postgres}" PG_USERNAME="${PG_USERNAME:-postgres}" PG_PASSWORD="${PG_PASSWORD:-password}" API_ENDPOINT=${API_ENDPOINT:-http://localhost:3005} +API_TOKEN=${API_TOKEN:-mysecrettoken} mkdir -p "$INSTALL_DIR" cd "$INSTALL_DIR" @@ -65,6 +66,7 @@ systemctl daemon-reload systemctl enable xray echo "Installing agent version $PONY_VERSION..." +echo "$AGENT_URL" curl -L -o agent "$AGENT_URL" chmod +x agent @@ -363,6 +365,7 @@ password = "${PG_PASSWORD}" [api] endpoint = "$API_ENDPOINT" +token="$API_TOKEN" EOF fi diff --git a/src/bin/agent.rs b/src/bin/agent.rs index a2f0e0b..4916d25 100644 --- a/src/bin/agent.rs +++ b/src/bin/agent.rs @@ -30,7 +30,7 @@ use pony::{ #[derive(Parser)] #[command( - version = "0.0.7-dev", + version = "0.0.8-dev", about = "Pony Agent - control tool for Xray/Wireguard" )] struct Cli { diff --git a/src/bin/api.rs b/src/bin/api.rs index b3f03b5..ffab870 100644 --- a/src/bin/api.rs +++ b/src/bin/api.rs @@ -20,7 +20,7 @@ use pony::{ #[derive(Parser)] #[command( - version = "0.0.7-dev", + version = "0.0.8-dev", about = "Pony Api - control tool for Xray/Wireguard" )] struct Cli {