From 69d908bac3f1eaf1f0bbe263377938971e015bc0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 14 Jun 2026 18:51:51 -0400 Subject: [PATCH] Update (#16) Reviewed-on: http://git.kundeng.us/phoenix/textsender_auth/pulls/16 --- .gitea/workflows/pr.yml | 68 +++++++++++++++++++++++++++++++++++ .gitea/workflows/workflow.yml | 13 +++---- Cargo.lock | 18 +++++----- Cargo.toml | 16 ++++----- Dockerfile | 2 +- 5 files changed, 90 insertions(+), 27 deletions(-) create mode 100644 .gitea/workflows/pr.yml diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml new file mode 100644 index 0000000..f6e6664 --- /dev/null +++ b/.gitea/workflows/pr.yml @@ -0,0 +1,68 @@ +name: Rust Build + +on: + pull_request: + branches: + - main + +jobs: + check: + name: Check + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.96 + - uses: Swatinem/rust-cache@v2 + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key + chmod 600 ~/.ssh/textsender-models_deploy_key + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts + + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/textsender-models_deploy_key + + cargo check + + + fmt: + name: Rustfmt + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.96 + - uses: Swatinem/rust-cache@v2 + - run: rustup component add rustfmt + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key + chmod 600 ~/.ssh/textsender-models_deploy_key + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts + + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/textsender-models_deploy_key + cargo fmt --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: 1.96 + - uses: Swatinem/rust-cache@v2 + - run: rustup component add clippy + - run: | + mkdir -p ~/.ssh + echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/textsender-models_deploy_key + chmod 600 ~/.ssh/textsender-models_deploy_key + ssh-keyscan ${{ secrets.MY_HOST }} >> ~/.ssh/known_hosts + + eval $(ssh-agent -s) + ssh-add -v ~/.ssh/textsender-models_deploy_key + cargo clippy -- -D warnings diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index cdaa66d..0e27b5f 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: check: @@ -16,7 +13,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96 - uses: Swatinem/rust-cache@v2 - run: | mkdir -p ~/.ssh @@ -53,7 +50,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96 - uses: Swatinem/rust-cache@v2 # --- Add this step for explicit verification --- - name: Verify Docker Environment @@ -96,7 +93,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96 - uses: Swatinem/rust-cache@v2 - run: rustup component add rustfmt - run: | @@ -116,7 +113,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96 - uses: Swatinem/rust-cache@v2 - run: rustup component add clippy - run: | @@ -136,7 +133,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.95 + toolchain: 1.96 - uses: Swatinem/rust-cache@v2 - run: | mkdir -p ~/.ssh diff --git a/Cargo.lock b/Cargo.lock index 8b0b146..1e52b61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -469,7 +469,6 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ - "powerfmt", "serde_core", ] @@ -2239,8 +2238,8 @@ dependencies = [ [[package]] name = "textsender_models" -version = "0.3.3" -source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.3.3#c09fa36b15601b37f65b8baac0d479c30d2c1e44" +version = "0.4.0" +source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.4.0#2722af5589023db819554a97c1f596d9e735fe96" dependencies = [ "const_format", "dotenvy", @@ -2283,12 +2282,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.47" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "711a53c2d47bbd818258c498c8dbfe186a2526c631495cfe7e078567f86b8469" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", "serde_core", @@ -2298,15 +2296,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "71c652a3727a9cbb9a02f707f530b618ce00d0ccd762009c8c23bd191df3c17d" dependencies = [ "num-conv", "time-core", diff --git a/Cargo.toml b/Cargo.toml index bf98d97..d45a600 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,26 +2,26 @@ name = "textsender_auth" version = "0.1.23" edition = "2024" -rust-version = "1.95" +rust-version = "1.96" [dependencies] axum = { version = "0.8.9" } serde = { version = "1.0.228", features = ["derive"] } -serde_json = { version = "1.0.149" } -tokio = { version = "1.52.2", features = ["rt-multi-thread"] } +serde_json = { version = "1.0.150" } +tokio = { version = "1.52.3", features = ["rt-multi-thread"] } tracing-subscriber = { version = "0.3.23" } tower = { version = "0.5.3", features = ["full"] } -tower-http = { version = "0.6.10", features = ["cors"] } -hyper = { version = "1.9.0" } +tower-http = { version = "0.6.11", features = ["cors"] } +hyper = { version = "1.10.1" } sqlx = { version = "0.8.6", features = ["postgres", "runtime-tokio-native-tls", "time", "uuid"] } -uuid = { version = "1.23.1", features = ["v4", "serde"] } +uuid = { version = "1.23.3", features = ["v4", "serde"] } argon2 = { version = "0.5.3", features = ["std"] } # Use the latest 0.5.x version rand = { version = "0.10.1" } -time = { version = "0.3.47", features = ["macros", "serde"] } +time = { version = "0.3.49", features = ["macros", "serde"] } josekit = { version = "0.10.3" } utoipa = { version = "5.5.0", features = ["axum_extras"] } utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } -textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.3.3" } +textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.4.0", features = ["config", "user"] } [dev-dependencies] http-body-util = { version = "0.1.3" } diff --git a/Dockerfile b/Dockerfile index 1cd620e..5683cce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Stage 1: Build the application # Use a specific Rust version for reproducibility. Choose one that matches your development environment. # Using slim variant for smaller base image -FROM rust:1.95 as builder +FROM rust:1.96 as builder # Set the working directory inside the container WORKDIR /usr/src/app