auto create myjdownloader config

This commit is contained in:
prilka 2019-08-03 11:05:11 +02:00
parent 27789b10a7
commit 177c0955be
3 changed files with 13 additions and 2 deletions

View file

@ -4,7 +4,7 @@ MAINTAINER PlusMinus <piddlpiddl@gmail.com>
# Create directory, and start JD2 for the initial update and creation of config files. # Create directory, and start JD2 for the initial update and creation of config files.
RUN apk update && apk upgrade && \ RUN apk update && apk upgrade && \
apk add --no-cache --quiet tini su-exec shadow ffmpeg && \ apk add --no-cache --quiet tini su-exec shadow ffmpeg jq && \
mkdir -p /opt/JDownloader/libs && \ mkdir -p /opt/JDownloader/libs && \
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \ wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar

View file

@ -21,6 +21,17 @@ else
usermod -ag $GID usermod -ag $GID
fi fi
# Set MyJDownloader credentials
CONFIG_FILE="/opt/JDownloader/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json"
if [ ! -z "$EMAIL" ] ; then
if [ ! -f "$CONFIG_FILE" ] || [ ! -s "$CONFIG_FILE" ] ; then
echo '{}' > "$CONFIG_FILE"
fi
CFG=$(jq -r --arg EMAIL "$EMAIL" --arg PASSWORD "$PASSWORD" '.email = $EMAIL | .password = $PASSWORD' "$CONFIG_FILE")
[ ! -z "$CFG" ] && echo "$CFG" > "$CONFIG_FILE"
fi
chown -R $UID:$GID /opt/JDownloader chown -R $UID:$GID /opt/JDownloader
# Sometimes this gets deleted. Just copy it every time. # Sometimes this gets deleted. Just copy it every time.

View file

@ -4,7 +4,7 @@ MAINTAINER PlusMinus <piddlpiddl@gmail.com>
# Create directory, and start JD2 for the initial update and creation of config files. # Create directory, and start JD2 for the initial update and creation of config files.
RUN apt-get update && apt-get dist-upgrade -yqq && \ RUN apt-get update && apt-get dist-upgrade -yqq && \
apt-get install -yqq tini ffmpeg wget make gcc && \ apt-get install -yqq tini ffmpeg wget make gcc jq && \
mkdir -p /opt/JDownloader/libs && \ mkdir -p /opt/JDownloader/libs && \
wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \ wget -O /opt/JDownloader/JDownloader.jar --user-agent="https://hub.docker.com/r/plusminus/jdownloader2-headless/" http://installer.jdownloader.org/JDownloader.jar && \
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar && \ java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar && \