Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(gateways): drop the relay opt-in from the deploy form

bernie-g033a756da708
diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx
index 3d8a11c32b..92cee81299 100644
--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/AwsStartCommandDialog.tsx
@@ -17,7 +17,6 @@ type Props = {
gatewayId: string;
gatewayName: string;
isDirect: boolean;
- includeRelay: boolean;
listenAddress: string;
};
@@ -31,7 +30,6 @@ export const AwsStartCommandContent = ({
gatewayId,
gatewayName,
isDirect,
- includeRelay,
listenAddress
}: Props) => {
const { protocol, hostname, port } = window.location;
@@ -41,7 +39,7 @@ export const AwsStartCommandContent = ({
const { data: relays, isPending: isRelaysLoading } = useGetRelays();
const [relay, setRelay] = useState<{ id: string; name: string }>(AUTO_RELAY_OPTION);
- const resolvedRelayName = !includeRelay || relay.id === "_auto" ? "" : relay.name;
+ const resolvedRelayName = isDirect || relay.id === "_auto" ? "" : relay.name;
const cliCommand = useMemo(() => {
const relayPart = resolvedRelayName ? ` --relay=${resolvedRelayName}` : "";
@@ -66,7 +64,7 @@ export const AwsStartCommandContent = ({
<CodeBlock value={systemdInstallCommand} label="Install service" />
<CodeBlock value={startServiceCommand} label="Start service" />
</TabsContent>
- {includeRelay && (
+ {!isDirect && (
<Field>
<Select
value={relay.id}
diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx
index 58cfe030d9..6795a5f369 100644
--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/EnrollmentTokenDialog.tsx
@@ -19,7 +19,6 @@ type Props = {
enrollmentToken: string;
expiresAt: string;
isDirect: boolean;
- includeRelay: boolean;
listenAddress: string;
onCommandDirtyChange: (isDirty: boolean) => void;
};
@@ -48,7 +47,6 @@ export const EnrollmentTokenContent = ({
enrollmentToken,
expiresAt,
isDirect,
- includeRelay,
listenAddress,
onCommandDirtyChange
}: Props) => {
@@ -72,13 +70,13 @@ export const EnrollmentTokenContent = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [enrollmentToken]);
- const isCommandDirty = includeRelay && relay.id !== commandRelay.id;
+ const isCommandDirty = !isDirect && relay.id !== commandRelay.id;
useEffect(() => {
onCommandDirtyChange(isCommandDirty);
}, [isCommandDirty, onCommandDirtyChange]);
- const resolvedRelayName = !includeRelay || commandRelay.id === "_auto" ? "" : commandRelay.name;
+ const resolvedRelayName = isDirect || commandRelay.id === "_auto" ? "" : commandRelay.name;
const expiryLabel = formatTimeRemaining(expiresAt, now);
const isExpired = expiryLabel === "Expired";
@@ -124,7 +122,7 @@ export const EnrollmentTokenContent = ({
/>
<CodeBlock value={startServiceCommand} label="Start service" />
</TabsContent>
- {includeRelay && (
+ {!isDirect && (
<Field>
<Select
value={relay.id}
diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/KubernetesStartCommandDialog.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/KubernetesStartCommandDialog.tsx
index 02b5d71487..3f3c8eaf04 100644
--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/KubernetesStartCommandDialog.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayAuthMethod/KubernetesStartCommandDialog.tsx
@@ -21,7 +21,6 @@ type Props = {
gatewayId: string;
gatewayName: string;
isDirect: boolean;
- includeRelay: boolean;
listenAddress: string;
};
@@ -35,7 +34,6 @@ export const KubernetesStartCommandContent = ({
gatewayId,
gatewayName,
isDirect,
- includeRelay,
listenAddress
}: Props) => {
const { protocol, hostname, port } = window.location;
@@ -45,7 +43,7 @@ export const KubernetesStartCommandContent = ({
const { data: relays, isPending: isRelaysLoading } = useGetRelays();
const [relay, setRelay] = useState<{ id: string; name: string }>(AUTO_RELAY_OPTION);
- const resolvedRelayName = !includeRelay || relay.id === "_auto" ? "" : relay.name;
+ const resolvedRelayName = isDirect || relay.id === "_auto" ? "" : relay.name;
const helmCommand = useMemo(() => {
// The chart derives the container port and the Service port from listenAddress, so setting
@@ -95,7 +93,7 @@ helm install infisical-gateway infisical/infisical-gateway \\
must be reachable from the pod, so a loopback address will not work.
</p>
</TabsContent>
- {includeRelay && (
+ {!isDirect && (
<Field>
<Select
value={relay.id}
diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx
index f99ff80528..9aa47adfbb 100644
--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx
@@ -14,7 +14,6 @@ import {
CardDescription,
CardHeader,
CardTitle,
- Checkbox,
DocumentationLinkBadge,
Field,
FieldContent,
@@ -84,16 +83,10 @@ export const GatewayDeploySection = ({
// Direct listen is the recommended mode, so it is also the default. The exceptions are Cloud,
// which cannot reach into a customer network, and a gateway already deployed against a relay
// alone, where the rendered command should match how it actually runs.
- const isDirectGateway = !isCloud && Boolean(directAddress);
const isRelayOnlyGateway = Boolean(relayId) && !directAddress;
const [connectionMode, setConnectionMode] = useState<"relay" | "direct">(
isCloud || isRelayOnlyGateway ? "relay" : "direct"
);
- // The relay is an add-on to direct listen rather than a competing transport: it extends reach to
- // PAM CLI users off the network and covers the direct address going down. Pre-checked for a
- // gateway already running both, so the command it renders matches how it is deployed.
- const [withRelay, setWithRelay] = useState(isDirectGateway && Boolean(relayId));
- const includeRelay = connectionMode === "relay" || withRelay;
const [listenAddress, setListenAddress] = useState(directAddress ?? "");
const trimmedListenAddress = listenAddress.trim();
const hasListenAddressError =
@@ -238,35 +231,11 @@ export const GatewayDeploySection = ({
</Field>
)}
- {connectionMode === "direct" && (
- <Field>
- <div className="flex items-start gap-3">
- <Checkbox
- id="gateway-with-relay"
- variant="org"
- className="mt-0.5"
- isChecked={withRelay}
- onCheckedChange={(isChecked) => setWithRelay(isChecked === true)}
- />
- <FieldContent>
- <FieldLabel htmlFor="gateway-with-relay" className="cursor-pointer">
- Also connect through a relay
- </FieldLabel>
- <FieldDescription>
- Infisical keeps using the direct address and falls back to the relay when it
- stops answering. Add one to reach PAM CLI users outside this network.
- </FieldDescription>
- </FieldContent>
- </div>
- </Field>
- )}
-
{authMethod.method === "aws" && (
<AwsStartCommandContent
gatewayId={gatewayId}
gatewayName={gatewayName}
isDirect={connectionMode === "direct"}
- includeRelay={includeRelay}
listenAddress={commandListenAddress}
/>
)}
@@ -276,7 +245,6 @@ export const GatewayDeploySection = ({
gatewayId={gatewayId}
gatewayName={gatewayName}
isDirect={connectionMode === "direct"}
- includeRelay={includeRelay}
listenAddress={commandListenAddress}
/>
)}
@@ -301,7 +269,6 @@ export const GatewayDeploySection = ({
enrollmentToken={enrollment.token}
expiresAt={enrollment.expiresAt}
isDirect={connectionMode === "direct"}
- includeRelay={includeRelay}
listenAddress={commandListenAddress}
onCommandDirtyChange={setIsCommandDirty}
/>