Merge branch 'main' into fix/ct-setup-nodejs-sync

This commit is contained in:
CanbiZ (MickLesk) authored and GitHub committed 2026-11-23 09:23:48 +01:00
commit 3f2dc899ef
13 files changed
+696 -32

No files matched your search

+115 -25
View File
@@ -207,8 +207,59 @@ jobs:
NVMRC_NODE_MAJOR="$ver"
}
# Same name in the core sense (_forge_is_script_app): case and punctuation
# ignored, equal, or one containing the other with the shorter at least 4 long.
name_matches() {
local a="${1,,}" b="${2,,}" short
a="${a//[^a-z0-9]/}"
b="${b//[^a-z0-9]/}"
[[ -n "$a" && -n "$b" ]] || return 1
[[ "$a" == "$b" ]] && return 0
short="$a"
((${#b} < ${#a})) && short="$b"
((${#short} >= 4)) || return 1
[[ "$a" == *"$b"* || "$b" == *"$a"* ]]
}
# The app's own repo from the GitHub calls in its scripts, for a Source line
# that names a website. Only a repo or app argument matching the script's
# name counts: discourse also deploys libvips, storyteller pulls readium/cli.
# Usage: repo_from_calls "slug" file... => sets REPLY to owner/repo or empty
repo_from_calls() {
local slug="$1" text app repo
shift
REPLY=""
text=$(cat "$@" 2>/dev/null | grep -v '^[[:space:]]*#' || true)
while read -r app repo; do
[[ -z "$repo" || "${repo,,}" == community-scripts/* ]] && continue
if name_matches "$slug" "${repo#*/}" || { [[ "$app" != "-" ]] && name_matches "$slug" "$app"; }; then
REPLY="$repo"
return
fi
done < <(
grep -oP '\b(?:fetch_and_deploy|check_for)_gh_(?:release|tag)\s+"?[^"\s]+"?\s+"?[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+' <<<"$text" |
sed -E 's/^[a-z_]+[[:space:]]+"?([^"[:space:]]+)"?[[:space:]]+"?/\1 /' || true
grep -oP '(?:get_latest_github_release\s+"?|(?<![\w.])github\.com/|api\.github\.com/repos/|codeload\.github\.com/)\K[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+' <<<"$text" |
sed -E 's/\.git$//; s/^/- /' || true
)
}
# NODE_VERSION a script sets: a major, "dynamic", or "unset" (core's default)
node_version_of() {
local v
v=$(grep -oP 'NODE_VERSION=\K"?\d+' "$1" | head -1 | grep -oP '\d+' || echo "")
if [[ -n "$v" ]]; then
echo "$v"
elif grep -q 'NODE_VERSION=\$(' "$1"; then
echo "dynamic"
else
echo "unset"
fi
}
# Collect results
declare -a issue_scripts=()
declare -a sync_scripts=()
declare -a report_lines=()
total=0
checked=0
@@ -222,6 +273,27 @@ jobs:
total=$((total + 1))
slug=$(basename "$script" | sed 's/-install\.sh$//')
our_version=$(node_version_of "$script")
# The update has to run the same setup_nodejs, or a bump in install/
# reaches new containers only. An update with neither a release
# check, a deploy nor a package manager call (a built-in updater,
# "create a new container") has nothing to keep in step.
ct_file="ct/${slug}.sh"
ct_display="—"
if [[ -f "$ct_file" ]] &&
grep -qE '^[^#]*(\b(check_for|fetch_and_deploy)_|(^|[[:space:];&|(])(npm|npx|pnpm|yarn|corepack)[[:space:]])' "$ct_file"; then
if grep -qE '^[^#]*\bsetup_nodejs\b' "$ct_file"; then
ct_version=$(node_version_of "$ct_file")
else
ct_version="none"
fi
ct_display="$ct_version"
if [[ "$ct_version" != "$our_version" ]]; then
ct_display="⚠️ $ct_version"
sync_scripts+=("$slug|$our_version|$ct_version")
fi
fi
# Extract Source URL (GitHub only) from the "# Source:" line
# Supports both:
@@ -229,29 +301,20 @@ jobs:
# # Source: https://example.com | Github: https://github.com/owner/repo
# NOTE: Must filter for "# Source:" line first to avoid matching the License URL
source_url=$(head -20 "$script" | grep -i '# Source:' | grep -oP 'https://github\.com/[^\s|]+' | head -1 || echo "")
if [[ -z "$source_url" ]]; then
report_lines+=("| \`$slug\` | — | — | — | — | ⏭️ No GitHub source |")
continue
repo=$(sed -E 's|https://github\.com/||; s|\.git$||' <<<"$source_url" | cut -d/ -f1,2)
repo_note=""
if [[ ! "$repo" =~ ^[^/]+/[^/]+$ ]]; then
repo_from_calls "$slug" "$script" "$ct_file"
repo="$REPLY"
repo_note=" (from calls)"
fi
repo=$(echo "$source_url" | sed -E 's|https://github\.com/||; s|/$||; s|\.git$||')
if [[ -z "$repo" || "$repo" != */* ]]; then
report_lines+=("| \`$slug\` | — | — | — | — | ⏭️ Invalid repo |")
if [[ -z "$repo" ]]; then
report_lines+=("| \`$slug\` | $our_version | $ct_display | — | — | — | ⏭️ No GitHub source |")
continue
fi
checked=$((checked + 1))
# Extract our NODE_VERSION
our_version=$(grep -oP 'NODE_VERSION=\K"?\d+' "$script" | head -1 | grep -oP '\d+' || echo "")
if [[ -z "$our_version" ]]; then
if grep -q 'NODE_VERSION=\$(' "$script"; then
our_version="dynamic"
else
our_version="unset"
fi
fi
# Determine default branch via GitHub API (fast, single call)
detected_branch=""
api_default=$(curl -sf -H "Authorization: token $GH_TOKEN" \
@@ -352,40 +415,45 @@ jobs:
fi
fi
report_lines+=("| \`$slug\` | $our_version | $engines_display | $dockerfile_display | [$repo](https://github.com/$repo) | $status |")
report_lines+=("| \`$slug\` | $our_version | $ct_display | $engines_display | $dockerfile_display | [$repo](https://github.com/$repo)$repo_note | $status |")
# Rate-limit to avoid GitHub secondary rate limits
sleep 0.3
done
sync_count=${#sync_scripts[@]}
# Print summary
echo ""
echo "========================================="
echo " Total scripts with setup_nodejs: $total"
echo " Checked (with GitHub source): $checked"
echo " Version drift detected: $drift_count"
echo " ct/ update out of step: $sync_count"
echo "========================================="
# Export
{
echo "drift_count=$drift_count"
echo "sync_count=$sync_count"
echo "total=$total"
echo "checked=$checked"
} >> "$GITHUB_OUTPUT"
# Save issue details for next step
printf '%s\n' "${issue_scripts[@]}" > /tmp/drift_scripts.txt 2>/dev/null || touch /tmp/drift_scripts.txt
printf '%s\n' "${sync_scripts[@]}" > /tmp/sync_scripts.txt 2>/dev/null || touch /tmp/sync_scripts.txt
# Save full report
{
echo "## Node.js Version Drift Report"
echo ""
echo "**Generated:** $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "**Scripts checked:** $total | **With GitHub source:** $checked | **Drift detected:** $drift_count"
echo "**Scripts checked:** $total | **With GitHub source:** $checked | **Drift detected:** $drift_count | **ct/ out of step:** $sync_count"
echo ""
echo "| Script | Our Version | engines.node | Dockerfile | Upstream Repo | Status |"
echo "|--------|-------------|-------------|------------|---------------|--------|"
echo "| Script | Our Version | ct/ update | engines.node | Dockerfile | Upstream Repo | Status |"
echo "|--------|-------------|------------|-------------|------------|---------------|--------|"
printf '%s\n' "${report_lines[@]}" | sort
} > /tmp/drift_report.md
@@ -478,12 +546,21 @@ jobs:
continue
fi
# Without the ct/ line the bump reaches new containers only.
ct_note=""
if [[ -f "ct/${slug}.sh" && " ${changed[*]} " != *" ct/${slug}.sh "* ]]; then
ct_note="> [!WARNING]
> \`ct/${slug}.sh\` sets no Node ${our} in its update, so existing containers stay on it. Add \`NODE_VERSION=\"${upstream}\" setup_nodejs\` to the update before merging."
fi
# The test command is written here rather than left to
# pr-test-command.yml: a PR opened with GITHUB_TOKEN does not start
# another workflow, so that comment would never arrive.
body=$(cat <<PR_EOF
\`${slug}\` pins Node **${our}**, upstream indicates **${upstream}** (${hint}) — [upstream repo](https://github.com/${repo}).
${ct_note}
Opened automatically by the weekly Node.js version drift check. **Nothing here has been tested.** Run it against a host before merging:
\`\`\`bash
@@ -528,7 +605,7 @@ jobs:
cat /tmp/drift_prs.txt
- name: Create or update summary issue
if: steps.check.outputs.drift_count != '0'
if: steps.check.outputs.drift_count != '0' || steps.check.outputs.sync_count != '0'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
@@ -537,6 +614,7 @@ jobs:
TITLE="[Automated] Node.js Version Drift Report"
DATE=$(date -u +%Y-%m-%d)
DRIFT_COUNT="${{ steps.check.outputs.drift_count }}"
SYNC_COUNT="${{ steps.check.outputs.sync_count }}"
TOTAL="${{ steps.check.outputs.total }}"
CHECKED="${{ steps.check.outputs.checked }}"
@@ -567,17 +645,29 @@ jobs:
CHECKLIST+="${mark} **\`${slug}\`** — ours: \`${our_version}\` → upstream: \`${upstream_major}\` (${upstream_hint}) — [repo](https://github.com/${repo}) ${note}"$'\n'
done < /tmp/drift_scripts.txt
SYNC_SECTION=""
if [[ "$SYNC_COUNT" != "0" ]]; then
SYNC_SECTION="### ct/ update out of step with install/"$'\n\n'
SYNC_SECTION+="The update does not run the install's \`setup_nodejs\`, so a Node bump reaches new containers only. Put the install's call at the top of the update's release block."$'\n\n'
while IFS='|' read -r slug our_version ct_version; do
[[ -z "$slug" ]] && continue
SYNC_SECTION+="- [ ] **\`${slug}\`** — install/: \`${our_version}\`, ct/ update: \`${ct_version}\`"$'\n'
done < /tmp/sync_scripts.txt
fi
# Build full report table
REPORT=$(cat /tmp/drift_report.md)
BODY=$(cat <<ISSUE_EOF
## Node.js Version Drift Report — ${DATE}
**${DRIFT_COUNT}** script(s) with version drift detected (out of ${CHECKED} checked / ${TOTAL} total).
**${DRIFT_COUNT}** script(s) with version drift detected (out of ${CHECKED} checked / ${TOTAL} total), **${SYNC_COUNT}** ct/ update(s) out of step.
### Scripts requiring investigation
${CHECKLIST}
${CHECKLIST:-None.}
${SYNC_SECTION}
### How to resolve
@@ -616,7 +706,7 @@ jobs:
fi
- name: Close issue if no drift
if: steps.check.outputs.drift_count == '0'
if: steps.check.outputs.drift_count == '0' && steps.check.outputs.sync_count == '0'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
+13 -1
View File
@@ -591,7 +591,9 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
### 🆕 New Scripts
- Anubis [@opastorello](https://github.com/opastorello) ([#18926](https://github.com/community-scripts/ProxmoxVE/pull/18926))
- FreeScout [@MickLesk](https://github.com/MickLesk) ([#18930](https://github.com/community-scripts/ProxmoxVE/pull/18930))
- Anubis [@opastorello](https://github.com/opastorello) ([#18926](https://github.com/community-scripts/ProxmoxVE/pull/18926))
- OpenViking [@mfelipe](https://github.com/mfelipe) ([#18979](https://github.com/community-scripts/ProxmoxVE/pull/18979))
- Oracle Linux [@MickLesk](https://github.com/MickLesk) ([#18945](https://github.com/community-scripts/ProxmoxVE/pull/18945))
- Kali Linux [@MickLesk](https://github.com/MickLesk) ([#18946](https://github.com/community-scripts/ProxmoxVE/pull/18946))
- Linux Mint [@MickLesk](https://github.com/MickLesk) ([#18948](https://github.com/community-scripts/ProxmoxVE/pull/18948))
@@ -600,9 +602,19 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### 🐞 Bug Fixes
- portabase: bump Node.js from 22 to 24 [@github-actions[bot]](https://github.com/github-actions[bot]) ([#18988](https://github.com/community-scripts/ProxmoxVE/pull/18988))
- t3code: bump Node.js from 24 to 26 [@github-actions[bot]](https://github.com/github-actions[bot]) ([#18959](https://github.com/community-scripts/ProxmoxVE/pull/18959))
- airconnect: fix disabled service restart, static binary cleanup, and flag overrides [@cwmoriarty](https://github.com/cwmoriarty) ([#18955](https://github.com/community-scripts/ProxmoxVE/pull/18955))
- bulwark: bump Node.js from 24 to 26 [@github-actions[bot]](https://github.com/github-actions[bot]) ([#18957](https://github.com/community-scripts/ProxmoxVE/pull/18957))
### 🧰 Tools
- wg-easy ([#18972](https://github.com/community-scripts/ProxmoxVE/pull/18972))
### 📚 Documentation
- github node drift: find the repo from the script's calls, check ct/ and install/ [@MickLesk](https://github.com/MickLesk) ([#18984](https://github.com/community-scripts/ProxmoxVE/pull/18984))
## 2026-11-22
### 🆕 New Scripts
+1 -2
View File
@@ -32,8 +32,7 @@ function update_script() {
fi
if check_for_gh_release "directus" "directus/directus"; then
NODE_VERSION="22" setup_nodejs
NODE_VERSION="26" setup_nodejs
msg_info "Stopping Service"
systemctl stop directus
msg_ok "Stopped Service"
+70
View File
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/freescout-help-desk/freescout
APP="FreeScout"
var_tags="${var_tags:-helpdesk;ticketing}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-6}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_admin_email="${var_admin_email:-}"
export var_admin_pass="${var_admin_pass:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/freescout ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "freescout" "freescout-help-desk/freescout"; then
msg_info "Stopping FreeScout"
systemctl stop cron nginx php8.4-fpm
pkill -u www-data -f artisan || true
msg_ok "Stopped FreeScout"
create_backup /opt/freescout/.env
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="storage Modules public/modules" fetch_and_deploy_gh_release "freescout" "freescout-help-desk/freescout" "tarball"
restore_backup
msg_info "Updating FreeScout"
cd /opt/freescout
$STD php artisan freescout:after-app-update
$STD php artisan storage:link
chown -R www-data:www-data /opt/freescout
msg_ok "Updated FreeScout"
msg_info "Starting FreeScout"
systemctl start php8.4-fpm nginx cron
msg_ok "Started FreeScout"
msg_ok "Updated successfully!"
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}${CL}"
echo -e "${INFO}${YW}Admin credentials: ~/freescout.creds (inside the container)${CL}"
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Marcos Felipe (mfelipe)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/volcengine/OpenViking
APP="OpenViking"
var_tags="${var_tags:-ai;memory;rag}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/openviking ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating Debian Packages"
$STD apt update
$STD apt -y upgrade
msg_ok "Updated Debian Packages"
if check_for_gh_release "openviking-server" "volcengine/OpenViking"; then
msg_info "Stopping Service"
systemctl stop openviking
msg_ok "Stopped Service"
msg_info "Updating OpenViking"
$STD uv pip install --python /opt/openviking/bin/python --upgrade openviking
msg_ok "Updated OpenViking"
msg_info "Starting Service"
systemctl start openviking
msg_ok "Started Service"
msg_ok "Updated successfully!"
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 "${TAB}${GATEWAY}${BGN}http://${IP}:1933/studio${CL}"
+1 -1
View File
@@ -78,7 +78,7 @@ EOF
create_backup /opt/portabase/.env
NODE_VERSION="22" NODE_MODULE="pnpm@11.8.0" setup_nodejs
NODE_VERSION="24" NODE_MODULE="pnpm@11.8.0" setup_nodejs
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "portabase" "Portabase/portabase" "tarball"
+2
View File
@@ -30,6 +30,8 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
NODE_VERSION="26" setup_nodejs
msg_info "Stopping Service"
systemctl stop t3code
+1 -1
View File
@@ -17,7 +17,7 @@ msg_info "Installing Dependencies"
$STD apt install -y build-essential
msg_ok "Installed Dependencies"
NODE_VERSION="22" setup_nodejs
NODE_VERSION="26" setup_nodejs
PG_VERSION="17" setup_postgresql
PG_DB_NAME="directus" PG_DB_USER="directus" setup_postgresql_db
+124
View File
@@ -0,0 +1,124 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/freescout-help-desk/freescout
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
var_admin_email="${var_admin_email:-admin@example.com}"
if [[ ! "$var_admin_email" =~ ^[^@[:space:]]+@[^@[:space:]]+\.[^@[:space:]]+$ ]]; then
msg_warn "Invalid admin email '${var_admin_email}', using admin@example.com"
var_admin_email="admin@example.com"
fi
var_admin_pass="${var_admin_pass:-$(random_password 16)}"
msg_info "Installing Dependencies"
$STD apt install -y nginx
msg_ok "Installed Dependencies"
setup_mariadb
MARIADB_DB_NAME="freescout" MARIADB_DB_USER="freescout" setup_mariadb_db
PHP_VERSION="8.4" PHP_FPM="YES" setup_php
fetch_and_deploy_gh_release "freescout" "freescout-help-desk/freescout" "tarball"
msg_info "Configuring FreeScout"
cd /opt/freescout
cat <<EOF >/opt/freescout/.env
APP_URL=http://${LOCAL_IP}
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=freescout
DB_USERNAME=freescout
DB_PASSWORD=${MARIADB_DB_PASS}
APP_KEY=
EOF
$STD php artisan key:generate --force
$STD php artisan storage:link
$STD php artisan migrate --force
$STD php artisan freescout:create-user --role=admin --firstName=Admin --lastName=FreeScout --email="$var_admin_email" --password="$var_admin_pass" --no-interaction
touch /opt/freescout/storage/.installed
$STD php artisan freescout:clear-cache
chown -R www-data:www-data /opt/freescout
cat <<EOF >>~/freescout.creds
FreeScout Admin
Email: ${var_admin_email}
Password: ${var_admin_pass}
EOF
chmod 600 ~/freescout.creds
msg_ok "Configured FreeScout"
msg_info "Configuring Nginx"
sed -i 's/^;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/8.4/fpm/php.ini
systemctl restart php8.4-fpm
PHP_SOCK=$(get_php_fpm_socket)
cat <<EOF >/etc/nginx/sites-available/freescout
server {
listen 80;
listen [::]:80;
server_name _;
root /opt/freescout/public;
index index.php index.html index.htm;
client_max_body_size 128M;
location / {
try_files \$uri \$uri/ /index.php?\$query_string;
}
location ~ \.php\$ {
fastcgi_split_path_info ^(.+\.php)(/.+)\$;
fastcgi_pass unix:${PHP_SOCK};
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/storage/attachment/ {
expires 1M;
access_log off;
try_files \$uri \$uri/ /index.php?\$query_string;
}
location ~* ^/(?:css|js)/.*\.(?:css|js)\$ {
expires 2d;
access_log off;
add_header Cache-Control "public, must-revalidate";
add_header X-Content-Type-Options "nosniff";
}
location ~* ^/storage/.*\.((?!(jpg|jpeg|jfif|pjpeg|pjp|apng|bmp|gif|ico|cur|png|tif|tiff|webp|pdf|txt|diff|patch|json|mp3|wav|ogg|wma)).)*\$ {
add_header Content-disposition "attachment; filename=\$2";
add_header X-Content-Type-Options "nosniff";
default_type application/octet-stream;
}
location ~* ^/(storage/|.*\.).*\$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
add_header X-Content-Type-Options "nosniff";
}
location ~ /\. {
deny all;
}
}
EOF
nginx_enable_site "freescout"
msg_ok "Configured Nginx"
msg_info "Setting up Cron"
cat <<EOF >/etc/cron.d/freescout
* * * * * www-data php /opt/freescout/artisan schedule:run >/dev/null 2>&1
EOF
systemctl enable -q --now cron
msg_ok "Set up Cron"
motd_ssh
customize
cleanup_lxc
+108
View File
@@ -0,0 +1,108 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Marcos Felipe (mfelipe)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/volcengine/OpenViking
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y openssl
msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv
msg_info "Installing OpenViking"
$STD uv venv --python 3.12 /opt/openviking
$STD uv pip install --python /opt/openviking/bin/python openviking
cat <<EOF >~/.openviking-server
$(get_latest_github_release "volcengine/OpenViking")
EOF
msg_ok "Installed OpenViking"
msg_info "Configuring OpenViking"
ROOT_API_KEY=$(openssl rand -hex 32)
mkdir -p /opt/openviking_data
cat <<EOF >/opt/openviking_data/ov.conf
{
"server": {
"host": "0.0.0.0",
"port": 1933,
"root_api_key": "${ROOT_API_KEY}",
"cors_origins": ["*"]
},
"storage": {
"workspace": "/opt/openviking_data/data",
"agfs": { "backend": "local" },
"vectordb": { "backend": "local" }
},
"embedding": {
"dense": {
"api_base": "https://api.openai.com/v1",
"api_key": "REPLACE_WITH_YOUR_EMBEDDING_API_KEY",
"provider": "openai",
"dimension": 1536,
"model": "text-embedding-3-small"
}
},
"vlm": {
"api_base": "https://api.openai.com/v1",
"api_key": "REPLACE_WITH_YOUR_VLM_API_KEY",
"provider": "openai",
"model": "gpt-4o"
}
}
EOF
chmod 600 /opt/openviking_data/ov.conf
msg_ok "Configured OpenViking"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/openviking.service
[Unit]
Description=OpenViking HTTP Server
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/openviking_data
Environment="OPENVIKING_CONFIG_FILE=/opt/openviking_data/ov.conf"
ExecStart=/opt/openviking/bin/openviking-server
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now openviking
ready=0
for _ in {1..60}; do
if curl -fsS -o /dev/null "http://127.0.0.1:1933/health"; then
ready=1
break
fi
sleep 2
done
if [[ "$ready" -ne 1 ]]; then
msg_warn "OpenViking did not become healthy within 120 seconds — check 'systemctl status openviking'"
fi
msg_ok "Created Service"
msg_info "Running OpenViking Doctor"
if OPENVIKING_CONFIG_FILE=/opt/openviking_data/ov.conf /opt/openviking/bin/openviking-server doctor >/dev/null 2>&1; then
msg_ok "Doctor check passed"
else
msg_warn "Doctor check reported warnings — configure the model API keys in /opt/openviking_data/ov.conf and restart the service"
fi
motd_ssh
customize
cleanup_lxc
+1 -1
View File
@@ -20,7 +20,7 @@ $STD apt install -y \
nginx
msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@11.8.0" setup_nodejs
NODE_VERSION="24" NODE_MODULE="pnpm@11.8.0" setup_nodejs
PG_VERSION="17" setup_postgresql
PG_DB_NAME="portabase" PG_DB_USER="portabase" setup_postgresql_db
+1 -1
View File
@@ -20,7 +20,7 @@ $STD apt install -y \
bubblewrap
msg_ok "Installed Dependencies"
NODE_VERSION="24" setup_nodejs
NODE_VERSION="26" setup_nodejs
msg_info "Installing T3 Code and Provider CLIs"
$STD npm install -g \
+196
View File
@@ -0,0 +1,196 @@
#!/usr/bin/env bash
# community-scripts ORG | wg-easy Addon Installer
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/wg-easy/wg-easy
if command -v curl >/dev/null 2>&1; then
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/core.func")
load_functions
elif command -v wget >/dev/null 2>&1; then
source <(wget -qO- "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/core.func")
load_functions
fi
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/lib/tools.func")
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/error_handler.func")
color
catch_errors
APP="wg-easy"
APP_TYPE="addon"
header_info "$APP"
require_debian_like
confirm_not_pve_host
get_lxc_ip
function build_wgeasy() {
cd /opt/wg-easy/src || exit
$STD pnpm install --frozen-lockfile
$STD pnpm build
mkdir -p .output/server/database
cp -r server/database/migrations .output/server/database/
}
function install_wgeasy() {
if [[ -d /etc/wgdashboard ]]; then
msg_error "WGDashboard is installed in this container. wg-easy and WGDashboard would both manage wg0 - install wg-easy in its own LXC."
exit 1
fi
if [[ -f /etc/wireguard/wg0.conf ]]; then
msg_error "/etc/wireguard/wg0.conf already exists and wg-easy would overwrite it - install wg-easy in its own LXC."
exit 1
fi
if ! ip link add wgeasy-probe type wireguard &>/dev/null; then
msg_error "wg-easy cannot create a WireGuard interface in this container."
msg_error "Load the module on the Proxmox VE host: modprobe wireguard && echo wireguard >/etc/modules-load.d/wireguard.conf"
exit 1
fi
ip link del wgeasy-probe
local MEM_MB
MEM_MB=$(awk '/MemTotal/ {printf "%.0f", $2/1024}' /proc/meminfo)
if ((MEM_MB < 2048)); then
msg_error "Insufficient memory: ${MEM_MB} MB detected. At least 2048 MB RAM is required to build wg-easy."
exit 1
fi
cat <<EOF >/etc/sysctl.d/99-wg-easy.conf
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
EOF
sysctl -q -p /etc/sysctl.d/99-wg-easy.conf &>/dev/null || true
if [[ "$(sysctl -n net.ipv4.ip_forward)" != "1" ]]; then
rm -f /etc/sysctl.d/99-wg-easy.conf
msg_error "wg-easy needs IP forwarding, but net.ipv4.ip_forward cannot be enabled in this container."
exit 1
fi
local DISABLE_IPV6="false"
[[ "$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6 2>/dev/null)" == "0" ]] || DISABLE_IPV6="true"
if [[ "$(ip route show default | awk '{print $5; exit}')" != "eth0" ]]; then
msg_warn "The default route is not on eth0 - set the device in wg-easy under Admin > Interface after setup."
fi
local WG_HOST ADMIN_PASS
WG_HOST=$(prompt_input_required "wg-easy endpoint (public DNS name or IP your clients connect to):" "$LOCAL_IP" 120 "var_wg_host")
[[ "$WG_HOST" == *:* && "$WG_HOST" != \[* ]] && WG_HOST="[${WG_HOST}]"
msg_info "Installing Dependencies"
ensure_dependencies wireguard-tools iptables
msg_ok "Installed Dependencies"
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
fetch_and_deploy_gh_release "wg-easy" "wg-easy/wg-easy" "tarball"
msg_info "Building wg-easy"
build_wgeasy
mv /opt/wg-easy/src/.output /opt/wg-easy/app
msg_ok "Built wg-easy"
msg_info "Configuring wg-easy"
ADMIN_PASS=$(random_password)
cat <<EOF >/opt/wg-easy/.env
PORT=51821
HOST=0.0.0.0
INSECURE=true
DISABLE_IPV6=${DISABLE_IPV6}
DEBUG=Server,WireGuard,Database,CMD,Firewall
INIT_ENABLED=true
INIT_USERNAME=admin
INIT_PASSWORD=${ADMIN_PASS}
INIT_HOST=${WG_HOST}
INIT_PORT=51820
EOF
chmod 600 /opt/wg-easy/.env
cat <<'EOF' >/usr/local/bin/wg-easy-cli
#!/usr/bin/env bash
set -a
source /opt/wg-easy/.env
set +a
exec node /opt/wg-easy/app/server/cli.mjs "$@"
EOF
chmod +x /usr/local/bin/wg-easy-cli
cat <<EOF >/etc/systemd/system/wg-easy.service
[Unit]
Description=wg-easy
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/wg-easy/app
EnvironmentFile=/opt/wg-easy/.env
ExecStart=/usr/bin/node server/index.mjs
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now wg-easy
msg_ok "Configured wg-easy"
echo ""
msg_ok "wg-easy is reachable at: ${BL}http://${LOCAL_IP}:51821${CL}"
echo -e "${INFO}${YW}Username:${CL} admin"
echo -e "${INFO}${YW}Password:${CL} ${ADMIN_PASS}"
echo -e "${INFO}${YW}Clients connect to ${CL}${WG_HOST}:51820/udp${YW} - forward UDP 51820 on your router to ${CL}${LOCAL_IP}${YW}, keep TCP 51821 on the LAN.${CL}"
if [[ "$WG_HOST" == "$LOCAL_IP" ]]; then
msg_warn "No public endpoint was set - change the host in wg-easy under Admin > Config before adding clients."
fi
}
function update_wgeasy() {
if check_for_gh_release "wg-easy" "wg-easy/wg-easy"; then
NODE_VERSION="24" NODE_MODULE="corepack" setup_nodejs
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP=".env app" fetch_and_deploy_gh_release "wg-easy" "wg-easy/wg-easy" "tarball"
msg_info "Building wg-easy"
build_wgeasy
msg_ok "Built wg-easy"
# Swapped only after the build: the tunnel stays up meanwhile, so an update run over the VPN does not cut itself off
msg_info "Restarting wg-easy"
rm -rf /opt/wg-easy/app
mv /opt/wg-easy/src/.output /opt/wg-easy/app
systemctl restart wg-easy
msg_ok "Restarted wg-easy"
msg_ok "Updated wg-easy"
fi
}
function uninstall_wgeasy() {
msg_info "Uninstalling wg-easy"
systemctl disable -q --now wg-easy
wg-quick down wg0 &>/dev/null || true
rm -f /etc/systemd/system/wg-easy.service /usr/local/bin/wg-easy-cli /etc/sysctl.d/99-wg-easy.conf "$HOME/.wg-easy"
systemctl daemon-reload
rm -rf /opt/wg-easy /etc/wireguard/wg-easy.db /etc/wireguard/wg0.conf
msg_ok "Uninstalled wg-easy"
}
if [[ -f /etc/systemd/system/wg-easy.service ]]; then
if [[ "${type:-}" == "update" ]]; then
update_wgeasy
exit 0
fi
read -r -p "${TAB}Update (1), Uninstall (2), Cancel (3)? [1/2/3]: " action || action=""
action="${action//[[:space:]]/}"
case "$action" in
1) update_wgeasy ;;
2) uninstall_wgeasy ;;
3) msg_warn "No changes made to wg-easy" ;;
*) msg_error "Invalid input - no changes made to wg-easy" ;;
esac
else
read -r -p "${TAB}Install wg-easy? (y/n): " answer || answer=""
answer="${answer//[[:space:]]/}"
if [[ "${answer,,}" =~ ^(y|yes)$ ]]; then
install_wgeasy
else
msg_warn "wg-easy installation skipped"
fi
fi