mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-11 00:22:13 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4346e3c14c | |||
| 5a5931ab74 | |||
| 6ada844abe |
@@ -0,0 +1,6 @@
|
||||
__ ______ __
|
||||
/ /_____ _____ _________ ____ _ __/ __/ /___ _/ /_____
|
||||
/ __/ __ \/ ___/_____/ ___/ __ \/ __ \ | /| / / /_/ / __ `/ //_/ _ \
|
||||
/ /_/ /_/ / / /_____(__ ) / / / /_/ / |/ |/ / __/ / /_/ / ,< / __/
|
||||
\__/\____/_/ /____/_/ /_/\____/|__/|__/_/ /_/\__,_/_/|_|\___/
|
||||
|
||||
+19
-14
@@ -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.20.0}"
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.18.4}"
|
||||
var_tags="${var_tags:-proxy}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
@@ -33,15 +33,6 @@ 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
|
||||
@@ -50,7 +41,13 @@ function update_script() {
|
||||
systemctl stop gerbil
|
||||
msg_info "Service stopped"
|
||||
|
||||
create_backup /opt/pangolin/config
|
||||
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"
|
||||
|
||||
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)"
|
||||
@@ -58,7 +55,7 @@ function update_script() {
|
||||
msg_info "Updating Pangolin"
|
||||
cd /opt/pangolin
|
||||
$STD npm ci
|
||||
$STD npm run set:pg
|
||||
$STD npm run set:sqlite
|
||||
$STD npm run set:oss
|
||||
rm -rf server/private
|
||||
$STD npm run db:generate
|
||||
@@ -71,7 +68,10 @@ function update_script() {
|
||||
cp server/db/mac_models.json ./dist/mac_models.json
|
||||
msg_ok "Updated Pangolin"
|
||||
|
||||
restore_backup
|
||||
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"
|
||||
|
||||
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,8 +82,13 @@ 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"
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: KernelSailor
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://snowflake.torproject.org/
|
||||
|
||||
APP="tor-snowflake"
|
||||
var_tags="${var_tags:-privacy;proxy;tor}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-4}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_nesting="${var_nesting:-0}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
msg_info "Updating Container OS"
|
||||
$STD apt update
|
||||
$STD apt upgrade -y
|
||||
msg_ok "Updated Container OS"
|
||||
|
||||
RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//')
|
||||
if [[ ! -f ~/.tor-snowflake ]] || [[ "${RELEASE}" != "$(cat ~/.tor-snowflake)" ]]; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop snowflake-proxy
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
setup_go
|
||||
fetch_and_deploy_from_url "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v${RELEASE}/snowflake-v${RELEASE}.tar.gz" "/opt/tor-snowflake"
|
||||
|
||||
msg_info "Updating Snowflake"
|
||||
cd /opt/tor-snowflake/proxy
|
||||
$STD go build -o snowflake-proxy .
|
||||
echo "${RELEASE}" >~/.tor-snowflake
|
||||
msg_ok "Updated Snowflake to v${RELEASE}"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start snowflake-proxy
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
else
|
||||
msg_ok "No update required. Snowflake is already at v${RELEASE}."
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
@@ -17,13 +17,12 @@ msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
build-essential \
|
||||
python3 \
|
||||
sqlite3 \
|
||||
iptables
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="pangolin" PG_DB_USER="pangolin" setup_postgresql_db
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.20.0}"
|
||||
PANGOLIN_VERSION="${PANGOLIN_VERSION:-1.18.4}"
|
||||
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"
|
||||
@@ -37,7 +36,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:pg
|
||||
$STD npm run set:sqlite
|
||||
$STD npm run set:oss
|
||||
rm -rf server/private
|
||||
$STD npm run db:generate
|
||||
@@ -75,9 +74,6 @@ 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
|
||||
@@ -185,8 +181,7 @@ http:
|
||||
servers:
|
||||
- url: "http://$LOCAL_IP:3000"
|
||||
EOF
|
||||
export ENVIRONMENT=prod
|
||||
$STD node dist/migrations.mjs
|
||||
$STD npm run db:push
|
||||
|
||||
. /etc/os-release
|
||||
if [ "$VERSION_CODENAME" = "trixie" ]; then
|
||||
@@ -202,8 +197,7 @@ msg_info "Creating Services"
|
||||
cat <<EOF >/etc/systemd/system/pangolin.service
|
||||
[Unit]
|
||||
Description=Pangolin Service
|
||||
After=network.target postgresql.service
|
||||
Wants=postgresql.service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: KernelSailor
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://snowflake.torproject.org/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_go
|
||||
|
||||
msg_info "Building Snowflake"
|
||||
RELEASE=$(curl -fsSL https://gitlab.torproject.org/api/v4/projects/tpo%2Fanti-censorship%2Fpluggable-transports%2Fsnowflake/releases | jq -r '.[0].tag_name' | sed 's/^v//')
|
||||
$STD curl -fsSL "https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v${RELEASE}/snowflake-v${RELEASE}.tar.gz" -o /opt/snowflake.tar.gz
|
||||
$STD tar -xzf /opt/snowflake.tar.gz -C /opt
|
||||
rm -rf /opt/snowflake.tar.gz
|
||||
mv /opt/snowflake-v${RELEASE} /opt/tor-snowflake
|
||||
cd /opt/tor-snowflake/proxy
|
||||
$STD go build -o snowflake-proxy .
|
||||
echo "${RELEASE}" >~/.tor-snowflake
|
||||
msg_ok "Built Snowflake Proxy v${RELEASE}"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/snowflake-proxy.service
|
||||
[Unit]
|
||||
Description=Snowflake Proxy Service
|
||||
Documentation=https://snowflake.torproject.org/
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/tor-snowflake/proxy
|
||||
ExecStart=/opt/tor-snowflake/proxy/snowflake-proxy -verbose -unsafe-logging
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now snowflake-proxy
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user