Repository navigation
Conversation
ehfd
force-pushed
the
socket-cookie-auth
branch
from
November 14, 2026 13:11
8aa5a1a to
62b0ccb
Compare
Member
|
We are dropping nginx soon and serving selkies directly see dev branch for reference |
Author
|
Good. |
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.
I have read the contributing guideline and understand that I have made the correct modifications
An LLM assisted me in writing the code or text for this PR
An LLM agent wrote the code or text for this PR
Description:
With
PASSWORDset, nginx'sauth_basicguards every location. WebKit (Safari, Epiphany, GNOME Web) does not send the Basic credentials on a WebSocket handshake, so the page loads but the stream socket is answered 401 and the client loops on "WebSocket disconnected. Attempting to reconnect...". Chromium and Firefox send them and stream.When
PASSWORDis set, the page and pelorus locations now set anlsio_socketcookie (HttpOnly, SameSite=Strict, Secure on the 3001 block, path theSUBFOLDER) holding a random keyinit-nginxgenerates at start, and the api and pelorus locations take either the Basic login or that cookie (satisfy anywith anauth_requestto an internal location that compares it). The cookie is only set on a response that already passedauth_basic, so it authenticates nothing a Basic login could not. The new lines are commented like the existingauth_basicones, so withoutPASSWORDthe config is as before.The hunks apply unchanged to
ubunturesolute,alpine324,arch,fedora44,kalianddev;ubuntunoble,alpine323,fedora42,fedora43andel9differ at the api location. Every current variant's nginx (1.26 to 1.30) carrieshttp_auth_request_module.Benefits of this PR and context:
Safari users of any image behind
PASSWORDget a black screen today. Selkies itself has the same fix for its own Basic login (selkies-project/selkies@d73346ea2, a signedselkies_socketcookie), but in these images nginx answers the handshake before it reaches Selkies, so it has to be done here.How Has This Been Tested?
lscr.io/linuxserver/baseimage-selkies:debiantrixiewithPASSWORD=test, stock and with the two changed files mounted, Playwright 1.55 (Chromium, Firefox, WebKit) logging in with HTTP credentials:Secure) and underSUBFOLDER=/desk/on both (cookiePath=/desk/)./api/websockets, patched: no credentials 401, wrong password 401, wrong cookie 401, Basic 101, the cookie alone 101 (stock: 401 for the cookie alone).PASSWORD, patched:nginx -tpasses, no new line is active, the page and the socket answer 200 and 101 without a login, and no cookie is set.Source / References:
selkies-project/selkies@d73346ea2 (the same mechanism in Selkies for its own Basic login).