linuxserver / docker-mods

Documentation and Examples of base container modifications
GNU General Public License v3.0
1.12k stars 284 forks source link

[FEAT] Add Branch plex-rclone #967

Open BitcircuitEU opened 1 month ago

BitcircuitEU commented 1 month ago

Is this a new feature request?

Name of mod

plex-rclone

Wanted change

Please add branch plex-rclone

Reason for change

Add Rclone Mod for Plex (and maybe jellyfin?) so that rclone mount can be used to utilize onedrive and other cloud storages as mount for mediafiles

Proposed code change

https://github.com/Abruccii/docker-mods/tree/plex-rclone

aptalca commented 1 month ago

If it's just installing a single repo package, there is no need for a new mod. You can use the universal package install mod: https://github.com/linuxserver/docker-mods/tree/universal-package-install

BitcircuitEU commented 1 month ago

If it's just installing a single repo package, there is no need for a new mod. You can use the universal package install mod: https://github.com/linuxserver/docker-mods/tree/universal-package-install

thanks for the info, that already helps alot. It is also possible to run a command on startup or create a service to mount rclone?

something like: /usr/bin/rclone mount \ --config=/config/rclone/rclone.conf \ --allow-other \ --cache-dir=/tmp/rclone/vfs \ --no-modtime \ --stats=0 \ --bwlimit=30M \ --dir-cache-time=120m \ --vfs-cache-mode full \ --vfs-cache-max-size 20G \ --user-agent "ISV|rclone.org|rclone/v1.62.2" \ --onedrive-no-versions \ --tpslimit 2 \ --cache-info-age=60m rMount:/ /media

thespad commented 1 month ago

If you need a service or additional logic then you'd have to look at a full mod. If you just need to run a one-off command then a custom init script will suffice: https://www.linuxserver.io/custom

BitcircuitEU commented 1 month ago

If you need a service or additional logic then you'd have to look at a full mod. If you just need to run a one-off command then a custom init script will suffice: https://www.linuxserver.io/custom

adding a file "Onedrive" to the custom-services folder according to the documentation you linked (i just changed the memcached command to rclone mount command) im getting the error exec: fatal: unable to exec bash : No such file or directory

plex:
    image: linuxserver/plex
    container_name: plex
    runtime: nvidia
    environment:
      - TZ=Europe/Berlin
      - VERSION=docker
      - PUID=0
      - PGID=0
      #- PLEX_CLAIM=#
      - NVIDIA_VISIBLE_DEVICES=all
      - DOCKER_MODS=linuxserver/mods:universal-package-install
      - INSTALL_PACKAGES=rclone|fuse
    volumes:
      - C:\Plex\config:/config
      - C:\Plex\custom-services:/custom-services.d
    devices:
      - /dev/fuse
    privileged: true
    network_mode: service:wireguard
    restart: unless-stopped
#!/usr/bin/with-contenv bash

exec rclone mount --config=/config/rclone.conf --allow-other --no-modtime --stats=0 --dir-cache-time=120m --vfs-cache-mode full --user-agent "ISV|rclone.org|rclone/v1.62.2" --onedrive-no-versions --cache-info-age=60m Onedrive:/ /media
thespad commented 1 month ago

Did you make the file executable?

BitcircuitEU commented 1 month ago

Did you make the file executable?

how am i supposed to change file permissions on first boot of the docker container? As the folder custom-services on the host is on a windows directory i think there is no "executable" option to set there

but as the error states the script seems to fail when executing bash and not the rclone command itself

thespad commented 1 month ago

Don't put it in a Windows directory?

You could mount it into the container and then chmod +x from inside the container as another option. We don't advise using Windows paths with containers regardless, because it causes so many issues.

Are you using Docker Desktop or WSL?

BitcircuitEU commented 1 month ago

Don't put it in a Windows directory?

You could mount it into the container and then chmod +x from inside the container as another option. We don't advise using Windows paths with containers regardless, because it causes so many issues.

Are you using Docker Desktop or WSL?

I am using Docker Desktop on Windows with WSL2 Engine. I have added a Ubuntu WSL Machine and chmodded the Onedrive file from there.

That fixed half of the error. Now i am just getting : No such file or directynable to exec bash

thespad commented 1 month ago

Probably Onedrive:/, you might have to quote or otherwise escape it.

BitcircuitEU commented 1 month ago

Probably Onedrive:/, you might have to quote or otherwise escape it.

Not sure why but issue is still Windows. Tried it on a Linux Vm and it seems to work. unfortunately i can't add a docker volume via compose to try this, might also be a windows issue. I try to install docker directly to a Ubuntu WSL machine without all this docker desktop stuff, lets see if that helps.

LinuxServer-CI commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.