diff --git a/lib/app-setup/root.tsx b/lib/app-setup/root.tsx index 423888f2a..dc8ca64b2 100644 --- a/lib/app-setup/root.tsx +++ b/lib/app-setup/root.tsx @@ -219,6 +219,9 @@ export const loader = () => { ...(process.env.URL_SUFFIX ? { URL_SUFFIX: process.env.URL_SUFFIX } : {}), ...(process.env.BASE_URL ? { BASE_URL: process.env.BASE_URL } : {}), + ...(process.env.GATEWAY_URL + ? { GATEWAY_URL: process.env.GATEWAY_URL } + : {}), }; }; diff --git a/lib/configs/base-url.cjs b/lib/configs/base-url.cjs index c15a98b73..c80fda6f8 100644 --- a/lib/configs/base-url.cjs +++ b/lib/configs/base-url.cjs @@ -26,8 +26,17 @@ const baseUrls = () => { return process.env.COOKIE_DOMAIN; })() || '.kloudlite.io'; + const gatewayUrl = + (() => { + if (typeof window !== 'undefined') { + // @ts-ignore + return window.GATEWAY_URL; + } + return process.env.GATEWAY_URL; + })() || 'http://gateway-api.kl-core.svc.cluster.local'; + return { - gatewayUrl: 'http://gateway-api.kl-core.svc.cluster.local', + gatewayUrl, authBaseUrl: `https://auth${postFix}.${bUrl}`, consoleBaseUrl: `https://console${postFix}.${bUrl}`, cookieDomain,