@@ -61,10 +60,10 @@ export const AdminLayout = () => {
))}
- {infisicalPlatformVersion && (
+ {envConfig.PLATFORM_VERSION && (
- Version: {infisicalPlatformVersion}
+ Version: {envConfig.PLATFORM_VERSION}
)}
diff --git a/frontend/src/layouts/OrganizationLayout/components/SidebarFooter/SidebarFooter.tsx b/frontend/src/layouts/OrganizationLayout/components/SidebarFooter/SidebarFooter.tsx
index 8b4db193f..6a634a9c4 100644
--- a/frontend/src/layouts/OrganizationLayout/components/SidebarFooter/SidebarFooter.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/SidebarFooter/SidebarFooter.tsx
@@ -17,6 +17,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from "@app/components/v2";
+import { envConfig } from "@app/config/env";
import { useOrganization, useSubscription } from "@app/context";
import { useGetOrgTrialUrl } from "@app/hooks/api";
@@ -49,8 +50,6 @@ export const SidebarFooter = () => {
const { mutateAsync } = useGetOrgTrialUrl();
- const infisicalPlatformVersion = import.meta.env.VITE_INFISICAL_PLATFORM_VERSION;
-
return (
{
))}
- {infisicalPlatformVersion && (
+ {envConfig.PLATFORM_VERSION && (
- Version: {infisicalPlatformVersion}
+ Version: {envConfig.PLATFORM_VERSION}
)}
diff --git a/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx b/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx
index f256dc2a2..8071d5043 100644
--- a/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx
+++ b/frontend/src/layouts/PersonalSettingsLayout/PersonalSettingsLayout.tsx
@@ -10,6 +10,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from "@app/components/v2";
+import { envConfig } from "@app/config/env";
import { ProjectType } from "@app/hooks/api/workspace/types";
import { InsecureConnectionBanner } from "../OrganizationLayout/components/InsecureConnectionBanner";
@@ -18,8 +19,6 @@ import { INFISICAL_SUPPORT_OPTIONS } from "../OrganizationLayout/components/Side
export const PersonalSettingsLayout = () => {
const { t } = useTranslation();
- const infisicalPlatformVersion = import.meta.env.VITE_INFISICAL_PLATFORM_VERSION;
-
return (
<>
@@ -61,10 +60,10 @@ export const PersonalSettingsLayout = () => {
))}
- {infisicalPlatformVersion && (
+ {envConfig.PLATFORM_VERSION && (
- Version: {infisicalPlatformVersion}
+ Version: {envConfig.PLATFORM_VERSION}
)}
diff --git a/frontend/src/pages/auth/LoginPage/components/InitialStep/InitialStep.tsx b/frontend/src/pages/auth/LoginPage/components/InitialStep/InitialStep.tsx
index d6b591fec..cc4ae8173 100644
--- a/frontend/src/pages/auth/LoginPage/components/InitialStep/InitialStep.tsx
+++ b/frontend/src/pages/auth/LoginPage/components/InitialStep/InitialStep.tsx
@@ -11,8 +11,8 @@ import { RegionSelect } from "@app/components/navigation/RegionSelect";
import { createNotification } from "@app/components/notifications";
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
import attemptLogin from "@app/components/utilities/attemptLogin";
-import { CAPTCHA_SITE_KEY } from "@app/components/utilities/config";
import { Button, IconButton, Input, Tooltip } from "@app/components/v2";
+import { envConfig } from "@app/config/env";
import { useServerConfig } from "@app/context";
import { useFetchServerStatus } from "@app/hooks/api";
import { LoginMethod } from "@app/hooks/api/admin/types";
@@ -351,11 +351,11 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
className="select:-webkit-autofill:focus h-10"
/>
- {shouldShowCaptcha && (
+ {shouldShowCaptcha && envConfig.CAPTCHA_SITE_KEY && (
setCaptchaToken(token)}
ref={captchaRef}
/>
diff --git a/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx b/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx
index cb49fc475..912ade1c0 100644
--- a/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx
+++ b/frontend/src/pages/auth/LoginPage/components/PasswordStep/PasswordStep.tsx
@@ -10,9 +10,9 @@ import { Mfa } from "@app/components/auth/Mfa";
import { createNotification } from "@app/components/notifications";
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
import attemptLogin from "@app/components/utilities/attemptLogin";
-import { CAPTCHA_SITE_KEY } from "@app/components/utilities/config";
import SecurityClient from "@app/components/utilities/SecurityClient";
import { Button, Input, Spinner } from "@app/components/v2";
+import { envConfig } from "@app/config/env";
import { SessionStorageKeys } from "@app/const";
import { useToggle } from "@app/hooks";
import { useOauthTokenExchange, useSelectOrganization } from "@app/hooks/api";
@@ -329,11 +329,11 @@ export const PasswordStep = ({ providerAuthToken, email, password, setPassword }
/>
- {shouldShowCaptcha && (
+ {shouldShowCaptcha && envConfig.CAPTCHA_SITE_KEY && (
setCaptchaToken(token)}
ref={captchaRef}
/>
diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts
index 11f02fe2a..e7ef95de4 100644
--- a/frontend/src/vite-env.d.ts
+++ b/frontend/src/vite-env.d.ts
@@ -1 +1,14 @@
///
+//
+interface ImportMetaEnv {
+ readonly VITE_POSTHOG_API_KEY?: string;
+ readonly VITE_POSTHOG_HOST: string;
+ readonly VITE_INTERCOM_ID?: string;
+ readonly VITE_CAPTCHA_SITE_KEY?: string;
+ readonly VITE_INFISICAL_PLATFORM_VERSION?: string;
+ // more env variables...
+}
+
+interface ImportMeta {
+ readonly env: ImportMetaEnv;
+}
diff --git a/nginx/default.dev.conf b/nginx/default.dev.conf
index 2d651cba8..56d026616 100644
--- a/nginx/default.dev.conf
+++ b/nginx/default.dev.conf
@@ -14,6 +14,19 @@ server {
proxy_pass http://backend:4000;
proxy_redirect off;
+ proxy_cookie_path / "/; HttpOnly; SameSite=strict";
+ }
+
+ location /runtime-ui-env.js {
+ proxy_set_header X-Real-RIP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+ proxy_set_header Host $http_host;
+ proxy_set_header X-NginX-Proxy true;
+
+ proxy_pass http://backend:4000;
+ proxy_redirect off;
+
proxy_cookie_path / "/; HttpOnly; SameSite=strict";
}
@@ -66,4 +79,4 @@ server {
proxy_pass http://frontend:3000;
proxy_redirect off;
}
-}
\ No newline at end of file
+}