fix(xrdb): update the app for XRDB v3 - #114
Open
IbbyLabs wants to merge 1 commit into
Open
Conversation
The image listens on 8787 and stores data in /data. Replaces the v2 variables with XRDB's own env.template, and rewrites the Authelia rules for v3's routes with the admin API protected above the bypass.
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.
We added the
xrdbapp in #97 and maintained it for about ten days (#101, then a data-directory fix on 20 May). XRDB was rewritten after that and we did not come back to it, so the app here still describes v2 while:latesthas served v3 since the rewrite. Everything below is ours rather than something wrong with the template.A fresh deploy does not come up:
Traefik gets a connection refused, so the route 502s. If it did start, saved profiles would be written into an anonymous volume rather than the mounted data directory.
compose.yaml — the image sets
XRDB_ADDR=:8787,XRDB_DB=/data/xrdb.dbandVOLUME ["/data"], so the port moves to 8787 and the volume to/data. ThePORTandXRDB_DB_PATHenvironment entries are dropped; v3 reads neither.XRDB_IMAGE_TAGis unchanged..env — 14 of the documented variables do not exist in v3. Replaced with XRDB's own
env.template, so it stays in step with the image rather than drifting again, with a short header for the two values this repo owns (XRDB_IMAGE_TAG,DOCKER_NETWORK_EXTERNAL). It also opens with the v2 to v3 rename table, which is what someone updating an existing deployment needs.Authelia — the bypass list is rewritten for v3's routes, and a
two_factorrule for^/api/admin(/.*)?$goes above it, following the ordering the Stremio addon rules already use at the top of the file.The admin rule matters because
XRDB_ADMIN_KEYis unset by default, and while it is unset part of/api/adminhas no second gate.DELETE /api/admin/cacheis the sharp one: it drops every rendered image. The old^/api(/.*)?$line covered it.Going the other way, v3's Stremio addon lives under
/stremioand was not bypassed, so Stremio could not fetch the manifest./healthzand/readyzwere not bypassed either./proxyand/previewwere, and are not routes in v3.The RPDB-compatible routes are anchored on the literal second segment rather than matching any first segment, so they cannot reach
/api/.Checked
Patterns parsed back out of the edited file and run against real request paths, including query strings, since Authelia matches
resourcesagainst path and query:I have not deployed the template itself, so the compose and env changes are checked against the image's
Dockerfileand XRDB'senv.templaterather than by bringing the stack up.I work on XRDB, so treat the route list as first-hand and the template conventions as my best reading of the surrounding file. Happy to reshape it if it does not match how you would rather have it.
— Milo#5574