feat: generate PASSWORD_HASH on the fly

* remove PASSWORD environment variable in favor of PASSWORD_HASH
* enhance password validity check server function
* update Dockerfile to include building a binary for generating hashed password
* update README with comprehensive Docker usage instructions hash generation
This commit is contained in:
tetuaoro 2024-07-12 19:22:15 +02:00
parent 62ea932d33
commit 9a19430dc8
10 changed files with 458 additions and 12 deletions

View file

@ -1,3 +1,12 @@
# Build wg-password binary using Rust on Alpine
FROM rust:1.79.0-alpine AS build_password_binary
WORKDIR /wg-password
COPY wg-password .
# Build the Rust project
RUN cargo build --release
# As a workaround we have to build on nodejs 18
# nodejs 20 hangs on build with armv6/armv7
FROM docker.io/library/node:18-alpine AS build_node_modules
@ -26,6 +35,9 @@ COPY --from=build_node_modules /app /app
# than what runs inside of docker.
COPY --from=build_node_modules /node_modules /node_modules
# Copy the compiled password binary from the build stage to /bin/
COPY --from=build_password_binary /wg-password/target/release/wgpw /bin/
# Install Linux packages
RUN apk add --no-cache \
dpkg \