The @session_options module attribute used Application.compile_env, which baked compile-time placeholders into the endpoint while runtime.exs set the real values from SESSION_SIGNING_SALT / SESSION_ENCRYPTION_SALT env vars. Phoenix detected the mismatch and refused to start (failing migrate Job in k8s). - Remove hardcoded salts from config/config.exs (no compile-time binding) - Add stable per-env salts in dev.exs / test.exs so local + CI don't need the env vars - Split static cookie opts (@static_session_options) from runtime-resolved opts in endpoint.ex; expose session_options/0 as an MFA tuple in socket connect_info so LiveView decodes sessions with the same runtime salts - New ToweropsWeb.Plugs.RuntimeSession wraps Plug.Session, fetches salts from app env on first request, and caches the initialized opts in :persistent_term (zero per-request overhead after warm-up) |
||
|---|---|---|
| .. | ||
| channels | ||
| components | ||
| controllers | ||
| graphql | ||
| helpers | ||
| live | ||
| plugs | ||
| changelog_parser.ex | ||
| endpoint.ex | ||
| gettext.ex | ||
| gettext_helpers.ex | ||
| graphql_socket.ex | ||
| permissions.ex | ||
| plug_exceptions.ex | ||
| remote_ip.ex | ||
| router.ex | ||
| scoped_resource.ex | ||
| telemetry.ex | ||
| telemetry_filter.ex | ||
| user_auth.ex | ||