Compare commits

..

3 Commits

Author SHA1 Message Date
80744bff10 Update add-iptag.json 2025-07-07 13:26:42 +02:00
465ea54d04 warning > info 2025-07-07 13:23:08 +02:00
8ec6ddcf74 IP-Tag: Optimizations / Guide / Manual Execution 2025-07-07 13:19:23 +02:00
19 changed files with 173 additions and 217 deletions

View File

@ -10,22 +10,20 @@
> [!CAUTION]
Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit the project's popularity for potentially malicious purposes.
> [!NOTE]
All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
## 2025-07-07
### 🚀 Updated Scripts
- Fix unbound var in pulse.sh [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#5807](https://github.com/community-scripts/ProxmoxVE/pull/5807))
- Refactor: Docmost [@tremor021](https://github.com/tremor021) ([#5806](https://github.com/community-scripts/ProxmoxVE/pull/5806))
- Fix/stirling pdf script [@JcMinarro](https://github.com/JcMinarro) ([#5803](https://github.com/community-scripts/ProxmoxVE/pull/5803))
- gitea-mirror: update repo-url [@CrazyWolf13](https://github.com/CrazyWolf13) ([#5794](https://github.com/community-scripts/ProxmoxVE/pull/5794))
- #### 🐞 Bug Fixes
- Bookstack: Fix PHP Issue & Bump to PHP 8.3 [@MickLesk](https://github.com/MickLesk) ([#5779](https://github.com/community-scripts/ProxmoxVE/pull/5779))
- #### ✨ New Features
- Refactor: Threadfin (+ updatable) [@MickLesk](https://github.com/MickLesk) ([#5783](https://github.com/community-scripts/ProxmoxVE/pull/5783))
- tools.func: better handling when unpacking tarfiles in prebuild mode [@MickLesk](https://github.com/MickLesk) ([#5781](https://github.com/community-scripts/ProxmoxVE/pull/5781))
- tools.func: add AVX check for MongoDB [@MickLesk](https://github.com/MickLesk) ([#5780](https://github.com/community-scripts/ProxmoxVE/pull/5780))
@ -38,7 +36,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### 📝 Script Information
- PBS: add hint for advanced installs [@MickLesk](https://github.com/MickLesk) ([#5788](https://github.com/community-scripts/ProxmoxVE/pull/5788))
- EMQX: Add warning to website [@tremor021](https://github.com/tremor021) ([#5770](https://github.com/community-scripts/ProxmoxVE/pull/5770))
## 2025-07-06

View File

@ -1,7 +1,7 @@
<div align="center">
<p align="center">
<a href="#">
<img src="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo-81x112.png" height="100px" />
<img src="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/images/logo.png" height="100px" />
</a>
</p>
</div>

View File

@ -27,35 +27,48 @@ function update_script() {
exit
fi
if ! command -v node >/dev/null || [[ "$(/usr/bin/env node -v | grep -oP '^v\K[0-9]+')" != "22" ]]; then
NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs
msg_info "Installing Node.js 22"
$STD apt-get purge -y nodejs
rm -f /etc/apt/sources.list.d/nodesource.list
rm -f /etc/apt/keyrings/nodesource.gpg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm@10.4.0
msg_ok "Node.js 22 installed"
fi
export NODE_OPTIONS="--max_old_space_size=4096"
RELEASE=$(curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat ~/.docmost 2>/dev/null)" ]] || [[ ! -f ~/.docmost ]]; then
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop docmost
msg_ok "${APP} Stopped"
msg_info "Backing up data"
msg_info "Updating ${APP} to v${RELEASE}"
cp /opt/docmost/.env /opt/
cp -r /opt/docmost/data /opt/
rm -rf /opt/docmost
msg_ok "Data backed up"
fetch_and_deploy_gh_release "docmost" "docmost/docmost"
msg_info "Updating ${APP} to v${RELEASE}"
temp_file=$(mktemp)
curl -fsSL "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar -xzf "$temp_file"
mv docmost-${RELEASE} /opt/docmost
cd /opt/docmost
mv /opt/.env /opt/docmost/.env
mv /opt/data /opt/docmost/data
$STD pnpm install --force
$STD pnpm build
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start docmost
msg_ok "Started ${APP}"
msg_info "Cleaning Up"
rm -f ${temp_file}
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"

View File

@ -3,7 +3,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
# Copyright (c) 2021-2025 community-scripts ORG
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/RayLabsHQ/gitea-mirror
# Source: https://github.com/arunavo4/gitea-mirror
APP="gitea-mirror"
var_tags="${var_tags:-mirror;gitea}"
@ -28,7 +28,7 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/RayLabsHQ/gitea-mirror/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
RELEASE=$(curl -fsSL https://api.github.com/repos/arunavo4/gitea-mirror/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat ~/.${APP} 2>/dev/null || cat /opt/${APP}_version.txt 2>/dev/null)" ]]; then
msg_info "Stopping Services"
@ -48,7 +48,7 @@ function update_script() {
msg_ok "Installed Bun"
rm -rf /opt/gitea-mirror
fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"
fetch_and_deploy_gh_release "gitea-mirror" "arunavo4/gitea-mirror"
msg_info "Updating and rebuilding ${APP} to v${RELEASE}"
cd /opt/gitea-mirror

View File

@ -58,7 +58,6 @@ function update_script() {
else
msg_ok "No update required. ${APP} is already at ${RELEASE}."
fi
exit
}
start

View File

@ -38,12 +38,10 @@ function update_script() {
tar -xzf v$RELEASE.tar.gz
cd Stirling-PDF-$RELEASE
chmod +x ./gradlew
$STD ./gradlew build -x spotlessApply -x spotlessCheck -x test -x sonarqube
$STD ./gradlew build
rm -rf /opt/Stirling-PDF/Stirling-PDF-*.jar
cp -r ./stirling-pdf/build/libs/*.jar /opt/Stirling-PDF/Stirling-PDF-$RELEASE.jar
cp -r ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/
cp -r scripts /opt/Stirling-PDF/
cp -r pipeline /opt/Stirling-PDF/
cp -r stirling-pdf/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
cd ~
rm -rf Stirling-PDF-$RELEASE v$RELEASE.tar.gz
ln -sf /opt/Stirling-PDF/Stirling-PDF-$RELEASE.jar /opt/Stirling-PDF/Stirling-PDF.jar

View File

@ -27,24 +27,12 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/threadfin/threadfin/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${RELEASE}" != "$(cat ~/.threadfin 2>/dev/null)" ]] || [[ ! -f ~/.threadfin ]]; then
msg_info "Stopping $APP"
systemctl stop threadfin
msg_ok "Stopped $APP"
fetch_and_deploy_gh_release "threadfin" "threadfin/threadfin" "singlefile" "latest" "/opt/threadfin" "Threadfin_linux_amd64"
msg_info "Starting $APP"
systemctl start threadfin
msg_ok "Started $APP"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
msg_info "Updating $APP"
systemctl stop threadfin.service
curl -fsSL "https://github.com/Threadfin/Threadfin/releases/latest/download/Threadfin_linux_amd64" -o "/opt/threadfin/threadfin"
chmod +x /opt/threadfin/threadfin
systemctl start threadfin.service
msg_ok "Updated $APP"
exit
}

View File

@ -31,10 +31,5 @@
"username": null,
"password": null
},
"notes": [
{
"text": "Use `cat ~/docmost.creds` to see database credentials.",
"type": "info"
}
]
"notes": []
}

View File

@ -9,9 +9,9 @@
"updateable": true,
"privileged": false,
"interface_port": 4321,
"documentation": "https://github.com/RayLabsHQ/gitea-mirror/",
"documentation": "https://github.com/arunavo4/gitea-mirror/",
"config_path": "/etc/systemd/system/gitea-mirror.service",
"website": "https://github.com/RayLabsHQ/gitea-mirror/",
"website": "https://github.com/arunavo4/gitea-mirror/",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/gitea-mirror.webp",
"description": "Gitea Mirror auto-syncs GitHub repos to your self-hosted Gitea, with a sleek Web UI and easy Docker deployment. ",
"install_methods": [

View File

@ -35,10 +35,6 @@
{
"text": "Set a root password if using autologin. This will be the PBS password. `passwd root`",
"type": "warning"
},
{
"text": "Advanced Install is only possible without root password and root SSH access, you can configure this after installation.",
"type": "warning"
}
]
}

View File

@ -6,7 +6,7 @@
],
"date_created": "2024-06-12",
"type": "ct",
"updateable": true,
"updateable": false,
"privileged": false,
"interface_port": 34400,
"documentation": null,

View File

@ -1,69 +1,4 @@
[
{
"name": "VictoriaMetrics/VictoriaMetrics",
"version": "v1.121.0",
"date": "2025-07-07T11:32:39Z"
},
{
"name": "meilisearch/meilisearch",
"version": "prototype-incremental-vector-store-3",
"date": "2025-07-07T10:27:19Z"
},
{
"name": "Paymenter/Paymenter",
"version": "v1.2.1",
"date": "2025-07-07T10:11:26Z"
},
{
"name": "Checkmk/checkmk",
"version": "v2.4.0p7-rc1",
"date": "2025-07-07T09:25:01Z"
},
{
"name": "nzbgetcom/nzbget",
"version": "v25.2",
"date": "2025-07-04T08:21:42Z"
},
{
"name": "zwave-js/zwave-js-ui",
"version": "v10.8.0",
"date": "2025-07-07T08:37:45Z"
},
{
"name": "morpheus65535/bazarr",
"version": "v1.5.2",
"date": "2025-05-11T16:40:55Z"
},
{
"name": "Jackett/Jackett",
"version": "v0.22.2125",
"date": "2025-07-07T05:56:33Z"
},
{
"name": "mattermost/mattermost",
"version": "preview-v0.1",
"date": "2025-06-27T14:35:47Z"
},
{
"name": "MediaBrowser/Emby.Releases",
"version": "4.9.1.2",
"date": "2025-06-26T22:08:00Z"
},
{
"name": "firefly-iii/firefly-iii",
"version": "v6.2.20",
"date": "2025-07-02T04:03:37Z"
},
{
"name": "steveiliop56/tinyauth",
"version": "v3.4.1",
"date": "2025-06-11T07:53:44Z"
},
{
"name": "slskd/slskd",
"version": "0.23.1",
"date": "2025-07-06T23:57:52Z"
},
{
"name": "pelican-dev/panel",
"version": "v1.0.0-beta22",
@ -99,6 +34,11 @@
"version": "v6.8.0",
"date": "2025-07-06T18:19:05Z"
},
{
"name": "firefly-iii/firefly-iii",
"version": "v6.2.20",
"date": "2025-07-02T04:03:37Z"
},
{
"name": "msgbyte/tianji",
"version": "v1.23.0",
@ -119,6 +59,11 @@
"version": "8.0.3",
"date": "2025-07-06T12:19:24Z"
},
{
"name": "Jackett/Jackett",
"version": "v0.22.2123",
"date": "2025-07-06T06:01:32Z"
},
{
"name": "fallenbagel/jellyseerr",
"version": "preview-OIDC",
@ -129,6 +74,16 @@
"version": "2.1.1",
"date": "2025-06-14T17:45:06Z"
},
{
"name": "steveiliop56/tinyauth",
"version": "v3.4.1",
"date": "2025-06-11T07:53:44Z"
},
{
"name": "slskd/slskd",
"version": "0.23.0",
"date": "2025-07-06T00:02:35Z"
},
{
"name": "Kareadita/Kavita",
"version": "v0.8.7",
@ -159,6 +114,11 @@
"version": "v11.11.4",
"date": "2025-07-05T09:23:25Z"
},
{
"name": "Paymenter/Paymenter",
"version": "v1.2.0",
"date": "2025-07-05T08:58:05Z"
},
{
"name": "linkwarden/linkwarden",
"version": "v2.11.3",
@ -184,11 +144,6 @@
"version": "v1.6.2",
"date": "2025-07-04T15:21:18Z"
},
{
"name": "emqx/emqx",
"version": "e6.0.0-M1.202507-alpha.1",
"date": "2025-07-04T14:58:23Z"
},
{
"name": "kimai/kimai",
"version": "2.37.0",
@ -204,6 +159,21 @@
"version": "6.3.1",
"date": "2025-07-04T11:20:48Z"
},
{
"name": "mattermost/mattermost",
"version": "preview-v0.1",
"date": "2025-06-27T14:35:47Z"
},
{
"name": "nzbgetcom/nzbget",
"version": "v25.2",
"date": "2025-07-04T08:21:42Z"
},
{
"name": "Checkmk/checkmk",
"version": "v2.2.0p44",
"date": "2025-07-04T06:44:06Z"
},
{
"name": "outline/outline",
"version": "v0.85.0",
@ -264,6 +234,11 @@
"version": "v1.12.2-rc.0",
"date": "2025-07-03T00:31:22Z"
},
{
"name": "emqx/emqx",
"version": "v5.8.7",
"date": "2025-07-02T21:54:54Z"
},
{
"name": "hargata/lubelog",
"version": "v1.4.8",
@ -439,6 +414,11 @@
"version": "flowise@3.0.3",
"date": "2025-06-27T09:53:57Z"
},
{
"name": "MediaBrowser/Emby.Releases",
"version": "4.9.1.2",
"date": "2025-06-26T22:08:00Z"
},
{
"name": "netbox-community/netbox",
"version": "v4.3.3",
@ -459,6 +439,11 @@
"version": "v3.5.0-rc1",
"date": "2025-06-26T15:08:43Z"
},
{
"name": "meilisearch/meilisearch",
"version": "prototype-no-simd-x86-arroy-0",
"date": "2025-06-26T14:54:18Z"
},
{
"name": "AdguardTeam/AdGuardHome",
"version": "v0.107.63",
@ -514,6 +499,11 @@
"version": "RELEASE.2025-06-13T11-33-47Z",
"date": "2025-06-23T20:58:42Z"
},
{
"name": "VictoriaMetrics/VictoriaMetrics",
"version": "pmm-6401-v1.120.0",
"date": "2025-06-23T15:12:12Z"
},
{
"name": "gotson/komga",
"version": "1.22.0",
@ -614,6 +604,11 @@
"version": "v5.6.0",
"date": "2025-06-18T12:19:54Z"
},
{
"name": "zwave-js/zwave-js-ui",
"version": "v10.7.0",
"date": "2025-06-18T11:57:05Z"
},
{
"name": "forgejo/forgejo",
"version": "v11.0.2",
@ -644,6 +639,11 @@
"version": "v1.6.9",
"date": "2025-06-17T11:54:50Z"
},
{
"name": "morpheus65535/bazarr",
"version": "v1.5.2",
"date": "2025-05-11T16:40:55Z"
},
{
"name": "donaldzou/WGDashboard",
"version": "v4.2.4",

View File

@ -24,13 +24,13 @@ RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/la
curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth
chmod +x /opt/tinyauth/tinyauth
PASS=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8)
USER=$(htpasswd -Bbn "tinyauth" "${PASS}")
PASSWORD=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8)
USER=$(htpasswd -Bbn "tinyauth" "${PASSWORD}")
cat <<EOF >/opt/tinyauth/credentials.txt
cat <<EOF > /opt/tinyauth/credentials.txt
Tinyauth Credentials
Username: tinyauth
Password: ${PASS}
Password: ${PASSWORD}
EOF
echo "${RELEASE}" >/opt/tinyauth_version.txt

View File

@ -22,7 +22,6 @@ msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs
PG_VERSION="16" setup_postgresql
fetch_and_deploy_gh_release "docmost" "docmost/docmost"
msg_info "Setting up PostgreSQL"
DB_NAME="docmost_db"
@ -41,7 +40,12 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
} >>~/docmost.creds
msg_ok "Set up PostgreSQL"
msg_info "Configuring Docmost (Patience)"
msg_info "Installing Docmost (Patience)"
temp_file=$(mktemp)
RELEASE=$(curl -fsSL https://api.github.com/repos/docmost/docmost/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -o ""$temp_file""
tar -xzf "$temp_file"
mv docmost-${RELEASE} /opt/docmost
cd /opt/docmost
mv .env.example .env
mkdir data
@ -52,7 +56,8 @@ sed -i -e "s|APP_SECRET=.*|APP_SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z
export NODE_OPTIONS="--max-old-space-size=2048"
$STD pnpm install
$STD pnpm build
msg_ok "Configured Docmost"
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Docmost"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/docmost.service
@ -76,6 +81,7 @@ motd_ssh
customize
msg_info "Cleaning up"
rm -f "$temp_file"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

View File

@ -3,7 +3,7 @@
# Copyright (c) 2021-2025 community-scripts ORG
# Author: CrazyWolf13
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/RayLabsHQ/gitea-mirror
# Source: https://github.com/arunavo4/gitea-mirror
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
@ -28,7 +28,7 @@ ln -sf /opt/bun/bin/bun /usr/local/bin/bun
ln -sf /opt/bun/bin/bun /usr/local/bin/bunx
msg_ok "Installed Bun"
fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"
fetch_and_deploy_gh_release "gitea-mirror" "arunavo4/gitea-mirror"
msg_info "Installing gitea-mirror"
cd /opt/gitea-mirror

View File

@ -80,13 +80,11 @@ curl -fsSL "https://github.com/Stirling-Tools/Stirling-PDF/archive/refs/tags/v${
tar -xzf v${RELEASE}.tar.gz
cd Stirling-PDF-$RELEASE
chmod +x ./gradlew
$STD ./gradlew build -x spotlessApply -x spotlessCheck -x test -x sonarqube
$STD ./gradlew build
mkdir -p /opt/Stirling-PDF
touch /opt/Stirling-PDF/.env
mv ./stirling-pdf/build/libs/*.jar /opt/Stirling-PDF/Stirling-PDF-$RELEASE.jar
mv ./build/libs/Stirling-PDF-*.jar /opt/Stirling-PDF/
mv scripts /opt/Stirling-PDF/
mv pipeline /opt/Stirling-PDF/
mv stirling-pdf/src/main/resources/static/fonts/*.ttf /usr/share/fonts/opentype/noto/
ln -s /opt/Stirling-PDF/Stirling-PDF-$RELEASE.jar /opt/Stirling-PDF/Stirling-PDF.jar
ln -s /usr/share/tesseract-ocr/5/tessdata/ /usr/share/tessdata
msg_ok "Installed Stirling-PDF"

View File

@ -14,12 +14,16 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
ffmpeg \
vlc
$STD apt-get install -y ffmpeg
$STD apt-get install -y vlc
msg_ok "Installed Dependencies"
fetch_and_deploy_gh_release "threadfin" "threadfin/threadfin" "singlefile" "latest" "/opt/threadfin" "Threadfin_linux_amd64"
msg_info "Installing Threadfin"
mkdir -p /opt/threadfin
curl -fsSL "https://github.com/Threadfin/Threadfin/releases/latest/download/Threadfin_linux_amd64" -o "/opt/threadfin/threadfin"
chmod +x /opt/threadfin/threadfin
msg_ok "Installed Threadfin"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/threadfin.service

View File

@ -951,28 +951,13 @@ function fetch_and_deploy_gh_release() {
}
mkdir -p "$target"
if [[ "$filename" == *.zip ]]; then
if [[ "$filename" == *.zip ]]; then
if ! command -v unzip &>/dev/null; then
$STD apt-get install -y unzip
fi
local top_level_entries
top_level_entries=$(unzip -l "$tmpdir/$filename" | awk '{print $4}' | grep -v '^$' | cut -d/ -f1 | sort -u)
if [[ $(wc -l <<<"$top_level_entries") -eq 1 ]]; then
unzip -q "$tmpdir/$filename" -d "$tmpdir/unzip"
shopt -s dotglob nullglob
cp -r "$tmpdir/unzip/"* "$target/"
shopt -u dotglob nullglob
else
unzip -q "$tmpdir/$filename" -d "$target"
fi
$STD unzip "$tmpdir/$filename" -d "$target"
elif [[ "$filename" == *.tar.* ]]; then
local top_level_entries
top_level_entries=$(tar -tf "$tmpdir/$filename" | cut -d/ -f1 | sort -u)
if [[ $(wc -l <<<"$top_level_entries") -eq 1 ]]; then
if tar -tf "$tmpdir/$filename" | grep -qE '^([^/]+/){2}'; then
tar --strip-components=1 -xf "$tmpdir/$filename" -C "$target"
else
tar -xf "$tmpdir/$filename" -C "$target"

View File

@ -162,21 +162,6 @@ update_installation() {
generate_service >/lib/systemd/system/iptag.service
msg_ok "Updated service file"
msg_info "Creating manual run command"
cat <<'EOF' >/usr/local/bin/iptag-run
#!/usr/bin/env bash
CONFIG_FILE="/opt/iptag/iptag.conf"
SCRIPT_FILE="/opt/iptag/iptag"
if [[ ! -f "$SCRIPT_FILE" ]]; then
echo "❌ Main script not found: $SCRIPT_FILE"
exit 1
fi
export FORCE_SINGLE_RUN=true
exec "$SCRIPT_FILE"
EOF
chmod +x /usr/local/bin/iptag-run
msg_ok "Created iptag-run executable - You can execute this manually by entering “iptag-run” in the Proxmox host, so the script is executed by hand."
msg_info "Restarting service"
systemctl daemon-reload &>/dev/null
systemctl enable -q --now iptag.service &>/dev/null
@ -210,7 +195,7 @@ FORCE_UPDATE_INTERVAL=7200
# Performance optimizations
VM_IP_CACHE_TTL=300
MAX_PARALLEL_VM_CHECKS=1
MAX_PARALLEL_VM_CHECKS=2
# LXC performance optimizations
LXC_IP_CACHE_TTL=300
@ -221,7 +206,6 @@ LXC_BATCH_SIZE=3
LXC_STATUS_CACHE_TTL=300
LXC_AGGRESSIVE_CACHING=true
LXC_SKIP_SLOW_METHODS=true
LXC_ALLOW_FORCED_COMMANDS=false
# Debug settings (set to true to enable debugging)
DEBUG=false
@ -592,9 +576,7 @@ update_tags() {
if [[ "$type" == "lxc" ]]; then
current_ips_full=$(get_lxc_ips "${vmid}")
while IFS= read -r line; do
[[ "$line" == tags:* ]] && current_tags_raw="${line#tags: }" && break
done < <(pct config "$vmid" 2>/dev/null)
local current_tags_raw=$(pct config "${vmid}" 2>/dev/null | grep tags | awk '{print $2}')
else
current_ips_full=$(get_vm_ips "${vmid}")
local vm_config="/etc/pve/qemu-server/${vmid}.conf"
@ -807,10 +789,7 @@ check_status_changed() {
check() {
local current_time changes_detected=false
current_time=$(date +%s)
local update_lxc=false
local update_vm=false
# Periodic cache cleanup (every 10 minutes)
local time_since_last_cleanup=$((current_time - ${last_cleanup_time:-0}))
if [[ $time_since_last_cleanup -ge 600 ]]; then
@ -822,56 +801,60 @@ check() {
# Check LXC status
local time_since_last_lxc_check=$((current_time - last_lxc_status_check_time))
if [[ "${LXC_STATUS_CHECK_INTERVAL:-60}" -gt 0 ]] && \
[[ "$time_since_last_lxc_check" -ge "${LXC_STATUS_CHECK_INTERVAL:-60}" ]]; then
last_lxc_status_check_time=$current_time
[[ "${time_since_last_lxc_check}" -ge "${LXC_STATUS_CHECK_INTERVAL:-60}" ]]; then
last_lxc_status_check_time=${current_time}
if check_status_changed "lxc"; then
update_lxc=true
log_warning "LXC status changes detected"
changes_detected=true
log_warning "LXC status changes detected, updating tags"
update_all_tags "lxc"
last_update_lxc_time=${current_time}
fi
fi
# Check VM status
local time_since_last_vm_check=$((current_time - last_vm_status_check_time))
if [[ "${VM_STATUS_CHECK_INTERVAL:-60}" -gt 0 ]] && \
[[ "$time_since_last_vm_check" -ge "${VM_STATUS_CHECK_INTERVAL:-60}" ]]; then
last_vm_status_check_time=$current_time
[[ "${time_since_last_vm_check}" -ge "${VM_STATUS_CHECK_INTERVAL:-60}" ]]; then
last_vm_status_check_time=${current_time}
if check_status_changed "vm"; then
update_vm=true
log_warning "VM status changes detected"
changes_detected=true
log_warning "VM status changes detected, updating tags"
update_all_tags "vm"
last_update_vm_time=${current_time}
fi
fi
# Check network interface changes
local time_since_last_fw_check=$((current_time - last_fw_net_interface_check_time))
if [[ "${FW_NET_INTERFACE_CHECK_INTERVAL:-60}" -gt 0 ]] && \
[[ "$time_since_last_fw_check" -ge "${FW_NET_INTERFACE_CHECK_INTERVAL:-60}" ]]; then
last_fw_net_interface_check_time=$current_time
[[ "${time_since_last_fw_check}" -ge "${FW_NET_INTERFACE_CHECK_INTERVAL:-60}" ]]; then
last_fw_net_interface_check_time=${current_time}
if check_status_changed "fw"; then
update_lxc=true
update_vm=true
log_warning "Network interface changes detected"
changes_detected=true
log_warning "Network interface changes detected, updating all tags"
update_all_tags "lxc"
update_all_tags "vm"
last_update_lxc_time=${current_time}
last_update_vm_time=${current_time}
fi
fi
# Force update if interval exceeded
# Force update if needed
for type in "lxc" "vm"; do
local last_update_var="last_update_${type}_time"
local time_since_last_update=$((current_time - ${!last_update_var}))
if [[ $time_since_last_update -ge ${FORCE_UPDATE_INTERVAL:-1800} ]]; then
if [[ ${time_since_last_update} -ge ${FORCE_UPDATE_INTERVAL:-1800} ]]; then
changes_detected=true
local minutes=$((${FORCE_UPDATE_INTERVAL:-1800} / 60))
if [[ "$type" == "lxc" ]]; then
update_lxc=true
log_info "Scheduled LXC update (every $((FORCE_UPDATE_INTERVAL / 60)) minutes)"
log_info "Scheduled LXC update (every ${minutes} minutes)"
else
update_vm=true
log_info "Scheduled VM update (every $((FORCE_UPDATE_INTERVAL / 60)) minutes)"
log_info "Scheduled VM update (every ${minutes} minutes)"
fi
update_all_tags "$type"
eval "${last_update_var}=${current_time}"
fi
done
# Final execution
$update_lxc && update_all_tags "lxc"
$update_vm && update_all_tags "vm"
}
# Initialize time variables
@ -889,19 +872,13 @@ main() {
echo -e "${BLUE}${NC} Tag format: ${WHITE}${TAG_FORMAT:-$DEFAULT_TAG_FORMAT}${NC}"
echo -e "${BLUE}${NC} Allowed CIDRs: ${WHITE}${CIDR_LIST[*]}${NC}"
echo -e "${PURPLE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
if [[ "$FORCE_SINGLE_RUN" == "true" ]]; then
check
exit 0
fi
while true; do
check
sleep "${LOOP_INTERVAL:-300}"
done
}
# Cache cleanup function
cleanup_vm_cache() {
local cache_dir="/tmp"
@ -1024,7 +1001,7 @@ process_vms_parallel() {
# Parallel LXC processing function
process_lxc_parallel() {
local lxc_list=("$@")
local max_parallel=${MAX_PARALLEL_LXC_CHECKS:-2}
local max_parallel=${MAX_PARALLEL_LXC_CHECKS:-7}
local batch_size=${LXC_BATCH_SIZE:-20}
local job_count=0
local pids=()
@ -1200,7 +1177,7 @@ get_lxc_ips() {
fi
# Fallback: always do lxc-attach/pct exec with timeout if nothing found
if [[ -z "$ips" && "${LXC_ALLOW_FORCED_COMMANDS:-true}" == "true" ]]; then
if [[ -z "$ips" ]]; then
debug_log "lxc $vmid: trying fallback lxc-attach (forced)"
local attach_ip=""
attach_ip=$(timeout 7s lxc-attach -n "$vmid" -- ip -4 addr show 2>/dev/null | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | grep -v '127.0.0.1' | head -1)
@ -1215,7 +1192,7 @@ get_lxc_ips() {
method_used="lxc_attach_forced"
fi
fi
if [[ -z "$ips" && "${LXC_ALLOW_FORCED_COMMANDS:-true}" == "true" ]]; then
if [[ -z "$ips" ]]; then
debug_log "lxc $vmid: trying fallback pct exec (forced)"
local pct_ip=""
pct_ip=$(timeout 7s pct exec "$vmid" -- ip -4 addr show 2>/dev/null | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' | grep -v '127.0.0.1' | head -1)