mirror of
https://git.netzspielplatz.de/docker-multiarch/jdownloader2-headless.git
synced 2025-11-08 19:09:31 +00:00
commit
e13da98d90
2 changed files with 54 additions and 7 deletions
40
README.md
40
README.md
|
|
@ -2,11 +2,39 @@
|
|||
Headless JDownloader 2 Docker Container
|
||||
|
||||
## Running the container
|
||||
0. `sudo su`
|
||||
1. Create a folder on your host for the configuration files (eg. sudo mkdir /config/jd2)
|
||||
2. run `docker run -d --name jd2 -v /config/jd2:/opt/JDownloader/cfg -v /home/user/Downloads:/root/Downloads plusminus/jdownloader2-headless`
|
||||
3. stop the container `docker stop jd2`
|
||||
4. On your host, enter your credentials (in quotes) to the file `org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json` as in `{ "password" : "mypasswort", "email" : "email@home.org" }`
|
||||
5. Start the container
|
||||
0. Become root if your user is not part of the docker group:
|
||||
|
||||
```
|
||||
sudo su
|
||||
```
|
||||
1. Create a folder on your host for the configuration files (eg. sudo mkdir /config/jd2)
|
||||
2. Run the container:
|
||||
|
||||
```
|
||||
docker run -d --name jd2 \
|
||||
-v /config/jd2:/opt/JDownloader/cfg \
|
||||
-v /home/user/Downloads:/downloads \
|
||||
plusminus/jdownloader2-headless
|
||||
```
|
||||
3. Wait a minute for the container to initialize
|
||||
4. Stop the container:
|
||||
|
||||
```
|
||||
docker stop jd2
|
||||
```
|
||||
5. On your host, enter your credentials (in quotes) to the file `org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json` as in:
|
||||
|
||||
```
|
||||
{ "password" : "mypasswort", "email" : "email@home.org" }
|
||||
```
|
||||
6. Start the container:
|
||||
|
||||
```
|
||||
docker start jd2
|
||||
```
|
||||
|
||||
## Optional environment variables
|
||||
|Environment Variable|Description|
|
||||
|--------------------|-----------|
|
||||
|UID|Specifies the UID the daemon should run as. All created files will be owned by this UID. Defaults to 0 for root.|
|
||||
|GID|Specifies the GID for all created files. This only works in combination with the UID. Defaults to 0 for root.|
|
||||
|
|
|
|||
21
startJD2.sh
21
startJD2.sh
|
|
@ -7,9 +7,28 @@ function stopJD2 {
|
|||
exit
|
||||
}
|
||||
|
||||
if [ "$GID" ]
|
||||
then
|
||||
GROUP=jdownloader
|
||||
groupadd -g $GID $GROUP
|
||||
else
|
||||
GROUP=root
|
||||
fi
|
||||
|
||||
if [ "$UID" ]
|
||||
then
|
||||
USER=jdownloader
|
||||
useradd -r -s /bin/false -u $UID $USER
|
||||
else
|
||||
USER=root
|
||||
fi
|
||||
|
||||
useradd -G $GROUP $USER
|
||||
chown -R $USER:$GROUP /opt/JDownloader
|
||||
|
||||
trap stopJD2 EXIT
|
||||
|
||||
java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &
|
||||
su -c "java -Djava.awt.headless=true -jar /opt/JDownloader/JDownloader.jar &" -s /bin/bash $USER
|
||||
|
||||
while true; do
|
||||
sleep inf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue