diff --git a/ct/headers/jdownloader b/ct/headers/jdownloader new file mode 100644 index 000000000..17e900216 --- /dev/null +++ b/ct/headers/jdownloader @@ -0,0 +1,6 @@ + ______ __ __ + / / __ \____ _ ______ / /___ ____ _____/ /__ _____ + __ / / / / / __ \ | /| / / __ \/ / __ \/ __ `/ __ / _ \/ ___/ +/ /_/ / /_/ / /_/ / |/ |/ / / / / / /_/ / /_/ / /_/ / __/ / +\____/_____/\____/|__/|__/_/ /_/_/\____/\__,_/\__,_/\___/_/ + diff --git a/ct/jdownloader.sh b/ct/jdownloader.sh new file mode 100644 index 000000000..1293615bd --- /dev/null +++ b/ct/jdownloader.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main" +_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://jdownloader.org/ + +APP="JDownloader" +var_tags="${var_tags:-downloader}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +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 /opt/jdownloader/JDownloader.jar ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Updating Container OS" + $STD apt update + $STD apt -y upgrade + msg_ok "Updated Container OS" + + msg_info "Restarting JDownloader (triggers built-in self-update)" + systemctl restart jdownloader + msg_ok "Restarted JDownloader" + msg_ok "JDownloader will self-update automatically on restart" + 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}:6080/vnc.html?resize=scale&autoconnect=true${CL}" diff --git a/install/jdownloader-install.sh b/install/jdownloader-install.sh new file mode 100644 index 000000000..df6c9a441 --- /dev/null +++ b/install/jdownloader-install.sh @@ -0,0 +1,213 @@ +#!/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://jdownloader.org/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +JAVA_VERSION="21" setup_java + +msg_info "Installing GUI Dependencies (Xvfb, Openbox, x11vnc, noVNC, tint2)" +$STD apt install -y \ + xvfb \ + x11vnc \ + novnc \ + websockify \ + openbox \ + tint2 \ + autocutsel \ + x11-xserver-utils \ + x11-utils \ + wmctrl \ + fonts-dejavu-core \ + ffmpeg \ + rtmpdump +msg_ok "Installed GUI Dependencies" + +msg_info "Downloading JDownloader" +mkdir -p /opt/jdownloader +$STD wget -O /opt/jdownloader/JDownloader.jar https://installer.jdownloader.org/JDownloader.jar +msg_ok "Downloaded JDownloader" + +msg_info "Installing JDownloader (Patience)" +cd /opt/jdownloader +$STD java -Djava.awt.headless=true -jar /opt/jdownloader/JDownloader.jar -norestart +msg_ok "Installed JDownloader" + +msg_info "Configuring JDownloader" +cat </opt/jdownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json +{ + "email" : null, + "password" : null, + "devicename" : "JDownloader@LXC", + "autoconnectenabledv2" : false +} +EOF + +cat </opt/jdownloader/cfg/org.jdownloader.api.RemoteAPIConfig.json +{"headlessmyjdownloadermandatory":false,"deprecatedapienabled":false,"jdanywhereapienabled":false} +EOF +msg_ok "Configured JDownloader" + +msg_info "Configuring Openbox (Auto-Maximize JDownloader Window)" +mkdir -p /root/.config/openbox +cat <<'EOF' >/root/.config/openbox/rc.xml + + + + + true + + + +EOF +msg_ok "Configured Openbox" + +msg_info "Creating Services" +cat </etc/systemd/system/xvfb.service +[Unit] +Description=Virtual Framebuffer X Server +After=network.target + +[Service] +Type=simple +ExecStartPre=/bin/sh -c 'rm -f /tmp/.X1-lock' +ExecStart=/usr/bin/Xvfb :1 -screen 0 1280x800x24 +ExecStartPost=/bin/sh -c 'sleep 1 && DISPLAY=:1 xset s off && DISPLAY=:1 xset s noblank && DISPLAY=:1 xset -dpms' +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/openbox.service +[Unit] +Description=Openbox Window Manager +After=xvfb.service +Requires=xvfb.service + +[Service] +Type=simple +Environment=DISPLAY=:1 +ExecStart=/usr/bin/openbox +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/tint2.service +[Unit] +Description=tint2 Taskbar +After=openbox.service +Requires=openbox.service + +[Service] +Type=simple +Environment=DISPLAY=:1 +ExecStart=/usr/bin/tint2 +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/autocutsel.service +[Unit] +Description=autocutsel Clipboard Sync +After=openbox.service +Requires=openbox.service + +[Service] +Type=simple +Environment=DISPLAY=:1 +ExecStart=/bin/sh -c 'autocutsel -selection PRIMARY -fork; exec autocutsel -selection CLIPBOARD' +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/jdownloader.service +[Unit] +Description=JDownloader Download Manager +After=openbox.service +Requires=openbox.service + +[Service] +Type=simple +User=root +Environment=DISPLAY=:1 +WorkingDirectory=/opt/jdownloader +ExecStartPre=/bin/sleep 3 +ExecStart=/usr/bin/java -Dsun.java2d.xrender=false -Dsun.java2d.pmoffscreen=false -Dsun.java2d.opengl=false -jar /opt/jdownloader/JDownloader.jar +Restart=always +RestartSec=10 + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/x11vnc.service +[Unit] +Description=x11vnc Server +After=jdownloader.service +Requires=xvfb.service + +[Service] +Type=simple +ExecStart=/usr/bin/x11vnc -display :1 -forever -shared -rfbport 5900 -nopw -noipv6 -xkb -noxdamage -nowf -nowcr -wait 50 -defer 50 +RestartSec=5 +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/novnc.service +[Unit] +Description=noVNC WebSocket Proxy +After=x11vnc.service +Requires=x11vnc.service + +[Service] +Type=simple +ExecStart=/usr/bin/websockify --web=/usr/share/novnc 6080 localhost:5900 +Restart=always +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +msg_ok "Created Services" + +msg_info "Starting Services" +systemctl daemon-reload +systemctl enable -q --now xvfb +sleep 2 +systemctl enable -q --now openbox +sleep 1 +systemctl enable -q --now tint2 +systemctl enable -q --now autocutsel +systemctl enable -q --now jdownloader +sleep 3 +systemctl enable -q --now x11vnc +sleep 1 +systemctl enable -q --now novnc +msg_ok "Started Services" + +motd_ssh +customize +cleanup_lxc