fix(config): declare kura backend in release configs#55
Merged
Conversation
kura v2 resolves a repo's pool module from its {backend, _} key. The
release configs baked into the published asobi_lua image lost this key
in the v2 bump, so self-host startup crashes with
{no_pool_module_configured, asobi_repo} before Postgres is ever dialed.
Add {backend, kura_backend_postgres} to dev + prod, plus a guard test
that parses the release configs and asserts the kura repo declares a
resolvable backend. CI only boots the dev config, so prod-config drift
shipped silently.
GHSA-jfc2-q6qh-g5x8 (HIGH, multipart header buffer accumulation) hits cowboy versions >= 2.0.0, < 2.15.0. asobi_lua was inheriting the stale 2.13.0 pin transitively. Direct-pin cowboy 2.15.0 plus the standard cowlib/ranch override so rebar3 can resolve the package's "and"-syntax dep declarations. rebar3 audit -i GHSA-g2wm-735q-3f56 now reports 0 vulnerabilities (was 1: cowboy 2.13.0 HIGH).
The per-app cowboy override was the wrong layer (and its audit-ignores broke CI: this repo's erlang-ci pin predates the audit-ignores input). cowboy/cowlib are owned by nova; bumping nova to 0.14.3 (widgrensit/asobi#130) brings cowboy 2.15.0 + cowlib 2.17.1 transitively. This PR is now the pure kura backend config fix; cowboy lands once #130 is on asobi main and this re-locks.
Picks up the asobi main bump (widgrensit/asobi#130). cowboy 2.15.0 closes GHSA-jfc2-q6qh-g5x8; cowlib 2.17.1 clears GHSA-g2wm-735q-3f56. rebar3 audit reports 0 vulnerabilities with no ignores.
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.
Problem
Self-host users following https://asobi.dev/docs/self-host pull
ghcr.io/widgrensit/asobi_lua:latestand the container crashes on startup:Postgres stays up and idle because asobi never gets far enough to dial it.
Root cause
kura v2 (adopted in the kura v2 bump) resolves a repo's pool/driver module from its
{backend, _}key viakura_app:resolve_backends/0. The release configs baked into the published image lost that key, so kura never setspool_moduleandkura_db:get_pool_module/1errors.CI is green because it boots the dev config; the bug only existed in the configs baked into the release image.
Fix
{backend, kura_backend_postgres}toconfig/prod_sys.config.srcandconfig/dev_sys.config.src(resolves topool_module => kura_pool_pgo,dialect => kura_dialect_pg).asobi_lua_release_config_tests— parses the release configs and asserts the kura repo declares a resolvable backend, closing the gap where prod-config drift shipped without any test exercising it.After merge the
asobi_lua:latestimage must be republished sodocker compose pullpicks up the fix.