Merge pull request #1465 from marcschaeferger/dev

feat(sites): adding official kubernetes helm install command for newt
This commit is contained in:
Owen Schwartz
2025-09-15 14:01:35 -07:00
committed by GitHub
2 changed files with 32 additions and 1 deletions

View File

@@ -42,6 +42,10 @@ import {
FaFreebsd, FaFreebsd,
FaWindows FaWindows
} from "react-icons/fa"; } from "react-icons/fa";
import {
SiNixos,
SiKubernetes
} from "react-icons/si";
import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert"; import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert";
import { createApiClient, formatAxiosError } from "@app/lib/api"; import { createApiClient, formatAxiosError } from "@app/lib/api";
import { useEnvContext } from "@app/hooks/useEnvContext"; import { useEnvContext } from "@app/hooks/useEnvContext";
@@ -248,10 +252,14 @@ export default function Page() {
return <FaApple className="h-4 w-4 mr-2" />; return <FaApple className="h-4 w-4 mr-2" />;
case "docker": case "docker":
return <FaDocker className="h-4 w-4 mr-2" />; return <FaDocker className="h-4 w-4 mr-2" />;
case "kubernetes":
return <SiKubernetes className="h-4 w-4 mr-2" />;
case "podman": case "podman":
return <FaCubes className="h-4 w-4 mr-2" />; return <FaCubes className="h-4 w-4 mr-2" />;
case "freebsd": case "freebsd":
return <FaFreebsd className="h-4 w-4 mr-2" />; return <FaFreebsd className="h-4 w-4 mr-2" />;
case "nixos":
return <SiNixos className="h-4 w-4 mr-2" />;
default: default:
return <Terminal className="h-4 w-4 mr-2" />; return <Terminal className="h-4 w-4 mr-2" />;
} }

View File

@@ -42,7 +42,10 @@ import {
FaFreebsd, FaFreebsd,
FaWindows FaWindows
} from "react-icons/fa"; } from "react-icons/fa";
import { SiNixos } from "react-icons/si"; import {
SiNixos,
SiKubernetes
} from "react-icons/si";
import { Checkbox, CheckboxWithLabel } from "@app/components/ui/checkbox"; import { Checkbox, CheckboxWithLabel } from "@app/components/ui/checkbox";
import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert"; import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert";
import { generateKeypair } from "../[niceId]/wireguardConfig"; import { generateKeypair } from "../[niceId]/wireguardConfig";
@@ -76,6 +79,7 @@ type Commands = {
freebsd: Record<string, string[]>; freebsd: Record<string, string[]>;
windows: Record<string, string[]>; windows: Record<string, string[]>;
docker: Record<string, string[]>; docker: Record<string, string[]>;
kubernetes: Record<string, string[]>;
podman: Record<string, string[]>; podman: Record<string, string[]>;
nixos: Record<string, string[]>; nixos: Record<string, string[]>;
}; };
@@ -83,6 +87,7 @@ type Commands = {
const platforms = [ const platforms = [
"linux", "linux",
"docker", "docker",
"kubernetes",
"podman", "podman",
"mac", "mac",
"windows", "windows",
@@ -277,6 +282,18 @@ PersistentKeepalive = 5`;
`docker run -dit fosrl/newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}` `docker run -dit fosrl/newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
] ]
}, },
kubernetes: {
"Helm Chart": [
`helm repo add fossorial https://charts.fossorial.io`,
`helm repo update fossorial`,
`helm install newt fossorial/newt \\
--create-namespace \\
--set newtInstances[0].name="main-tunnel" \\
--set-string newtInstances[0].auth.keys.endpointKey="${endpoint}" \\
--set-string newtInstances[0].auth.keys.idKey="${id}" \\
--set-string newtInstances[0].auth.keys.secretKey="${secret}"`
]
},
podman: { podman: {
"Podman Quadlet": [ "Podman Quadlet": [
`[Unit] `[Unit]
@@ -324,6 +341,8 @@ WantedBy=default.target`
return ["x64"]; return ["x64"];
case "docker": case "docker":
return ["Docker Compose", "Docker Run"]; return ["Docker Compose", "Docker Run"];
case "kubernetes":
return ["Helm Chart"];
case "podman": case "podman":
return ["Podman Quadlet", "Podman Run"]; return ["Podman Quadlet", "Podman Run"];
case "freebsd": case "freebsd":
@@ -345,6 +364,8 @@ WantedBy=default.target`
return "macOS"; return "macOS";
case "docker": case "docker":
return "Docker"; return "Docker";
case "kubernetes":
return "Kubernetes";
case "podman": case "podman":
return "Podman"; return "Podman";
case "freebsd": case "freebsd":
@@ -391,6 +412,8 @@ WantedBy=default.target`
return <FaApple className="h-4 w-4 mr-2" />; return <FaApple className="h-4 w-4 mr-2" />;
case "docker": case "docker":
return <FaDocker className="h-4 w-4 mr-2" />; return <FaDocker className="h-4 w-4 mr-2" />;
case "kubernetes":
return <SiKubernetes className="h-4 w-4 mr-2" />;
case "podman": case "podman":
return <FaCubes className="h-4 w-4 mr-2" />; return <FaCubes className="h-4 w-4 mr-2" />;
case "freebsd": case "freebsd":