mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-11 08:32:13 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a81e7e5e5 | |||
| 08c84bd89d | |||
| d371b5d9bd | |||
| 1b1004ad86 | |||
| f3836df6ac | |||
| 5530b426a3 | |||
| e3472681c9 | |||
| cfa1f504e3 | |||
| 38423262c8 |
@@ -1,6 +0,0 @@
|
||||
_ __ __
|
||||
/ | / /__ _ __/ /____ _________ ___
|
||||
/ |/ / _ \| |/_/ __/ _ \/ ___/ __ `__ \
|
||||
/ /| / __/> </ /_/ __/ / / / / / / /
|
||||
/_/ |_/\___/_/|_|\__/\___/_/ /_/ /_/ /_/
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Mathias Wagner (gnmyt)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://nexterm.dev/
|
||||
|
||||
APP="Nexterm"
|
||||
var_tags="${var_tags:-server-management}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-6}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-no}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /opt/nexterm/server/nexterm-server ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nexterm-engine" "gnmyt/Nexterm"; then
|
||||
msg_info "Stopping nexterm-engine"
|
||||
systemctl stop nexterm-engine
|
||||
msg_ok "Stopped nexterm-engine"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "nexterm-engine" "gnmyt/Nexterm" "prebuild" "latest" "/opt/nexterm/engine" "nexterm-engine-linux-${NX_ARCH}.tar.gz"
|
||||
|
||||
msg_info "Starting nexterm-engine"
|
||||
systemctl start nexterm-engine
|
||||
msg_ok "Started nexterm-engine"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nexterm-server" "gnmyt/Nexterm"; then
|
||||
msg_info "Stopping nexterm-server"
|
||||
systemctl stop nexterm-server
|
||||
msg_ok "Stopped nexterm-server"
|
||||
|
||||
fetch_and_deploy_gh_release "nexterm-server" "gnmyt/Nexterm" "singlefile" "latest" "/opt/nexterm/server" "nexterm-server-linux-${NX_ARCH}"
|
||||
|
||||
msg_info "Starting nexterm-server"
|
||||
systemctl start nexterm-server
|
||||
msg_ok "Started nexterm-server"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}http://${IP}:6989${CL}"
|
||||
+14
-19
@@ -6,7 +6,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
||||
# Source: https://pangolin.net/ | Github: https://github.com/fosrl/pangolin
|
||||
|
||||
APP="Pangolin"
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.18.4}"
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.20.0}"
|
||||
var_tags="${var_tags:-proxy}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
@@ -33,6 +33,15 @@ function update_script() {
|
||||
|
||||
ensure_dependencies build-essential python3
|
||||
|
||||
if ! command -v psql &>/dev/null; then
|
||||
msg_error "This installation uses SQLite and cannot be upgraded to Pangolin ${PANGOLIN_VERSION}."
|
||||
echo -e "${INFO}${YW}Starting with Pangolin 1.20.0, PostgreSQL is required as the database backend.${CL}"
|
||||
echo -e "${INFO}${YW}An automatic migration of your existing SQLite data is not supported.${CL}"
|
||||
echo -e "${INFO}${YW}Please create a new LXC with the Pangolin install script, which sets up PostgreSQL automatically.${CL}"
|
||||
echo -e "${INFO}${YW}Your current data is preserved in this container and can be manually migrated if needed.${CL}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
|
||||
if check_for_gh_release "pangolin" "fosrl/pangolin" "$PANGOLIN_VERSION" "Pinned to a tested release because Pangolin's schema changes have repeatedly broken unattended updates. To try a newer version at your own risk, run: 'export PANGOLIN_VERSION=<tag>' and re-run update. If it breaks, please open an issue at https://github.com/community-scripts/ProxmoxVE/issues with the error log."; then
|
||||
@@ -41,13 +50,7 @@ function update_script() {
|
||||
systemctl stop gerbil
|
||||
msg_info "Service stopped"
|
||||
|
||||
msg_info "Creating backup"
|
||||
tar -czf /opt/pangolin_config_backup.tar.gz -C /opt/pangolin config
|
||||
if [[ -f /opt/pangolin/config/db/db.sqlite ]]; then
|
||||
cp -a /opt/pangolin/config/db/db.sqlite \
|
||||
"/opt/pangolin/config/db/db.sqlite.pre-${PANGOLIN_VERSION}-$(date +%Y%m%d-%H%M%S).bak"
|
||||
fi
|
||||
msg_ok "Created backup"
|
||||
create_backup /opt/pangolin/config
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "pangolin" "fosrl/pangolin" "tarball" "$PANGOLIN_VERSION"
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "gerbil" "fosrl/gerbil" "singlefile" "latest" "/usr/bin" "gerbil_linux_$(arch_resolve)"
|
||||
@@ -55,7 +58,7 @@ function update_script() {
|
||||
msg_info "Updating Pangolin"
|
||||
cd /opt/pangolin
|
||||
$STD npm ci
|
||||
$STD npm run set:sqlite
|
||||
$STD npm run set:pg
|
||||
$STD npm run set:oss
|
||||
rm -rf server/private
|
||||
$STD npm run db:generate
|
||||
@@ -68,10 +71,7 @@ function update_script() {
|
||||
cp server/db/mac_models.json ./dist/mac_models.json
|
||||
msg_ok "Updated Pangolin"
|
||||
|
||||
msg_info "Restoring config"
|
||||
tar -xzf /opt/pangolin_config_backup.tar.gz -C /opt/pangolin --overwrite
|
||||
rm -f /opt/pangolin_config_backup.tar.gz
|
||||
msg_ok "Restored config"
|
||||
restore_backup
|
||||
|
||||
if ! grep -q '^ExecStartPre=/usr/bin/node dist/migrations.mjs' /etc/systemd/system/pangolin.service 2>/dev/null; then
|
||||
msg_info "Adding migration step to pangolin.service"
|
||||
@@ -82,13 +82,8 @@ function update_script() {
|
||||
|
||||
msg_info "Running database migrations"
|
||||
cd /opt/pangolin
|
||||
SQLITE_DB="/opt/pangolin/config/db/db.sqlite"
|
||||
if [[ -f "$SQLITE_DB" ]]; then
|
||||
if ! sqlite3 "$SQLITE_DB" ".tables" 2>/dev/null | tr ' ' '\n' | grep -qx "statusHistory"; then
|
||||
sqlite3 "$SQLITE_DB" "DELETE FROM versionMigrations;" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
ENVIRONMENT=prod $STD node dist/migrations.mjs
|
||||
|
||||
msg_ok "Ran database migrations"
|
||||
|
||||
msg_info "Updating Badger plugin version"
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: Mathias Wagner (gnmyt)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://nexterm.dev/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
case "$(dpkg --print-architecture)" in
|
||||
amd64) NX_ARCH="x64" ;;
|
||||
arm64) NX_ARCH="arm64" ;;
|
||||
*)
|
||||
msg_error "Unsupported architecture: $(dpkg --print-architecture)"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
fetch_and_deploy_gh_release "nexterm-engine" "gnmyt/Nexterm" "prebuild" "latest" "/opt/nexterm/engine" "nexterm-engine-linux-${NX_ARCH}.tar.gz"
|
||||
fetch_and_deploy_gh_release "nexterm-server" "gnmyt/Nexterm" "singlefile" "latest" "/opt/nexterm/server" "nexterm-server-linux-${NX_ARCH}"
|
||||
|
||||
msg_info "Configuring Nexterm"
|
||||
LOCAL_ENGINE_TOKEN=$(tr -d '-' </proc/sys/kernel/random/uuid)$(tr -d '-' </proc/sys/kernel/random/uuid)
|
||||
ENCRYPTION_KEY=$(tr -d '-' </proc/sys/kernel/random/uuid)$(tr -d '-' </proc/sys/kernel/random/uuid)
|
||||
|
||||
mkdir -p /etc/nexterm-engine /etc/nexterm-server /opt/nexterm/data
|
||||
cat <<EOF >/etc/nexterm-engine/config.yaml
|
||||
server_host: "127.0.0.1"
|
||||
server_port: 7800
|
||||
registration_token: "${LOCAL_ENGINE_TOKEN}"
|
||||
tls: false
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/nexterm-server/server.env
|
||||
NODE_ENV=production
|
||||
SERVER_PORT=6989
|
||||
LOCAL_ENGINE_TOKEN=${LOCAL_ENGINE_TOKEN}
|
||||
ENCRYPTION_KEY=${ENCRYPTION_KEY}
|
||||
EOF
|
||||
chmod 0640 /etc/nexterm-engine/config.yaml /etc/nexterm-server/server.env
|
||||
msg_ok "Configured Nexterm"
|
||||
|
||||
msg_info "Creating Server Service"
|
||||
cat <<EOF >/etc/systemd/system/nexterm-server.service
|
||||
[Unit]
|
||||
Description=Nexterm Server
|
||||
Documentation=https://docs.nexterm.dev/
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/nexterm/data
|
||||
EnvironmentFile=/etc/nexterm-server/server.env
|
||||
ExecStart=/opt/nexterm/server/nexterm-server
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now nexterm-server
|
||||
msg_ok "Created Server Service"
|
||||
|
||||
msg_info "Creating Engine Service"
|
||||
cat <<EOF >/etc/systemd/system/nexterm-engine.service
|
||||
[Unit]
|
||||
Description=Nexterm Engine
|
||||
Documentation=https://docs.nexterm.dev/
|
||||
After=network-online.target nexterm-server.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/etc/nexterm-engine
|
||||
Environment=FREERDP_EXTENSION_PATH=/opt/nexterm/engine/lib/freerdp2
|
||||
Environment=LD_LIBRARY_PATH=/opt/nexterm/engine/lib
|
||||
ExecStart=/opt/nexterm/engine/nexterm-engine
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now nexterm-engine
|
||||
msg_ok "Created Engine Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -17,12 +17,13 @@ msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
build-essential \
|
||||
python3 \
|
||||
sqlite3 \
|
||||
iptables
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.18.4}"
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="pangolin" PG_DB_USER="pangolin" setup_postgresql_db
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.20.0}"
|
||||
fetch_and_deploy_gh_release "pangolin" "fosrl/pangolin" "tarball" "$PANGOLIN_VERSION"
|
||||
fetch_and_deploy_gh_release "gerbil" "fosrl/gerbil" "singlefile" "latest" "/usr/bin" "gerbil_linux_$(arch_resolve)"
|
||||
fetch_and_deploy_gh_release "traefik" "traefik/traefik" "prebuild" "latest" "/usr/bin" "traefik_v*_linux_$(arch_resolve).tar.gz"
|
||||
@@ -36,7 +37,7 @@ BADGER_VERSION=$(get_latest_github_release "fosrl/badger" "false")
|
||||
cd /opt/pangolin
|
||||
mkdir -p /opt/pangolin/config/{traefik,db,letsencrypt,logs}
|
||||
$STD npm ci
|
||||
$STD npm run set:sqlite
|
||||
$STD npm run set:pg
|
||||
$STD npm run set:oss
|
||||
rm -rf server/private
|
||||
$STD npm run db:generate
|
||||
@@ -74,6 +75,9 @@ flags:
|
||||
require_email_verification: false
|
||||
disable_signup_without_invite: false
|
||||
disable_user_create_org: false
|
||||
|
||||
postgres:
|
||||
connection_string: "postgresql://pangolin:${PG_DB_PASS}@localhost:5432/pangolin"
|
||||
EOF
|
||||
|
||||
cat <<EOF >/opt/pangolin/config/traefik/traefik_config.yml
|
||||
@@ -181,7 +185,8 @@ http:
|
||||
servers:
|
||||
- url: "http://$LOCAL_IP:3000"
|
||||
EOF
|
||||
$STD npm run db:push
|
||||
export ENVIRONMENT=prod
|
||||
$STD node dist/migrations.mjs
|
||||
|
||||
. /etc/os-release
|
||||
if [ "$VERSION_CODENAME" = "trixie" ]; then
|
||||
@@ -197,7 +202,8 @@ msg_info "Creating Services"
|
||||
cat <<EOF >/etc/systemd/system/pangolin.service
|
||||
[Unit]
|
||||
Description=Pangolin Service
|
||||
After=network.target
|
||||
After=network.target postgresql.service
|
||||
Wants=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
Reference in New Issue
Block a user