mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-09 04:42:51 +00:00
Compare commits
3 Commits
MickLesk-p
...
refactor_p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
977377db2f | ||
|
|
8cb1675f89 | ||
|
|
a4ccf7d1b0 |
@@ -16,6 +16,7 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
|||||||
|
|
||||||
- #### 🐞 Bug Fixes
|
- #### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- Technitium DNS: Fix update [@tremor021](https://github.com/tremor021) ([#8980](https://github.com/community-scripts/ProxmoxVE/pull/8980))
|
||||||
- MediaManager: add LOG_FILE to start.sh script; fix BASE_PATH and PUBLIC_API_URL [@vhsdream](https://github.com/vhsdream) ([#8981](https://github.com/community-scripts/ProxmoxVE/pull/8981))
|
- MediaManager: add LOG_FILE to start.sh script; fix BASE_PATH and PUBLIC_API_URL [@vhsdream](https://github.com/vhsdream) ([#8981](https://github.com/community-scripts/ProxmoxVE/pull/8981))
|
||||||
- Firefly: Fix missing command in update script [@tremor021](https://github.com/tremor021) ([#8972](https://github.com/community-scripts/ProxmoxVE/pull/8972))
|
- Firefly: Fix missing command in update script [@tremor021](https://github.com/tremor021) ([#8972](https://github.com/community-scripts/ProxmoxVE/pull/8972))
|
||||||
- MongoDB: Remove unused message [@tremor021](https://github.com/tremor021) ([#8969](https://github.com/community-scripts/ProxmoxVE/pull/8969))
|
- MongoDB: Remove unused message [@tremor021](https://github.com/tremor021) ([#8969](https://github.com/community-scripts/ProxmoxVE/pull/8969))
|
||||||
|
|||||||
@@ -42,9 +42,15 @@ function update_script() {
|
|||||||
msg_ok "Backup completed"
|
msg_ok "Backup completed"
|
||||||
|
|
||||||
PYTHON_VERSION="3.13" setup_uv
|
PYTHON_VERSION="3.13" setup_uv
|
||||||
fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz"
|
||||||
fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc"
|
||||||
setup_gs
|
|
||||||
|
. /etc/os-release
|
||||||
|
if [ "$VERSION_CODENAME" = "bookworm" ]; then
|
||||||
|
setup_gs
|
||||||
|
else
|
||||||
|
$STD apt install -y ghostscript
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Updating Paperless-ngx"
|
msg_info "Updating Paperless-ngx"
|
||||||
cp -r /opt/paperless/backup/* /opt/paperless/
|
cp -r /opt/paperless/backup/* /opt/paperless/
|
||||||
@@ -53,6 +59,11 @@ function update_script() {
|
|||||||
cd /opt/paperless/src
|
cd /opt/paperless/src
|
||||||
$STD uv run -- python manage.py migrate
|
$STD uv run -- python manage.py migrate
|
||||||
msg_ok "Updated Paperless-ngx"
|
msg_ok "Updated Paperless-ngx"
|
||||||
|
|
||||||
|
if [[ -d /opt/paperless/backup ]]; then
|
||||||
|
rm -rf /opt/paperless/backup || msg_warn "Failed to remove /opt/paperless/backup"
|
||||||
|
msg_ok "Removed backup directory"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
msg_warn "You are about to migrate your Paperless-ngx installation to uv!"
|
msg_warn "You are about to migrate your Paperless-ngx installation to uv!"
|
||||||
msg_custom "🔒" "It is strongly recommended to take a Proxmox snapshot first:"
|
msg_custom "🔒" "It is strongly recommended to take a Proxmox snapshot first:"
|
||||||
@@ -103,9 +114,17 @@ function update_script() {
|
|||||||
msg_ok "Backup completed"
|
msg_ok "Backup completed"
|
||||||
|
|
||||||
PYTHON_VERSION="3.13" setup_uv
|
PYTHON_VERSION="3.13" setup_uv
|
||||||
fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz"
|
||||||
fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jbig2enc" "ie13/jbig2enc" "tarball" "latest" "/opt/jbig2enc"
|
||||||
setup_gs
|
|
||||||
|
. /etc/os-release
|
||||||
|
if [ "$VERSION_CODENAME" = "bookworm" ]; then
|
||||||
|
setup_gs
|
||||||
|
else
|
||||||
|
msg_info "Installing Ghostscript"
|
||||||
|
$STD apt install -y ghostscript
|
||||||
|
msg_ok "Installed Ghostscript"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Updating Paperless-ngx"
|
msg_info "Updating Paperless-ngx"
|
||||||
cp -r /opt/paperless/backup/* /opt/paperless/
|
cp -r /opt/paperless/backup/* /opt/paperless/
|
||||||
@@ -114,6 +133,11 @@ function update_script() {
|
|||||||
cd /opt/paperless/src
|
cd /opt/paperless/src
|
||||||
$STD uv run -- python manage.py migrate
|
$STD uv run -- python manage.py migrate
|
||||||
msg_ok "Paperless-ngx migration and update completed"
|
msg_ok "Paperless-ngx migration and update completed"
|
||||||
|
|
||||||
|
if [[ -d /opt/paperless/backup ]]; then
|
||||||
|
rm -rf /opt/paperless/backup || msg_warn "Failed to remove /opt/paperless/backup"
|
||||||
|
msg_ok "Removed backup directory"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Starting all Paperless-ngx Services"
|
msg_info "Starting all Paperless-ngx Services"
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_package_installed "aspnetcore-runtime-8.0"; then
|
||||||
|
$STD apt remove -y aspnetcore-runtime-8.0
|
||||||
|
$STD apt install -y aspnetcore-runtime-9.0
|
||||||
|
fi
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://technitium.com/dns/ | grep -oP 'Version \K[\d.]+')
|
RELEASE=$(curl -fsSL https://technitium.com/dns/ | grep -oP 'Version \K[\d.]+')
|
||||||
if [[ ! -f ~/.technitium || "${RELEASE}" != "$(cat ~/.technitium)" ]]; then
|
if [[ ! -f ~/.technitium || "${RELEASE}" != "$(cat ~/.technitium)" ]]; then
|
||||||
msg_info "Updating Technitium DNS"
|
msg_info "Updating Technitium DNS"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ curl -fsSL "https://packages.microsoft.com/config/debian/12/packages-microsoft-p
|
|||||||
$STD dpkg -i packages-microsoft-prod.deb
|
$STD dpkg -i packages-microsoft-prod.deb
|
||||||
rm -rf packages-microsoft-prod.deb
|
rm -rf packages-microsoft-prod.deb
|
||||||
$STD apt update
|
$STD apt update
|
||||||
$STD apt install -y aspnetcore-runtime-8.0
|
$STD apt install -y aspnetcore-runtime-9.0
|
||||||
msg_ok "Installed ASP.NET Core Runtime"
|
msg_ok "Installed ASP.NET Core Runtime"
|
||||||
|
|
||||||
RELEASE=$(curl -fsSL https://technitium.com/dns/ | grep -oP 'Version \K[\d.]+')
|
RELEASE=$(curl -fsSL https://technitium.com/dns/ | grep -oP 'Version \K[\d.]+')
|
||||||
@@ -26,20 +26,15 @@ msg_info "Installing Technitium DNS"
|
|||||||
mkdir -p /opt/technitium/dns
|
mkdir -p /opt/technitium/dns
|
||||||
curl -fsSL "https://download.technitium.com/dns/DnsServerPortable.tar.gz" -o /opt/DnsServerPortable.tar.gz
|
curl -fsSL "https://download.technitium.com/dns/DnsServerPortable.tar.gz" -o /opt/DnsServerPortable.tar.gz
|
||||||
$STD tar zxvf /opt/DnsServerPortable.tar.gz -C /opt/technitium/dns/
|
$STD tar zxvf /opt/DnsServerPortable.tar.gz -C /opt/technitium/dns/
|
||||||
|
rm -f /opt/DnsServerPortable.tar.gz
|
||||||
echo "${RELEASE}" >~/.technitium
|
echo "${RELEASE}" >~/.technitium
|
||||||
msg_ok "Installed Technitium DNS"
|
msg_ok "Installed Technitium DNS"
|
||||||
|
|
||||||
msg_info "Creating service"
|
msg_info "Creating service"
|
||||||
cp /opt/technitium/dns/systemd.service /etc/systemd/system/technitium.service
|
cp /opt/technitium/dns/systemd.service /etc/systemd/system/technitium.service
|
||||||
systemctl enable -q --now technitium
|
systemctl enable -q --now technitium
|
||||||
msg_ok "Service created"
|
msg_ok "Service created"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
cleanup_lxc
|
||||||
msg_info "Cleaning up"
|
|
||||||
rm -f /opt/DnsServerPortable.tar.gz
|
|
||||||
$STD apt -y autoremove
|
|
||||||
$STD apt -y autoclean
|
|
||||||
$STD apt -y clean
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
|
|||||||
@@ -1198,8 +1198,8 @@ ensure_apt_working() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Standardized deb822 repository setup (with optional Architectures)
|
# Standardized deb822 repository setup
|
||||||
# Always runs apt update after repo creation to ensure package availability
|
# Validates all parameters and fails safely if any are empty
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
setup_deb822_repo() {
|
setup_deb822_repo() {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
@@ -1207,40 +1207,56 @@ setup_deb822_repo() {
|
|||||||
local repo_url="$3"
|
local repo_url="$3"
|
||||||
local suite="$4"
|
local suite="$4"
|
||||||
local component="${5:-main}"
|
local component="${5:-main}"
|
||||||
local architectures="$6" # optional
|
local architectures="${6:-$(dpkg --print-architecture)}"
|
||||||
|
|
||||||
# Validate required parameters
|
# Validate required parameters
|
||||||
if [[ -z "$name" || -z "$gpg_url" || -z "$repo_url" || -z "$suite" ]]; then
|
if [[ -z "$name" || -z "$gpg_url" || -z "$repo_url" || -z "$suite" ]]; then
|
||||||
msg_error "setup_deb822_repo: missing required parameters (name=$name repo=$repo_url suite=$suite)"
|
msg_error "setup_deb822_repo: missing required parameters (name=$name, gpg=$gpg_url, repo=$repo_url, suite=$suite)"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup old configs for this app
|
||||||
cleanup_old_repo_files "$name"
|
cleanup_old_repo_files "$name"
|
||||||
|
|
||||||
|
# Cleanup any orphaned .sources files from other apps
|
||||||
cleanup_orphaned_sources
|
cleanup_orphaned_sources
|
||||||
|
|
||||||
|
# Ensure keyring directory exists
|
||||||
mkdir -p /etc/apt/keyrings || {
|
mkdir -p /etc/apt/keyrings || {
|
||||||
msg_error "Failed to create /etc/apt/keyrings"
|
msg_error "Failed to create /etc/apt/keyrings directory"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Import GPG
|
# Download GPG key (with --yes to avoid interactive prompts)
|
||||||
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" || {
|
curl -fsSL "$gpg_url" | gpg --dearmor --yes -o "/etc/apt/keyrings/${name}.gpg" 2>/dev/null || {
|
||||||
msg_error "Failed to import GPG key for ${name}"
|
msg_error "Failed to download or import GPG key for ${name} from $gpg_url"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Write deb822
|
# Create deb822 sources file
|
||||||
{
|
cat <<EOF >/etc/apt/sources.list.d/${name}.sources
|
||||||
echo "Types: deb"
|
Types: deb
|
||||||
echo "URIs: $repo_url"
|
URIs: $repo_url
|
||||||
echo "Suites: $suite"
|
Suites: $suite
|
||||||
echo "Components: $component"
|
Components: $component
|
||||||
[[ -n "$architectures" ]] && echo "Architectures: $architectures"
|
Architectures: $architectures
|
||||||
echo "Signed-By: /etc/apt/keyrings/${name}.gpg"
|
Signed-By: /etc/apt/keyrings/${name}.gpg
|
||||||
} >/etc/apt/sources.list.d/${name}.sources
|
EOF
|
||||||
|
|
||||||
$STD apt update
|
# Use cached apt update
|
||||||
|
local apt_cache_file="/var/cache/apt-update-timestamp"
|
||||||
|
local current_time=$(date +%s)
|
||||||
|
local last_update=0
|
||||||
|
|
||||||
|
if [[ -f "$apt_cache_file" ]]; then
|
||||||
|
last_update=$(cat "$apt_cache_file" 2>/dev/null || echo 0)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For repo changes, always update but respect short-term cache (30s)
|
||||||
|
if ((current_time - last_update > 30)); then
|
||||||
|
$STD apt update
|
||||||
|
echo "$current_time" >"$apt_cache_file"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user