fix and update

This commit is contained in:
lendry
2026-06-30 19:23:17 +03:00
parent 2ea790d21d
commit d41c9d1121
2 changed files with 23 additions and 5 deletions

View File

@@ -143,7 +143,6 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
const onReady = () => setIsApiReady(true); const onReady = () => setIsApiReady(true);
const onNotReady = () => { const onNotReady = () => {
setIsApiReady(false); setIsApiReady(false);
setIsSessionReady(false);
}; };
const unsubReady = subscribeApiReady(onReady); const unsubReady = subscribeApiReady(onReady);
const unsubNotReady = subscribeApiNotReady(onNotReady); const unsubNotReady = subscribeApiNotReady(onNotReady);

View File

@@ -2138,29 +2138,48 @@ nginx_proxy_headers_api=" proxy_set_header Host \$host;
# «variable proxy_pass» и требует resolver (502: no resolver defined to resolve lendry-id-frontend). # «variable proxy_pass» и требует resolver (502: no resolver defined to resolve lendry-id-frontend).
# Без URI в proxy_pass полный путь клиента передаётся upstream как есть. # Без URI в proxy_pass полный путь клиента передаётся upstream как есть.
render_proxy_root() { render_proxy_root() {
local key="$1" up local key="$1" up var
up="$(nginx_upstream "$key")" up="$(nginx_upstream "$key")"
if [[ "$NGINX_MODE" == "docker" ]]; then
var="idp_up_${key//-/_}"
printf ' set $%s %s;\n proxy_pass $%s;' "$var" "$up" "$var"
return 0
fi
printf ' proxy_pass %s;' "$up" printf ' proxy_pass %s;' "$up"
} }
# proxy_pass с заменой пути на фиксированный ($2, например /ws или /oauth/). # proxy_pass с заменой пути на фиксированный ($2, например /ws или /oauth/).
render_proxy_rewrite() { render_proxy_rewrite() {
local key="$1" target="$2" up local key="$1" target="$2" up var
up="$(nginx_upstream "$key")" up="$(nginx_upstream "$key")"
if [[ "$NGINX_MODE" == "docker" ]]; then
var="idp_up_${key//-/_}"
printf ' set $%s %s;\n rewrite ^.*$ %s break;\n proxy_pass $%s;' "$var" "$up" "$target" "$var"
return 0
fi
printf ' rewrite ^.*$ %s break;\n proxy_pass %s;' "$target" "$up" printf ' rewrite ^.*$ %s break;\n proxy_pass %s;' "$target" "$up"
} }
# proxy_pass для /idp-api/ — trailing slash снимает префикс без rewrite (надёжнее под HTTP/2). # proxy_pass для /idp-api/ — в Docker через variable proxy_pass, чтобы nginx
# не держал stale IP api-gateway после recreate и резолвил через 127.0.0.11.
render_proxy_idp_api() { render_proxy_idp_api() {
local up local up
up="$(nginx_upstream api)" up="$(nginx_upstream api)"
if [[ "$NGINX_MODE" == "docker" ]]; then
printf ' set $idp_up_api %s;\n rewrite ^/idp-api/?(.*)$ /$1 break;\n proxy_pass $idp_up_api;' "$up"
return 0
fi
printf ' proxy_pass %s/;' "$up" printf ' proxy_pass %s/;' "$up"
} }
# WebSocket /idp-api/ws → media-ws /ws (без rewrite break). # WebSocket /idp-api/ws → media-ws /ws.
render_proxy_idp_ws() { render_proxy_idp_ws() {
local up local up
up="$(nginx_upstream ws)" up="$(nginx_upstream ws)"
if [[ "$NGINX_MODE" == "docker" ]]; then
printf ' set $idp_up_ws %s;\n rewrite ^/idp-api/ws/?(.*)$ /ws/$1 break;\n proxy_pass $idp_up_ws;' "$up"
return 0
fi
printf ' proxy_pass %s/ws;' "$up" printf ' proxy_pass %s/ws;' "$up"
} }