stefantalpalaru / deluge-default-trackers

Deluge plugin for adding default trackers to all the new torrents
GNU General Public License v3.0
141 stars 23 forks source link

help trying to get this working in docker #35

Closed hugalafutro closed 3 years ago

hugalafutro commented 3 years ago

Hi, I use linuxserver/deluge in docker and am trying to enable this plugin.

I followed the same procedure as when installing WebAPI plugin which works, i.e. I copied the egg to the plugins subdir, enabled it in webui and it worked. The WebAPI egg was 3.6 too which is why I had hoped this would work too.

Trying to the same with DefaultTrackers makes it seem everything works, I can click it, but when I close the configuration dialog and reopen it it's disabled.

In logs I can only see these:

pia_deluge  | 14:57:03 [DEBUG   ][deluge.pluginmanagerbase   :116 ] Found plugin: DefaultTrackers 0.2 at /config/plugins/DefaultTrackers-0.2-py3.6.egg
pia_deluge  | 14:58:07 [DEBUG   ][deluge.ui.web.json_api     :202 ] json-request: b'{"method":"web.get_plugin_info","params":["DefaultTrackers"],"id":48}'
pia_deluge  | 14:58:07 [DEBUG   ][deluge.ui.web.json_api     :202 ] json-request: b'{"method":"core.enable_plugin","params":["DefaultTrackers"],"id":49}'

Any help appreciated, thanks!

stefantalpalaru commented 3 years ago

Check your Python3 version with python3 --version.

Also, what Deluge interface are you using?

hugalafutro commented 3 years ago

it's this image https://github.com/linuxserver/docker-deluge and I connect to it using webui

inside the container:

root@805ec1739f00:/# python3 --version
Python 3.6.9
stefantalpalaru commented 3 years ago

This plugin doesn't have WebUI support.

36web commented 3 years ago

it's this image https://github.com/linuxserver/docker-deluge and I connect to it using webui

inside the container:

root@805ec1739f00:/# python3 --version
Python 3.6.9

It seems like the "six" python package version in the image (1.11.0) doesn't fit the requirement of this plugin (six>=1.12), the following steps are how I manage it to work, hope this helps.

Since there's no pip installed in this image, so we need to manually install the package.

  1. Run a shell in the docker container. docker exec -w /tmp -it <container name or id> bash

  2. Download the latest six package from PyPI. curl -sSLO https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz

  3. Extract the tar file. tar --no-same-owner --no-same-permissions -xf six-1.15.0.tar.gz

  4. Install the package. cp -r six-1.15.0/six.egg-info/ /usr/lib/python3/dist-packages/six-1.15.0.egg-info/ && cp six-1.15.0/six.py /usr/lib/python3/dist-packages/

  5. Remove the old one. rm -rf /usr/lib/python3/dist-packages/six-1.11.0.egg-info/

  6. Exit shell and restart container.

hugalafutro commented 3 years ago

Thanks @36web presumably I'll have to do this every time the image updates, but it is a solution.

arabcoders commented 3 years ago

you can make a Dockerfile build like this so you dont have to run this every time

FROM ghcr.io/linuxserver/deluge

RUN curl -sSLO https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz
RUN tar --no-same-owner --no-same-permissions -xf six-1.15.0.tar.gz
RUN cp -r six-1.15.0/six.egg-info/ /usr/lib/python3/dist-packages/six-1.15.0.egg-info/ && cp six-1.15.0/six.py /usr/lib/python3/dist-packages/
RUN rm -rf /usr/lib/python3/dist-packages/six-1.11.0.egg-info/

and you can have a docker-compose.yaml like this

version: "3.8"

services:
  deluge:
    build: .
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=UTC
      - DELUGE_LOGLEVEL=info
    volumes:
      - /var/config/deluge:/config
      - /downloads/torrents:/downloading
      - /downloads/completed:/completed
hugalafutro commented 3 years ago

@ArabCoders many thanks for that! That's gonna make life a lot easier while keeping everything as is.