Modernize infrastructure and code#97
Open
SplittyDev wants to merge 20 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes hdrop’s deployment and runtime setup by introducing a production-focused Docker Compose stack (with Caddy reverse proxy), adding a Rust utility to generate production .env files, and tightening a number of web crypto typings and dependency versions.
Changes:
- Added
hdrop-env(Rust) to generate production.envfiles interactively or via flags. - Reworked Docker Compose: production-oriented
docker-compose.yml, addeddocker-compose.dev.yml, and introduced a Caddy reverse proxy + security headers. - Updated build/runtime dependencies and containers (Node base images, Rust crates), plus web crypto typing adjustments.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
hdrop-web-next/src/crypto/Sha256.ts |
Type assertion adjustment for WebCrypto digest input. |
hdrop-web-next/src/crypto/Pbkdf2.ts |
Switched env fallback logic to treat empty strings as “unset”. |
hdrop-web-next/src/crypto/CryptoHelper.ts |
Switched env fallback logic for byte-length env vars. |
hdrop-web-next/src/crypto/Base64.ts |
Updated decode return typing and slicing behavior. |
hdrop-web-next/src/crypto/AesGcm.ts |
Narrowed encrypt/decrypt input types; added BufferSource casts for params. |
hdrop-web-next/src/components/Header.tsx |
Env var fallback logic adjustment for app name. |
hdrop-web-next/src/app/favicon.ico |
Added favicon asset. |
hdrop-web-next/Dockerfile.development |
Bumped Node base image to 25-alpine. |
hdrop-web-next/Dockerfile |
Bumped Node base image to 25-alpine; normalized PATH env syntax. |
hdrop-server/src/server/hdrop_server.rs |
Adjusted route parameter syntax to {access_token}. |
hdrop-server/infra/entrypoint.sh |
Updated PM2 command to run installed server binary path. |
hdrop-server/Dockerfile |
Introduced multi-stage build; moved runtime to Alpine node image; copied compiled binaries. |
hdrop-env/src/main.rs |
New CLI tool to generate production .env with validation and tests. |
hdrop-env/Cargo.toml |
New crate manifest for hdrop-env. |
hdrop-db/Cargo.toml |
Updated sha3 dependency. |
docker-compose.yml |
Production compose stack with Caddy + env-driven configuration and volumes. |
docker-compose.dev.yml |
New dev-only compose file (localstack/postgres, ports exposed). |
caddy/Caddyfile |
New reverse proxy + security headers + upload size limit configuration. |
README.md |
Added production environment generation/deploy instructions. |
Cargo.toml |
Added hdrop-env to the Rust workspace. |
Cargo.lock |
Dependency lockfile updates due to new crate and upgrades. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
54cfc19 to
103b4fa
Compare
2336ea5 to
4520172
Compare
This was referenced Apr 25, 2026
Further harden api Dockerfile Create unprivileged user for api docker image Exclude keys and secrets from docker image builds Spawn services through init process and limit pids Setup log rotation and limiting for all services
0e8c248 to
3c0609a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernizes the current deployment flows.
Deployment
docker-compose.ymlwith caddy and health checkshdrop-envcli for interactive env file generation (includes non-interactive mode as well)docker-compose.ymltodocker-compose.dev.yml(to be phased out)Dockerfilewith a cleaner multi-stage build processContainer Hardening
General
init: trueto all services to spawn them through an init processread_only: trueto all services exceptpostgrescap_drop: [ALL]to all services exceptpostgres(caddy adds backNET_BIND_SERVICE)security_opt: [no-new-privileges:true]to all servicestmpfsentries to all services, withnoexec,nosuid,nodevcaddy:2-alpine,postgres:18-alpine,prom/prometheus:v3)dbandmetricsnetworks usinginternal: true.dockerignorefiles to include keys, secrets and package manager artifactscaddy
nonesame-originobject-src: noneandupgrade-insecure-requestsin CSPhdrop-server
node:25-alpinetoalpine:3.23Frontend
useEffectBackend
sha3dependency to 0.11 and addedhexcrate for digest formattingaxumroutes to use the new curly-brace format introduced in axum 0.8CI
actions/checkout@v6actions/setup-node@v6[20, 21]to[24, 25]