mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-23 18:58:51 +02:00
Add alpine install commands
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
|||||||
FaWindows
|
FaWindows
|
||||||
} from "react-icons/fa";
|
} from "react-icons/fa";
|
||||||
import { Download, ExternalLink } from "lucide-react";
|
import { Download, ExternalLink } from "lucide-react";
|
||||||
import { SiKubernetes, SiNixos } from "react-icons/si";
|
import { SiAlpinelinux, SiKubernetes, SiNixos } from "react-icons/si";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
|
|
||||||
export type CommandItem =
|
export type CommandItem =
|
||||||
@@ -30,6 +30,7 @@ export type CommandItem =
|
|||||||
|
|
||||||
const PLATFORMS = [
|
const PLATFORMS = [
|
||||||
"linux",
|
"linux",
|
||||||
|
"alpine",
|
||||||
"macos",
|
"macos",
|
||||||
"docker",
|
"docker",
|
||||||
"kubernetes",
|
"kubernetes",
|
||||||
@@ -65,7 +66,8 @@ export function NewtSiteInstallCommands({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const showSiteConfiguration = platform !== "advantech";
|
const showSiteConfiguration = platform !== "advantech";
|
||||||
const supportsSshOption = platform === "linux" || platform === "nixos";
|
const supportsSshOption =
|
||||||
|
platform === "linux" || platform === "nixos" || platform === "alpine";
|
||||||
|
|
||||||
const acceptClientsFlag = !acceptClients ? " --disable-clients" : "";
|
const acceptClientsFlag = !acceptClients ? " --disable-clients" : "";
|
||||||
const acceptClientsEnv = !acceptClients
|
const acceptClientsEnv = !acceptClients
|
||||||
@@ -168,6 +170,76 @@ sudo systemctl enable --now pangolin-site`
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
alpine: {
|
||||||
|
Run: [
|
||||||
|
{
|
||||||
|
title: t("install"),
|
||||||
|
command: `curl -fsSL https://static.pangolin.net/get-cli.sh | bash`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("run"),
|
||||||
|
command: `${runAsRootPrefix}pangolin up site --id ${id} --secret ${secret} --endpoint ${endpoint}${acceptClientsFlag}${disableSshFlag}`
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Manual OpenRC Service": [
|
||||||
|
{
|
||||||
|
title: t("install"),
|
||||||
|
command: `curl -fsSL https://static.pangolin.net/get-cli.sh | bash`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("envFile"),
|
||||||
|
command: `sudo tee /etc/conf.d/pangolin-site > /dev/null << 'EOF'
|
||||||
|
export SITE_ID=${id}
|
||||||
|
export SITE_SECRET=${secret}
|
||||||
|
export PANGOLIN_ENDPOINT=${endpoint}${
|
||||||
|
!acceptClients
|
||||||
|
? `
|
||||||
|
export DISABLE_CLIENTS=true`
|
||||||
|
: ""
|
||||||
|
}${
|
||||||
|
!allowPangolinSsh
|
||||||
|
? `
|
||||||
|
export DISABLE_SSH=true`
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
sudo chmod 600 /etc/conf.d/pangolin-site`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("serviceFile"),
|
||||||
|
command: `sudo tee /etc/init.d/pangolin-site > /dev/null << 'EOF'
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
name="pangolin-site"
|
||||||
|
description="Pangolin Site"
|
||||||
|
|
||||||
|
command="/usr/local/bin/pangolin"
|
||||||
|
command_args="up site"
|
||||||
|
command_background="yes"
|
||||||
|
supervisor="supervise-daemon"
|
||||||
|
|
||||||
|
pidfile="/run/pangolin-site.pid"
|
||||||
|
output_log="/var/log/pangolin-site.log"
|
||||||
|
error_log="/var/log/pangolin-site.err"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need net
|
||||||
|
after firewall
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
sudo chmod +x /etc/init.d/pangolin-site`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("enableAndStart"),
|
||||||
|
command: `sudo rc-update add pangolin-site default
|
||||||
|
sudo rc-service pangolin-site start`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("check"),
|
||||||
|
command: `sudo rc-service pangolin-site status`
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
macos: {
|
macos: {
|
||||||
Run: [
|
Run: [
|
||||||
{
|
{
|
||||||
@@ -478,6 +550,8 @@ function getPlatformIcon(platformName: Platform) {
|
|||||||
return <FaWindows className="h-4 w-4 mr-2" />;
|
return <FaWindows className="h-4 w-4 mr-2" />;
|
||||||
case "linux":
|
case "linux":
|
||||||
return <FaLinux className="h-4 w-4 mr-2" />;
|
return <FaLinux className="h-4 w-4 mr-2" />;
|
||||||
|
case "alpine":
|
||||||
|
return <SiAlpinelinux className="h-4 w-4 mr-2" />;
|
||||||
case "macos":
|
case "macos":
|
||||||
return <FaApple className="h-4 w-4 mr-2" />;
|
return <FaApple className="h-4 w-4 mr-2" />;
|
||||||
case "docker":
|
case "docker":
|
||||||
@@ -501,6 +575,8 @@ function getPlatformName(platformName: Platform) {
|
|||||||
return "Windows";
|
return "Windows";
|
||||||
case "linux":
|
case "linux":
|
||||||
return "Linux";
|
return "Linux";
|
||||||
|
case "alpine":
|
||||||
|
return "Alpine Linux";
|
||||||
case "macos":
|
case "macos":
|
||||||
return "macOS";
|
return "macOS";
|
||||||
case "docker":
|
case "docker":
|
||||||
@@ -522,6 +598,8 @@ function getArchitectures(platform: Platform) {
|
|||||||
switch (platform) {
|
switch (platform) {
|
||||||
case "linux":
|
case "linux":
|
||||||
return ["Run", "Systemd Service", "Manual Systemd Service"];
|
return ["Run", "Systemd Service", "Manual Systemd Service"];
|
||||||
|
case "alpine":
|
||||||
|
return ["Run", "Manual OpenRC Service"];
|
||||||
case "macos":
|
case "macos":
|
||||||
return ["Run", "Service"];
|
return ["Run", "Service"];
|
||||||
case "windows":
|
case "windows":
|
||||||
|
|||||||
Reference in New Issue
Block a user