2024-01-07 16:08:46 -05:00
|
|
|
|
#!/usr/bin/env bash
|
2026-09-01 13:28:55 +02:00
|
|
|
|
_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")
|
2026-01-06 13:28:12 +01:00
|
|
|
|
# Copyright (c) 2021-2026 tteck
|
2024-01-07 16:08:46 -05:00
|
|
|
|
# Author: tteck (tteckster)
|
2024-12-16 12:42:51 +01:00
|
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
2026-02-24 15:11:53 +01:00
|
|
|
|
# Source: https://www.stirlingpdf.com/ | Github: https://github.com/Stirling-Tools/Stirling-PDF
|
2024-01-07 16:08:46 -05:00
|
|
|
|
|
2024-01-08 08:00:05 -05:00
|
|
|
|
APP="Stirling-PDF"
|
2025-04-10 11:56:52 +02:00
|
|
|
|
var_tags="${var_tags:-pdf-editor}"
|
|
|
|
|
|
var_cpu="${var_cpu:-2}"
|
|
|
|
|
|
var_ram="${var_ram:-2048}"
|
|
|
|
|
|
var_disk="${var_disk:-8}"
|
|
|
|
|
|
var_os="${var_os:-debian}"
|
2025-10-15 22:58:08 +02:00
|
|
|
|
var_version="${var_version:-13}"
|
2026-06-12 00:16:15 +10:00
|
|
|
|
var_arm64="${var_arm64:-yes}"
|
2025-04-10 11:56:52 +02:00
|
|
|
|
var_unprivileged="${var_unprivileged:-1}"
|
2024-12-16 12:42:51 +01:00
|
|
|
|
|
|
|
|
|
|
header_info "$APP"
|
2024-01-07 16:08:46 -05:00
|
|
|
|
variables
|
|
|
|
|
|
color
|
|
|
|
|
|
catch_errors
|
|
|
|
|
|
|
|
|
|
|
|
function update_script() {
|
2024-12-16 12:42:51 +01:00
|
|
|
|
header_info
|
|
|
|
|
|
check_container_storage
|
|
|
|
|
|
check_container_resources
|
|
|
|
|
|
if [[ ! -d /opt/Stirling-PDF ]]; then
|
|
|
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
|
|
exit
|
|
|
|
|
|
fi
|
2025-08-29 12:27:24 +02:00
|
|
|
|
|
|
|
|
|
|
if check_for_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF"; then
|
2025-07-09 17:43:30 +02:00
|
|
|
|
if [[ ! -f /etc/systemd/system/unoserver.service ]]; then
|
|
|
|
|
|
msg_custom "⚠️ " "\e[33m" "Legacy installation detected – please recreate the container using the latest install script."
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
PYTHON_VERSION="3.12" setup_uv
|
2026-03-04 10:24:04 +01:00
|
|
|
|
JAVA_VERSION="25" setup_java
|
2025-07-09 17:43:30 +02:00
|
|
|
|
|
2026-07-01 22:40:55 +02:00
|
|
|
|
msg_info "Patching Native Libraries for LXC Compatibility"
|
|
|
|
|
|
ensure_dependencies patchelf
|
|
|
|
|
|
find /usr/lib -name "libicudata.so.*" -exec patchelf --clear-execstack {} \; || true
|
|
|
|
|
|
msg_ok "Patched Native Libraries"
|
|
|
|
|
|
|
2026-08-14 06:05:09 +10:00
|
|
|
|
if [[ -f /etc/systemd/system/libreoffice-listener.service ]]; then
|
|
|
|
|
|
msg_info "Removing Conflicting LibreOffice Listener"
|
|
|
|
|
|
systemctl disable -q --now libreoffice-listener
|
|
|
|
|
|
rm -f /etc/systemd/system/libreoffice-listener.service
|
|
|
|
|
|
sed -i '/^Requires=libreoffice-listener.service$/d' /etc/systemd/system/stirlingpdf.service /etc/systemd/system/unoserver.service
|
|
|
|
|
|
sed -i 's/^After=syslog.target network.target libreoffice-listener.service$/After=syslog.target network.target unoserver.service/' /etc/systemd/system/stirlingpdf.service
|
|
|
|
|
|
sed -i 's/^After=libreoffice-listener.service$/After=network.target/' /etc/systemd/system/unoserver.service
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
systemctl reset-failed libreoffice-listener.service 2>/dev/null || true
|
|
|
|
|
|
msg_ok "Removed Conflicting LibreOffice Listener"
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2025-07-09 17:43:30 +02:00
|
|
|
|
msg_info "Stopping Services"
|
2026-08-14 06:05:09 +10:00
|
|
|
|
systemctl stop stirlingpdf unoserver
|
2025-07-09 17:43:30 +02:00
|
|
|
|
msg_ok "Stopped Services"
|
|
|
|
|
|
|
|
|
|
|
|
if [[ -f ~/.Stirling-PDF-login ]]; then
|
|
|
|
|
|
USE_ORIGINAL_FILENAME=true fetch_and_deploy_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF" "singlefile" "latest" "/opt/Stirling-PDF" "Stirling-PDF-with-login.jar"
|
|
|
|
|
|
mv /opt/Stirling-PDF/Stirling-PDF-with-login.jar /opt/Stirling-PDF/Stirling-PDF.jar
|
|
|
|
|
|
else
|
|
|
|
|
|
USE_ORIGINAL_FILENAME=true fetch_and_deploy_gh_release "stirling-pdf" "Stirling-Tools/Stirling-PDF" "singlefile" "latest" "/opt/Stirling-PDF" "Stirling-PDF.jar"
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
msg_info "Refreshing Font Cache"
|
|
|
|
|
|
$STD fc-cache -fv
|
|
|
|
|
|
msg_ok "Font Cache Updated"
|
|
|
|
|
|
|
|
|
|
|
|
msg_info "Starting Services"
|
2026-08-14 06:05:09 +10:00
|
|
|
|
systemctl start unoserver stirlingpdf
|
2025-07-09 17:43:30 +02:00
|
|
|
|
msg_ok "Started Services"
|
2025-10-30 09:24:16 -07:00
|
|
|
|
msg_ok "Updated successfully!"
|
2024-12-16 12:42:51 +01:00
|
|
|
|
fi
|
|
|
|
|
|
exit
|
2024-01-07 16:08:46 -05:00
|
|
|
|
}
|
|
|
|
|
|
start
|
|
|
|
|
|
build_container
|
|
|
|
|
|
description
|
|
|
|
|
|
|
2026-01-06 22:57:40 +01:00
|
|
|
|
msg_ok "Completed successfully!\n"
|
2024-12-16 12:42:51 +01:00
|
|
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
2026-06-03 11:03:13 +02:00
|
|
|
|
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
|
|
|
|
|
echo -e "${GATEWAY}${BGN}http://${IP}:8080${CL}"
|