Merge pull request #4818 from Infisical/PLATFRM-4

make --relay flag optional & add sudo to gateway start examples
This commit is contained in:
Andre
2025-11-10 14:16:01 -05:00
committed by GitHub
4 changed files with 77 additions and 35 deletions
@@ -80,7 +80,7 @@ export const GatewayCliDeploymentMethod = () => {
const [relay, setRelay] = useState<null | {
id: string;
name: string;
}>(null);
}>({ id: "_auto", name: "Auto Select Relay" });
const [identity, setIdentity] = useState<null | {
id: string;
name: string;
@@ -183,9 +183,8 @@ export const GatewayCliDeploymentMethod = () => {
};
const command = useMemo(() => {
return `infisical gateway start --name=${name} --relay=${
relay?.name || ""
} --domain=${siteURL} --token=${identityToken}`;
const relayPart = relay?.id !== "_auto" ? ` --relay=${relay?.name || ""}` : "";
return `sudo infisical gateway start --name=${name}${relayPart} --domain=${siteURL} --token=${identityToken}`;
}, [name, relay, identityToken, siteURL]);
if (step === "command") {
@@ -256,6 +255,10 @@ export const GatewayCliDeploymentMethod = () => {
}}
isLoading={isRelaysLoading}
options={[
{
id: "_auto",
name: "Auto Select Relay"
},
{
id: "_create",
name: "Deploy New Relay"
@@ -1,6 +1,6 @@
import { components, OptionProps } from "react-select";
import { faCheckCircle } from "@fortawesome/free-regular-svg-icons";
import { faPlus } from "@fortawesome/free-solid-svg-icons";
import { faPlus, faWandMagicSparkles } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
export const RelayOption = ({
@@ -9,16 +9,24 @@ export const RelayOption = ({
...props
}: OptionProps<{ id: string; name: string }>) => {
const isCreateOption = props.data.id === "_create";
const isAutoOption = props.data.id === "_auto";
return (
<components.Option isSelected={isSelected} {...props}>
<div className="flex flex-row items-center justify-between">
{isCreateOption ? (
{isCreateOption && (
<div className="flex items-center gap-x-1 text-mineshaft-400">
<FontAwesomeIcon icon={faPlus} size="sm" />
<span className="mr-auto">Deploy New Relay</span>
</div>
) : (
)}
{isAutoOption && (
<div className="flex items-center gap-x-1 text-mineshaft-400">
<FontAwesomeIcon icon={faWandMagicSparkles} size="sm" />
<span className="mr-auto">Auto Select Relay</span>
</div>
)}
{!isCreateOption && !isAutoOption && (
<>
<p className="truncate">{children}</p>
{isSelected && (