mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-27 16:22:53 +02:00
f5390ebdbf
* Install Java via setup_java instead of distro openjdk Apache Tika's Java runtime was installed by calling apt directly for openjdk-17-jre-headless. This tied the JDK to whatever Debian ships, and that coupling has now broken: openjdk-17 is no longer available on Debian 13 (Trixie), where openjdk-21 is current. It also made this the only script in install/ that installs Java by hand, while every other Java application in the repository uses the shared setup_java helper. Switch to setup_java, which installs Eclipse Temurin from the Adoptium repository. Temurin is versioned independently of the Debian release, so a future distribution upgrade cannot remove the JDK out from under the application the way this one did. Java 21 satisfies both current and upcoming Tika: 3.x requires Java 11 or newer, and 4.x raises the floor to Java 17. The surrounding msg_info/msg_ok pair is dropped because setup_java emits its own progress messages; keeping them would nest the output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Bump Apache-Tika container to Debian 13 The container declared Debian 12 (Bookworm) as its base, which had become an outlier: 475 of the repository's ct scripts target Debian 13 and only 22 still target 12. build.func also sets trixie as the default ARM64 template codename, so this script's declared base had drifted away from the repository default. The declared version is not cosmetic. check_container_os_guard() reads var_os/var_version as the script's recommended OS and compares them against a container's /etc/os-release, prompting on interactive runs and aborting headless ones when they disagree. Debian 12 was also the reason the previous openjdk-17 dependency looked valid; on Debian 13 that package no longer exists, which is addressed in the preceding commit. Existing Debian 12 containers keep working, because update_script only replaces the Tika jar and never touches the operating system or Java. They will, however, now hit the OS mismatch guard on update and be asked to move to Debian 13 first. That is intended rather than a regression, but it is a visible change for existing users. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
64 lines
2.1 KiB
Bash
Executable File
64 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: Andy Grunwald (andygrunwald)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/apache/tika/
|
|
|
|
APP="Apache-Tika"
|
|
var_tags="${var_tags:-document}"
|
|
var_cpu="${var_cpu:-1}"
|
|
var_ram="${var_ram:-2048}"
|
|
var_disk="${var_disk:-10}"
|
|
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 [[ ! -f /etc/systemd/system/apache-tika.service ]]; then
|
|
msg_error "No ${APP} Installation Found!"
|
|
exit
|
|
fi
|
|
RELEASE="$(curl -fsSL https://dlcdn.apache.org/tika/ | grep -oP '(?<=href=")[0-9]+\.[0-9]+\.[0-9]+(?=/")' | sort -V | tail -n1)"
|
|
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
|
|
msg_info "Stopping Service"
|
|
systemctl stop apache-tika
|
|
msg_ok "Stopped Service"
|
|
|
|
msg_info "Updating ${APP} to v${RELEASE}"
|
|
cd /opt/apache-tika
|
|
curl -fsSL -o tika-server-standard-${RELEASE}.jar "https://dlcdn.apache.org/tika/${RELEASE}/tika-server-standard-${RELEASE}.jar"
|
|
mv --force tika-server-standard.jar tika-server-standard-prev-version.jar
|
|
mv tika-server-standard-${RELEASE}.jar tika-server-standard.jar
|
|
rm -rf /opt/apache-tika/tika-server-standard-prev-version.jar
|
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
msg_ok "Updated ${APP} to v${RELEASE}"
|
|
|
|
msg_info "Starting Service"
|
|
systemctl start apache-tika
|
|
msg_ok "Started Service"
|
|
msg_ok "Updated successfully!"
|
|
else
|
|
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
|
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}:9998${CL}"
|