mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 05:27:52 +00:00
remove domain input from users
This commit is contained in:
+4
-22
@@ -36,7 +36,6 @@ import { RelayOption } from "./RelayOption";
|
|||||||
|
|
||||||
const baseFormSchema = z.object({
|
const baseFormSchema = z.object({
|
||||||
name: slugSchema({ field: "name" }),
|
name: slugSchema({ field: "name" }),
|
||||||
instanceDomain: z.string().url("Must be a valid URL").or(z.literal("")),
|
|
||||||
relay: z
|
relay: z
|
||||||
.object(
|
.object(
|
||||||
{
|
{
|
||||||
@@ -78,7 +77,6 @@ export const GatewayCliDeploymentMethod = () => {
|
|||||||
const [autogenerateToken, setAutogenerateToken] = useState(true);
|
const [autogenerateToken, setAutogenerateToken] = useState(true);
|
||||||
const [step, setStep] = useState<"form" | "command">("form");
|
const [step, setStep] = useState<"form" | "command">("form");
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [instanceDomain, setInstanceDomain] = useState(siteURL);
|
|
||||||
const [relay, setRelay] = useState<null | {
|
const [relay, setRelay] = useState<null | {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -131,8 +129,7 @@ export const GatewayCliDeploymentMethod = () => {
|
|||||||
const validation = formSchemaWithIdentity.safeParse({
|
const validation = formSchemaWithIdentity.safeParse({
|
||||||
name,
|
name,
|
||||||
relay,
|
relay,
|
||||||
identity,
|
identity
|
||||||
instanceDomain
|
|
||||||
});
|
});
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
setFormErrors(validation.error.issues);
|
setFormErrors(validation.error.issues);
|
||||||
@@ -180,8 +177,7 @@ export const GatewayCliDeploymentMethod = () => {
|
|||||||
const validation = formSchemaWithToken.safeParse({
|
const validation = formSchemaWithToken.safeParse({
|
||||||
name,
|
name,
|
||||||
relay,
|
relay,
|
||||||
identityToken,
|
identityToken
|
||||||
instanceDomain
|
|
||||||
});
|
});
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
setFormErrors(validation.error.issues);
|
setFormErrors(validation.error.issues);
|
||||||
@@ -192,11 +188,10 @@ export const GatewayCliDeploymentMethod = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const command = useMemo(() => {
|
const command = useMemo(() => {
|
||||||
const domainFlag = instanceDomain ? ` --domain=${instanceDomain}` : "";
|
|
||||||
return `infisical gateway start --name=${name} --relay=${
|
return `infisical gateway start --name=${name} --relay=${
|
||||||
relay?.name || ""
|
relay?.name || ""
|
||||||
}${domainFlag} --token=${identityToken}`;
|
} --domain=${siteURL} --token=${identityToken}`;
|
||||||
}, [name, relay, identityToken, instanceDomain]);
|
}, [name, relay, identityToken, siteURL]);
|
||||||
|
|
||||||
if (step === "command") {
|
if (step === "command") {
|
||||||
return (
|
return (
|
||||||
@@ -279,19 +274,6 @@ export const GatewayCliDeploymentMethod = () => {
|
|||||||
/>
|
/>
|
||||||
{errors.relay && <p className="mt-1 text-sm text-red">{errors.relay}</p>}
|
{errors.relay && <p className="mt-1 text-sm text-red">{errors.relay}</p>}
|
||||||
|
|
||||||
<FormLabel
|
|
||||||
label="Infisical Instance Host Address"
|
|
||||||
tooltipText="The host address of the infisical instance that's accessible by the gateway."
|
|
||||||
className="mt-4"
|
|
||||||
/>
|
|
||||||
<Input
|
|
||||||
value={instanceDomain}
|
|
||||||
onChange={(e) => setInstanceDomain(e.target.value)}
|
|
||||||
placeholder="https://app.infisical.com"
|
|
||||||
isError={Boolean(errors.instanceDomain)}
|
|
||||||
/>
|
|
||||||
{errors.instanceDomain && <p className="mt-1 text-sm text-red">{errors.instanceDomain}</p>}
|
|
||||||
|
|
||||||
{canCreateToken && autogenerateToken ? (
|
{canCreateToken && autogenerateToken ? (
|
||||||
<>
|
<>
|
||||||
<FormLabel
|
<FormLabel
|
||||||
|
|||||||
+4
-21
@@ -31,8 +31,7 @@ import { slugSchema } from "@app/lib/schemas";
|
|||||||
|
|
||||||
const baseFormSchema = z.object({
|
const baseFormSchema = z.object({
|
||||||
name: slugSchema({ field: "name" }),
|
name: slugSchema({ field: "name" }),
|
||||||
host: z.string().min(1, "Host is required"),
|
host: z.string().min(1, "Host is required")
|
||||||
instanceDomain: z.string().url("Must be a valid URL").or(z.literal(""))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const formSchemaWithIdentity = baseFormSchema.extend({
|
const formSchemaWithIdentity = baseFormSchema.extend({
|
||||||
@@ -62,7 +61,6 @@ export const RelayCliDeploymentMethod = () => {
|
|||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [host, setHost] = useState("");
|
const [host, setHost] = useState("");
|
||||||
|
|
||||||
const [instanceDomain, setInstanceDomain] = useState(siteURL);
|
|
||||||
const [identity, setIdentity] = useState<null | {
|
const [identity, setIdentity] = useState<null | {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -106,7 +104,7 @@ export const RelayCliDeploymentMethod = () => {
|
|||||||
setFormErrors([]);
|
setFormErrors([]);
|
||||||
|
|
||||||
if (canCreateToken && autogenerateToken) {
|
if (canCreateToken && autogenerateToken) {
|
||||||
const validation = formSchemaWithIdentity.safeParse({ name, host, instanceDomain, identity });
|
const validation = formSchemaWithIdentity.safeParse({ name, host, identity });
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
setFormErrors(validation.error.issues);
|
setFormErrors(validation.error.issues);
|
||||||
return;
|
return;
|
||||||
@@ -153,7 +151,6 @@ export const RelayCliDeploymentMethod = () => {
|
|||||||
const validation = formSchemaWithToken.safeParse({
|
const validation = formSchemaWithToken.safeParse({
|
||||||
name,
|
name,
|
||||||
host,
|
host,
|
||||||
instanceDomain,
|
|
||||||
identityToken
|
identityToken
|
||||||
});
|
});
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
@@ -174,9 +171,8 @@ export const RelayCliDeploymentMethod = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const command = useMemo(() => {
|
const command = useMemo(() => {
|
||||||
const domainFlag = instanceDomain ? ` --domain=${instanceDomain}` : "";
|
return `infisical relay start --name=${name} --domain=${siteURL} --host=${host} --token=${identityToken}`;
|
||||||
return `infisical relay start --name=${name}${domainFlag} --host=${host} --token=${identityToken}`;
|
}, [name, siteURL, host, identityToken]);
|
||||||
}, [name, instanceDomain, host, identityToken]);
|
|
||||||
|
|
||||||
if (step === "command") {
|
if (step === "command") {
|
||||||
return (
|
return (
|
||||||
@@ -244,19 +240,6 @@ export const RelayCliDeploymentMethod = () => {
|
|||||||
/>
|
/>
|
||||||
{errors.host && <p className="mt-1 text-sm text-red">{errors.host}</p>}
|
{errors.host && <p className="mt-1 text-sm text-red">{errors.host}</p>}
|
||||||
|
|
||||||
<FormLabel
|
|
||||||
label="Infisical Instance Host Address"
|
|
||||||
tooltipText="The host address of the infisical instance that's accessible by the relay."
|
|
||||||
className="mt-4"
|
|
||||||
/>
|
|
||||||
<Input
|
|
||||||
value={instanceDomain}
|
|
||||||
onChange={(e) => setInstanceDomain(e.target.value)}
|
|
||||||
placeholder="https://app.infisical.com"
|
|
||||||
isError={Boolean(errors.instanceDomain)}
|
|
||||||
/>
|
|
||||||
{errors.instanceDomain && <p className="mt-1 text-sm text-red">{errors.instanceDomain}</p>}
|
|
||||||
|
|
||||||
{canCreateToken && autogenerateToken ? (
|
{canCreateToken && autogenerateToken ? (
|
||||||
<>
|
<>
|
||||||
<FormLabel
|
<FormLabel
|
||||||
|
|||||||
+3
-20
@@ -31,8 +31,7 @@ import {
|
|||||||
import { slugSchema } from "@app/lib/schemas";
|
import { slugSchema } from "@app/lib/schemas";
|
||||||
|
|
||||||
const baseFormSchema = z.object({
|
const baseFormSchema = z.object({
|
||||||
name: slugSchema({ field: "name" }),
|
name: slugSchema({ field: "name" })
|
||||||
instanceDomain: z.string().url("Must be a valid URL").or(z.literal(""))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const formSchemaWithIdentity = baseFormSchema.extend({
|
const formSchemaWithIdentity = baseFormSchema.extend({
|
||||||
@@ -70,7 +69,6 @@ export const RelayTerraformDeploymentMethod = () => {
|
|||||||
const [step, setStep] = useState<"form" | "command">("form");
|
const [step, setStep] = useState<"form" | "command">("form");
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
|
|
||||||
const [instanceDomain, setInstanceDomain] = useState(siteURL);
|
|
||||||
const [identity, setIdentity] = useState<null | {
|
const [identity, setIdentity] = useState<null | {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -173,7 +171,6 @@ export const RelayTerraformDeploymentMethod = () => {
|
|||||||
} else {
|
} else {
|
||||||
const validation = formSchemaWithToken.safeParse({
|
const validation = formSchemaWithToken.safeParse({
|
||||||
name,
|
name,
|
||||||
instanceDomain,
|
|
||||||
identityToken
|
identityToken
|
||||||
});
|
});
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
@@ -202,7 +199,6 @@ export const RelayTerraformDeploymentMethod = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const terraformCommand = useMemo(() => {
|
const terraformCommand = useMemo(() => {
|
||||||
const domain = instanceDomain || "https://app.infisical.com";
|
|
||||||
return `terraform {
|
return `terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
aws = {
|
aws = {
|
||||||
@@ -293,7 +289,7 @@ module "infisical_relay_instance" {
|
|||||||
export INFISICAL_TOKEN="${identityToken}"
|
export INFISICAL_TOKEN="${identityToken}"
|
||||||
sudo -E infisical relay systemd install \\
|
sudo -E infisical relay systemd install \\
|
||||||
--name "${name}" \\
|
--name "${name}" \\
|
||||||
--domain "${domain}" \\
|
--domain "${siteURL}" \\
|
||||||
--host "\${aws_eip.infisical_relay_eip.public_ip}"
|
--host "\${aws_eip.infisical_relay_eip.public_ip}"
|
||||||
|
|
||||||
# Start and enable the service to run on boot
|
# Start and enable the service to run on boot
|
||||||
@@ -308,7 +304,7 @@ resource "aws_eip_association" "eip_assoc" {
|
|||||||
allocation_id = aws_eip.infisical_relay_eip.id
|
allocation_id = aws_eip.infisical_relay_eip.id
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}, [name, instanceDomain, identityToken, awsRegion, vpcId, ami, subnetId]);
|
}, [name, siteURL, identityToken, awsRegion, vpcId, ami, subnetId]);
|
||||||
|
|
||||||
if (step === "command") {
|
if (step === "command") {
|
||||||
return (
|
return (
|
||||||
@@ -358,19 +354,6 @@ resource "aws_eip_association" "eip_assoc" {
|
|||||||
/>
|
/>
|
||||||
{errors.name && <p className="mt-1 text-sm text-red">{errors.name}</p>}
|
{errors.name && <p className="mt-1 text-sm text-red">{errors.name}</p>}
|
||||||
|
|
||||||
<FormLabel
|
|
||||||
label="Infisical Instance Host Address"
|
|
||||||
tooltipText="The host address of the infisical instance that's accessible by the relay."
|
|
||||||
className="mt-4"
|
|
||||||
/>
|
|
||||||
<Input
|
|
||||||
value={instanceDomain}
|
|
||||||
onChange={(e) => setInstanceDomain(e.target.value)}
|
|
||||||
placeholder="https://app.infisical.com"
|
|
||||||
isError={Boolean(errors.instanceDomain)}
|
|
||||||
/>
|
|
||||||
{errors.instanceDomain && <p className="mt-1 text-sm text-red">{errors.instanceDomain}</p>}
|
|
||||||
|
|
||||||
{canCreateToken && autogenerateToken ? (
|
{canCreateToken && autogenerateToken ? (
|
||||||
<>
|
<>
|
||||||
<FormLabel
|
<FormLabel
|
||||||
|
|||||||
Reference in New Issue
Block a user