From 365ff10fd86a3b7483d35fe72cf9eb7d5ad20059 Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 15 Jun 2026 17:48:53 +0200 Subject: [PATCH 1/4] feat(docker): parametrize host ports and project name for parallel dev stacks Several isolated stacks can now coexist: host ports come from DB_PORT/RAUTHY_PORT/MAILCRAB_PORT (defaulting to today's values) and the container namespace from COMPOSE_PROJECT_NAME. Drops the fixed rauthy-dev container_name that blocked a second stack. --- docker-compose.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cbd2e9e..44db148 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,19 +12,21 @@ services: volumes: - postgres-data:/var/lib/postgresql ports: - - "5000:5432" + - "${DB_PORT:-5000}:5432" networks: - local mailcrab: image: marlonb/mailcrab:latest ports: - - "1080:1080" + - "${MAILCRAB_PORT:-1080}:1080" networks: - rauthy-dev rauthy: - container_name: rauthy-dev + # No fixed container_name — Compose derives it from COMPOSE_PROJECT_NAME so + # several isolated stacks coexist (e.g. mv--rauthy-1). A plain + # checkout gets -rauthy-1. image: ghcr.io/sebadob/rauthy:0.35.2 environment: - LOCAL_TEST=true @@ -32,7 +34,8 @@ services: - SMTP_PORT=1025 - SMTP_DANGER_INSECURE=true - LISTEN_SCHEME=http - - PUB_URL=localhost:8080 + # Advertised URL must match the host-mapped port below. + - PUB_URL=localhost:${RAUTHY_PORT:-8080} - BOOTSTRAP_ADMIN_PASSWORD_PLAIN=RauthyTest12345 # Disable strict IP validation to allow access from multiple Docker networks - SESSION_VALIDATE_IP=false @@ -40,7 +43,7 @@ services: # Re-runs after `docker compose down -v` because the DB is empty again. - BOOTSTRAP_DIR=/app/bootstrap ports: - - "8080:8080" + - "${RAUTHY_PORT:-8080}:8080" depends_on: - mailcrab - db -- 2.47.2 From 0a53e11cc4c1aa6192ad96187e019ee16e16a968 Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 15 Jun 2026 17:48:53 +0200 Subject: [PATCH 2/4] feat(config): read database host port from DB_PORT in dev and test --- config/dev.exs | 6 +++--- config/test.exs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/dev.exs b/config/dev.exs index 139b816..d96bd7e 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -5,7 +5,7 @@ config :mv, Mv.Repo, username: "postgres", password: "postgres", hostname: "localhost", - port: 5000, + port: String.to_integer(System.get_env("DB_PORT") || "5000"), database: "mv_dev", stacktrace: true, show_sensitive_data_on_connection_error: true, @@ -97,9 +97,9 @@ config :mv, :token_signing_secret, "IwUwi65TrEeExwBXXFPGm2I7889NsL" # do not set defaults here so the SSO button stays hidden and no MissingSecret occurs. # config :mv, :oidc, # client_id: "mv", -# base_url: "http://localhost:8080/auth/v1", +# base_url: "http://localhost:#{System.get_env("RAUTHY_PORT") || "8080"}/auth/v1", # client_secret: System.get_env("OIDC_CLIENT_SECRET"), -# redirect_uri: "http://localhost:4000/auth/user/oidc/callback" +# redirect_uri: "http://localhost:#{System.get_env("PORT") || "4000"}/auth/user/oidc/callback" # AshAuthentication development configuration config :mv, :session_identifier, :jti diff --git a/config/test.exs b/config/test.exs index 7343a6a..10ab4e8 100644 --- a/config/test.exs +++ b/config/test.exs @@ -9,7 +9,7 @@ config :mv, Mv.Repo, username: "postgres", password: "postgres", hostname: System.get_env("TEST_POSTGRES_HOST", "localhost"), - port: System.get_env("TEST_POSTGRES_PORT", "5000"), + port: System.get_env("TEST_POSTGRES_PORT") || System.get_env("DB_PORT") || "5000", database: "mv_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: System.schedulers_online() * 8, -- 2.47.2 From c332a4dde27ff9cefb241a3801d187e089f03bb9 Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 15 Jun 2026 17:48:53 +0200 Subject: [PATCH 3/4] feat(dialyzer): allow overriding PLT paths via PLT_CORE_PATH/PLT_LOCAL_PATH --- mix.exs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index b20572a..23e8a6f 100644 --- a/mix.exs +++ b/mix.exs @@ -117,8 +117,11 @@ defmodule Mv.MixProject do defp dialyzer do [ - plt_file: {:no_warn, "priv/plts/dialyzer.plt"}, - plt_core_path: "priv/plts/core.plt", + # PLT paths are overridable so the pipeline can point all worktrees/clones + # at a shared, machine-global PLT cache (avoids each rebuilding the PLT). + # Default to the in-repo priv/plts for a plain checkout. + plt_file: {:no_warn, System.get_env("PLT_LOCAL_PATH") || "priv/plts/dialyzer.plt"}, + plt_core_path: System.get_env("PLT_CORE_PATH") || "priv/plts/core.plt", plt_add_apps: [:mix, :ex_unit], flags: [ :error_handling, -- 2.47.2 From 2363ef69e3d8b10b4e367cf7fd99194091692b50 Mon Sep 17 00:00:00 2001 From: Moritz Date: Mon, 15 Jun 2026 17:48:53 +0200 Subject: [PATCH 4/4] feat(justfile): add start-test-db recipe for an isolated test database --- Justfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Justfile b/Justfile index 9b0be65..576b4f3 100644 --- a/Justfile +++ b/Justfile @@ -29,6 +29,9 @@ seed-database: start-database: docker compose up -d +start-test-db: + docker compose up -d db + # Full check suite: lint + audit + the fast tests (slow/ui excluded). No Dialyzer. ci-dev: install-dependencies lint audit test-fast -- 2.47.2