From 62b0ccbf7b04042fd54928fc4e799cdefca0ab76 Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Wed, 4 Nov 2026 11:19:22 +0900 Subject: [PATCH] Let WebKit open the stream behind the PASSWORD login --- root/defaults/default.conf | 26 ++++++++++++++++++++++ root/etc/s6-overlay/s6-rc.d/init-nginx/run | 1 + 2 files changed, 27 insertions(+) diff --git a/root/defaults/default.conf b/root/defaults/default.conf index 4290d3ea..e4c66545 100644 --- a/root/defaults/default.conf +++ b/root/defaults/default.conf @@ -4,6 +4,7 @@ server { listen 3000 default_server; listen [::]:3000 default_server; location SUBFOLDER { + #add_header Set-Cookie "lsio_socket=SOCKETKEY; Path=SUBFOLDER; HttpOnly; SameSite=Strict" always; alias /usr/share/selkies/web/; index index.html index.htm; try_files $uri $uri/ =404; @@ -24,6 +25,8 @@ server { proxy_pass http://127.0.0.1:5173; } location SUBFOLDERapi { + #satisfy any; + #auth_request /lsio-socket-auth; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; @@ -40,6 +43,9 @@ server { proxy_pass http://127.0.0.1:CWS; } location SUBFOLDERpelorus/ { + #satisfy any; + #auth_request /lsio-socket-auth; + #add_header Set-Cookie "lsio_socket=SOCKETKEY; Path=SUBFOLDER; HttpOnly; SameSite=Strict" always; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; @@ -54,6 +60,13 @@ server { client_max_body_size 10M; proxy_pass http://127.0.0.1:5100/; } + #location = /lsio-socket-auth { + # internal; + # if ($cookie_lsio_socket = "SOCKETKEY") { + # return 204; + # } + # return 401; + #} error_page 500 502 503 504 /50x.html; location = SUBFOLDER50x.html { root /usr/share/selkies/web/; @@ -68,6 +81,7 @@ server { ssl_certificate /config/ssl/cert.pem; ssl_certificate_key /config/ssl/cert.key; location SUBFOLDER { + #add_header Set-Cookie "lsio_socket=SOCKETKEY; Path=SUBFOLDER; HttpOnly; SameSite=Strict; Secure" always; alias /usr/share/selkies/web/; index index.html index.htm; try_files $uri $uri/ =404; @@ -88,6 +102,8 @@ server { proxy_pass http://127.0.0.1:5173; } location SUBFOLDERapi { + #satisfy any; + #auth_request /lsio-socket-auth; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; @@ -104,6 +120,9 @@ server { proxy_pass http://127.0.0.1:CWS; } location SUBFOLDERpelorus/ { + #satisfy any; + #auth_request /lsio-socket-auth; + #add_header Set-Cookie "lsio_socket=SOCKETKEY; Path=SUBFOLDER; HttpOnly; SameSite=Strict; Secure" always; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; @@ -118,6 +137,13 @@ server { client_max_body_size 10M; proxy_pass http://127.0.0.1:5100/; } + #location = /lsio-socket-auth { + # internal; + # if ($cookie_lsio_socket = "SOCKETKEY") { + # return 204; + # } + # return 401; + #} error_page 500 502 503 504 /50x.html; location = SUBFOLDER50x.html { root /usr/share/selkies/web/; diff --git a/root/etc/s6-overlay/s6-rc.d/init-nginx/run b/root/etc/s6-overlay/s6-rc.d/init-nginx/run index 9efe6d7c..6c16c346 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-nginx/run +++ b/root/etc/s6-overlay/s6-rc.d/init-nginx/run @@ -37,6 +37,7 @@ fi if [ -n "${PASSWORD}" ]; then printf '%s:%s\n' "${CUSER}" "$(openssl passwd -apr1 "${PASSWORD}")" > /etc/nginx/.htpasswd sed -i 's/#//g' ${NGINX_CONFIG} + sed -i "s/SOCKETKEY/$(openssl rand -hex 32)/g" ${NGINX_CONFIG} fi if [ ! -z ${DEV_MODE+x} ] && [[ "${DEV_MODE}" != "pixelflux" ]]; then sed -i \