mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 14:39:29 +02:00
Add newt install command
This commit is contained in:
parent
c244dc9c0c
commit
50fc2fc74e
2 changed files with 62 additions and 48 deletions
|
@ -1346,7 +1346,7 @@
|
||||||
"resourceEnableProxyDescription": "Enable public proxying to this resource. This allows access to the resource from outside the network through the cloud on an open port. Requires Traefik config.",
|
"resourceEnableProxyDescription": "Enable public proxying to this resource. This allows access to the resource from outside the network through the cloud on an open port. Requires Traefik config.",
|
||||||
"externalProxyEnabled": "External Proxy Enabled",
|
"externalProxyEnabled": "External Proxy Enabled",
|
||||||
"siteConfiguration": "Configuration",
|
"siteConfiguration": "Configuration",
|
||||||
"siteAcceptClientConnections": "Accept client connections",
|
"siteAcceptClientConnections": "Accept Client Connections",
|
||||||
"siteAcceptClientConnectionsDescription": "Allow other devices to connect through this Newt instance as a gateway using clients.",
|
"siteAcceptClientConnectionsDescription": "Allow other devices to connect through this Newt instance as a gateway using clients.",
|
||||||
"siteAddress": "Site Address",
|
"siteAddress": "Site Address",
|
||||||
"siteAddressDescription": "Specify the IP address of the host for clients to connect to."
|
"siteAddressDescription": "Specify the IP address of the host for clients to connect to."
|
||||||
|
|
|
@ -43,7 +43,7 @@ import {
|
||||||
FaWindows
|
FaWindows
|
||||||
} from "react-icons/fa";
|
} from "react-icons/fa";
|
||||||
import { SiNixos } from "react-icons/si";
|
import { SiNixos } from "react-icons/si";
|
||||||
import { Checkbox } 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";
|
||||||
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||||
|
@ -72,6 +72,7 @@ interface TunnelTypeOption {
|
||||||
type Commands = {
|
type Commands = {
|
||||||
mac: Record<string, string[]>;
|
mac: Record<string, string[]>;
|
||||||
linux: Record<string, string[]>;
|
linux: Record<string, string[]>;
|
||||||
|
freebsd: Record<string, string[]>;
|
||||||
windows: Record<string, string[]>;
|
windows: Record<string, string[]>;
|
||||||
docker: Record<string, string[]>;
|
docker: Record<string, string[]>;
|
||||||
podman: Record<string, string[]>;
|
podman: Record<string, string[]>;
|
||||||
|
@ -212,46 +213,46 @@ PersistentKeepalive = 5`;
|
||||||
|
|
||||||
const commands = {
|
const commands = {
|
||||||
mac: {
|
mac: {
|
||||||
"Apple Silicon (arm64)": [
|
All: [
|
||||||
`curl -L -o newt "https://github.com/fosrl/newt/releases/download/${version}/newt_darwin_arm64" && chmod +x ./newt`,
|
`curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
`newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
],
|
|
||||||
"Intel x64 (amd64)": [
|
|
||||||
`curl -L -o newt "https://github.com/fosrl/newt/releases/download/${version}/newt_darwin_amd64" && chmod +x ./newt`,
|
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
|
||||||
]
|
]
|
||||||
|
// "Intel x64 (amd64)": [
|
||||||
|
// `curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
|
// `newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
|
// ]
|
||||||
},
|
},
|
||||||
linux: {
|
linux: {
|
||||||
amd64: [
|
All: [
|
||||||
`wget -O newt "https://github.com/fosrl/newt/releases/download/${version}/newt_linux_amd64" && chmod +x ./newt`,
|
`curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
`newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
],
|
|
||||||
arm64: [
|
|
||||||
`wget -O newt "https://github.com/fosrl/newt/releases/download/${version}/newt_linux_arm64" && chmod +x ./newt`,
|
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
|
||||||
],
|
|
||||||
arm32: [
|
|
||||||
`wget -O newt "https://github.com/fosrl/newt/releases/download/${version}/newt_linux_arm32" && chmod +x ./newt`,
|
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
|
||||||
],
|
|
||||||
arm32v6: [
|
|
||||||
`wget -O newt "https://github.com/fosrl/newt/releases/download/${version}/newt_linux_arm32v6" && chmod +x ./newt`,
|
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
|
||||||
],
|
|
||||||
riscv64: [
|
|
||||||
`wget -O newt "https://github.com/fosrl/newt/releases/download/${version}/newt_linux_riscv64" && chmod +x ./newt`,
|
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
|
||||||
]
|
]
|
||||||
|
// arm64: [
|
||||||
|
// `curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
|
// `newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
|
// ],
|
||||||
|
// arm32: [
|
||||||
|
// `curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
|
// `newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
|
// ],
|
||||||
|
// arm32v6: [
|
||||||
|
// `curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
|
// `newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
|
// ],
|
||||||
|
// riscv64: [
|
||||||
|
// `curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
|
// `newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
|
// ]
|
||||||
},
|
},
|
||||||
freebsd: {
|
freebsd: {
|
||||||
amd64: [
|
All: [
|
||||||
`fetch -o newt "https://github.com/fosrl/newt/releases/download/${version}/newt_freebsd_amd64" && chmod +x ./newt`,
|
`curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
`newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
],
|
|
||||||
arm64: [
|
|
||||||
`fetch -o newt "https://github.com/fosrl/newt/releases/download/${version}/newt_freebsd_arm64" && chmod +x ./newt`,
|
|
||||||
`./newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
|
||||||
]
|
]
|
||||||
|
// arm64: [
|
||||||
|
// `curl -fsSL https://digpangolin.com/get-newt.sh | bash`,
|
||||||
|
// `newt --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
|
// ]
|
||||||
},
|
},
|
||||||
windows: {
|
windows: {
|
||||||
x64: [
|
x64: [
|
||||||
|
@ -299,12 +300,12 @@ WantedBy=default.target`
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
nixos: {
|
nixos: {
|
||||||
x86_64: [
|
All: [
|
||||||
`nix run 'nixpkgs#fosrl-newt' -- --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
`nix run 'nixpkgs#fosrl-newt' -- --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
],
|
],
|
||||||
aarch64: [
|
// aarch64: [
|
||||||
`nix run 'nixpkgs#fosrl-newt' -- --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
// `nix run 'nixpkgs#fosrl-newt' -- --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}`
|
||||||
]
|
// ]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
setCommands(commands);
|
setCommands(commands);
|
||||||
|
@ -313,9 +314,11 @@ WantedBy=default.target`
|
||||||
const getArchitectures = () => {
|
const getArchitectures = () => {
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case "linux":
|
case "linux":
|
||||||
return ["amd64", "arm64", "arm32", "arm32v6", "riscv64"];
|
// return ["amd64", "arm64", "arm32", "arm32v6", "riscv64"];
|
||||||
|
return ["All"];
|
||||||
case "mac":
|
case "mac":
|
||||||
return ["Apple Silicon (arm64)", "Intel x64 (amd64)"];
|
// return ["Apple Silicon (arm64)", "Intel x64 (amd64)"];
|
||||||
|
return ["All"];
|
||||||
case "windows":
|
case "windows":
|
||||||
return ["x64"];
|
return ["x64"];
|
||||||
case "docker":
|
case "docker":
|
||||||
|
@ -323,9 +326,11 @@ WantedBy=default.target`
|
||||||
case "podman":
|
case "podman":
|
||||||
return ["Podman Quadlet", "Podman Run"];
|
return ["Podman Quadlet", "Podman Run"];
|
||||||
case "freebsd":
|
case "freebsd":
|
||||||
return ["amd64", "arm64"];
|
// return ["amd64", "arm64"];
|
||||||
|
return ["All"];
|
||||||
case "nixos":
|
case "nixos":
|
||||||
return ["x86_64", "aarch64"];
|
// return ["x86_64", "aarch64"];
|
||||||
|
return ["All"];
|
||||||
default:
|
default:
|
||||||
return ["x64"];
|
return ["x64"];
|
||||||
}
|
}
|
||||||
|
@ -633,7 +638,9 @@ WantedBy=default.target`
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>
|
<FormLabel>
|
||||||
{t("siteAddress")}
|
{t(
|
||||||
|
"siteAddress"
|
||||||
|
)}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
|
@ -659,7 +666,9 @@ WantedBy=default.target`
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
{t("siteAddressDescription")}
|
{t(
|
||||||
|
"siteAddressDescription"
|
||||||
|
)}
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
@ -869,7 +878,7 @@ WantedBy=default.target`
|
||||||
{t("siteConfiguration")}
|
{t("siteConfiguration")}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center space-x-2 mb-4">
|
<div className="flex items-center space-x-2 mb-4">
|
||||||
<Checkbox
|
<CheckboxWithLabel
|
||||||
id="acceptClients"
|
id="acceptClients"
|
||||||
checked={acceptClients}
|
checked={acceptClients}
|
||||||
onCheckedChange={(
|
onCheckedChange={(
|
||||||
|
@ -900,16 +909,21 @@ WantedBy=default.target`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
label={t(
|
||||||
|
"siteAcceptClientConnections"
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
<label
|
<label
|
||||||
htmlFor="acceptClients"
|
htmlFor="acceptClients"
|
||||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||||
>
|
>
|
||||||
{t("siteAcceptClientConnections")}
|
{}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-muted-foreground mb-4">
|
<p className="text-sm text-muted-foreground mb-4">
|
||||||
{t("siteAcceptClientConnectionsDescription")}
|
{t(
|
||||||
|
"siteAcceptClientConnectionsDescription"
|
||||||
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue