Skip to content

Commit

Permalink
Added a way to easy fixing JD installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlesage committed Sep 16, 2024
1 parent 41a81b4 commit c617d24
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ RUN \
jq \
# We need a font.
ttf-dejavu \
# For fixing JD installation.
curl \
# For ffmpeg and ffprobe tools.
ffmpeg \
# For rtmpdump tool.
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ your valuable time every day!
* [MyJDownloader](#myjdownloader)
* [Direct Connection](#direct-connection)
* [Click'n'Load](#clicknload)
* [Troubleshooting](#troubleshooting)
* [JDownloader Fails to Start](#jdownloader-fails-to-start)
* [Support or Contact](#support-or-contact)

## Quick Start
Expand Down Expand Up @@ -644,6 +646,24 @@ JDownloader via the *MyJDownloader* service.
[Click'n'Load]: http://jdownloader.org/knowledge/wiki/glossary/cnl2
[MyJDownloader browser extension]: https://my.jdownloader.org/apps/
## Troubleshooting
### JDownloader Fails to Start
If JDownloader displays an error indicating that it is unable to start,
following these instruction might help fixing the problem.
1. Create the file `.fix_jd_install`, under the directory that has been mapped
to `/config`. The content of the file is not important. However, if the
latest JDownloader installer is required, setting the content to `download`
causes the installer to be downloaded.
2. Restart the container.
The presence of the file causes the container to attempt fixing the installation
during its startup. The repair process follows the instructions provided at:
https://support.jdownloader.org/en/knowledgebase/article/fix-jdownloader-installation
## Support or Contact
Having troubles with the container or have questions? Please
Expand Down
18 changes: 18 additions & 0 deletions appdefs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ app:
[Click'n'Load]: http://jdownloader.org/knowledge/wiki/glossary/cnl2
[MyJDownloader browser extension]: https://my.jdownloader.org/apps/
- title: Troubleshooting
level: 2
- title: JDownloader Fails to Start
level: 3
content: |-
If JDownloader displays an error indicating that it is unable to start,
following these instruction might help fixing the problem.
1. Create the file `.fix_jd_install`, under the directory that has been mapped
to `/config`. The content of the file is not important. However, if the
latest JDownloader installer is required, setting the content to `download`
causes the installer to be downloaded.
2. Restart the container.
The presence of the file causes the container to attempt fixing the installation
during its startup. The repair process follows the instructions provided at:
https://support.jdownloader.org/en/knowledgebase/article/fix-jdownloader-installation
changelog:
- version: 24.08.1
date: 2024-08-02
Expand Down
38 changes: 34 additions & 4 deletions rootfs/etc/cont-init.d/55-jdownloader2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,42 @@ set -u # Treat unset variables as an error.
# Make sure mandatory directories exist.
mkdir -p /config/logs

# Set default configuration on new install.
if [ ! -f /config/JDownloader.jar ]; then
cp /defaults/JDownloader.jar /config/
cp -r /defaults/cfg /config/
# Fix installation if requested.
# https://support.jdownloader.org/en/knowledgebase/article/fix-jdownloader-installation
if [ -f /config/.fix_jd_install ]; then
TO_REMOVE="
Core.Jar
JDownloader.jar
tmp
update
"

echo "fixing JDownloader installation..."
echo "$TO_REMOVE" | while read -r FILE; do
[ -n "$FILE" ] || continue
echo "removing /config/$FILE..."
rm -rf /config/"$FILE"
done

if [ "$(cat /config/.fix_jd_install)" = "download" ]; then
JDOWNLOADER_URL=http://installer.jdownloader.org/JDownloader.jar
echo "downloading JDownloader installer..."
if curl -s -L --show-error --fail --max-time 120 -o /tmp/JDownloader.jar.download "$JDOWNLOADER_URL"
then
mv /tmp/JDownloader.jar.download /config/JDownloader.jar
else
echo "failed to download JDownloader installer."
fi
fi

echo "installation fix done."
rm /config/.fix_jd_install
fi

# Set default configuration on new install.
[ -f /config/JDownloader.jar ] || cp -v /defaults/JDownloader.jar /config/JDownloader.jar
[ -d /config/cfg ] || cp -rv /defaults/cfg /config/cfg

# Set MyJDownloader credentials.
if [ -n "${MYJDOWNLOADER_EMAIL:-}" ] && [ -n "${MYJDOWNLOADER_PASSWORD:-}" ]
then
Expand Down

0 comments on commit c617d24

Please sign in to comment.