Compare commits

..

1 commit

Author SHA1 Message Date
6fe5b9635c Update Rust crate bcrypt to v0.19.1
All checks were successful
Build and Test / account (push) Successful in 7m51s
2026-05-06 09:45:26 +00:00
2 changed files with 49 additions and 29 deletions

35
Cargo.lock generated
View file

@ -223,7 +223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
dependencies = [
"cfg-if",
"cipher",
"cipher 0.4.4",
"cpufeatures 0.2.17",
]
@ -428,9 +428,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]]
name = "bcrypt"
version = "0.19.0"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523ab528ce3a7ada6597f8ccf5bd8d85ebe26d5edf311cad4d1d3cfb2d357ac6"
checksum = "24ae5479c93d3720e4c1dbd6b945b97457c50cb672781104768190371df1a905"
dependencies = [
"base64",
"blowfish",
@ -516,12 +516,12 @@ dependencies = [
[[package]]
name = "blowfish"
version = "0.9.1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7"
checksum = "62ce3946557b35e71d1bbe07ec385073ce9eda05043f95de134eb578fcf1a298"
dependencies = [
"byteorder",
"cipher",
"cipher 0.5.1",
]
[[package]]
@ -586,7 +586,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"
dependencies = [
"cipher",
"cipher 0.4.4",
]
[[package]]
@ -645,7 +645,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
dependencies = [
"crypto-common 0.1.6",
"inout",
"inout 0.1.4",
]
[[package]]
name = "cipher"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e34d8227fe1ba289043aeb13792056ff80fd6de1a9f49137a5f499de8e8c78ea"
dependencies = [
"crypto-common 0.2.1",
"inout 0.2.2",
]
[[package]]
@ -1974,6 +1984,15 @@ dependencies = [
"generic-array",
]
[[package]]
name = "inout"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4250ce6452e92010fdf7268ccc5d14faa80bb12fc741938534c58f16804e03c7"
dependencies = [
"hybrid-array",
]
[[package]]
name = "ipconfig"
version = "0.3.4"

View file

@ -1,32 +1,33 @@
# syntax=docker/dockerfile:1
FROM rust:alpine AS chef
RUN apk add --no-cache musl-dev lld g++ make perl openssl-dev openssl-libs-static protobuf-dev
RUN cargo install cargo-chef
FROM rust:alpine as builder
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static protobuf-dev lld perl make
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
COPY Cargo.toml Cargo.lock ./
COPY mii ./mii
RUN mkdir src && echo "fn main() {println!(\"dummy\");}" > src/main.rs
RUN OPENSSL_LIB_DIR=/usr/lib OPENSSL_INCLUDE_DIR=/usr/include/openssl OPENSSL_STATIC=1 RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --target x86_64-unknown-linux-musl --profile prod
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
COPY . .
RUN touch src/main.rs
ENV SQLX_OFFLINE=true
ENV RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld"
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo chef cook --profile prod --recipe-path recipe.json --target x86_64-unknown-linux-musl
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo build --profile prod --target x86_64-unknown-linux-musl && \
mkdir -p /app/dist && \
cp /app/target/x86_64-unknown-linux-musl/prod/account /app/dist/
RUN RUSTFLAGS="-C target-feature=+aes,+sse -C relocation-model=static -C linker=ld.lld" cargo build --profile prod --target x86_64-unknown-linux-musl
FROM scratch AS final
WORKDIR /
COPY --from=builder /app/dist/account /account
# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/x86_64-unknown-linux-musl/prod/account /account
COPY --from=builder /app/res /res
ENTRYPOINT ["/account"]
# Set executable permissions
# RUN chmod +x /account
# Command to run the application
ENTRYPOINT ["/account"]