Giter Club home page Giter Club logo

Comments (23)

wfg avatar wfg commented on May 30, 2024 8

It's not as slick as setting a variable, but I actually just wrote a script that does several things on container start including remove those directories. You just create /config/custom-cont-init.d and throw this in there. Then, every time a linuxserver/transmission container starts, this script will run and remove the directories. I named mine 10-cleanup, but you can call it whatever you like.

#!/usr/bin/with-contenv bash

# clean up default directories
echo '[10-cleanup] *** Removing unused directories ***'
rmdir \
    /downloads/complete \
    /downloads/incomplete

Adding /watch to this is trivial.

Just thought I'd share what I'm doing until this is added as a variable. Hope it's useful!

from docker-transmission.

mathsaey avatar mathsaey commented on May 30, 2024 5

@mannibis you cannot disable the watch-dir through the settings as it is passed as a command-line option to transmission-daemon when it is started. I'm not sure why this is done.

If you want to work around this issue, you can put a script in /config/custom-cont-init.d/ with the following content:

#!/bin/bash

# Ensure the watch dir is not automatically enabled
sed -i 's|-c /watch||' /etc/services.d/transmission/run

This will effectively remove the watch-dir command line argument from the script that starts transmission. Be sure to disable the watch-dir in settings.json when the container is shut down before you try it out.

from docker-transmission.

thelamer avatar thelamer commented on May 30, 2024 5

This will not be implemented, we try to automate everything and make the user experience be run it and go for almost all of our containers.
This is not a large change and transmission has not been updated for some time, make your own docker mod to overide this default behavior or fork the code and build:
https://www.linuxserver.io/blog/2019-09-14-customizing-our-containers

from docker-transmission.

aptalca avatar aptalca commented on May 30, 2024 4

Not sure what foss has anything to do with it, but our discord is public and searchable, and is a perfectly fine place to have technical discussions with us. Same with our forum. Both of those places offer better search capabilities than GitHub.

from docker-transmission.

mannibis avatar mannibis commented on May 30, 2024 2

@yacht7 no problem!
However, I still cannot get "watch-dir-enabled": false to stick. Any ideas? Upon re-starting the container it defaults back to true. I am editing settings.json while the container is stopped of course.

from docker-transmission.

queeup avatar queeup commented on May 30, 2024 1

Also watch dir pls.

from docker-transmission.

urda avatar urda commented on May 30, 2024 1

@yacht7 while I would have loved this to be a setting in the container your tip was great advice. It was also how I learned how linuxserver allows you to make custom changes which is really slick.

I would still prefer this "option" to be available though as a user.

from docker-transmission.

mannibis avatar mannibis commented on May 30, 2024 1

@yacht7

I tried following your script advice, but it doesn't seem to work for me. Upon starting the transmission container, "/complete" and "/incomplete" are still created in "/downloads" even though my settings.json file has different directories listed. The setting persists across restarts but those damn default directories are still created.

I created a "custom-cont-init.d" file inside /config and pasted your script above. I saved it and chmod +x'ed it and also chowned it so the user:group would be 911:911. But it doesnt' work. Is there anything else I need to do? Thanks in advance

EDIT: Apologies, I misunderstood. You meant to create a folder named "custom-cont-init.d" and put the script in there! It works now. Thanks again. Now, if I could only figure out how to disable the watch folder. The setting in "settings.json" for watch folder doesn't persist across container restarts. It always defaults to "true". Deleting the folder won't seem to stop Transmission from scanning for new .torrents. Any idea how to disable the watch function at startup?

from docker-transmission.

kifeo avatar kifeo commented on May 30, 2024 1

@urda #142

from docker-transmission.

wfg avatar wfg commented on May 30, 2024

@mannibis sorry for just now getting to this. Glad you figured it out!

Regarding settings.json: make sure you are only making changes to the file while there's no container running.

from docker-transmission.

queeup avatar queeup commented on May 30, 2024

You can not do that through settings.json. Watch-dir enabling with startup script.

from docker-transmission.

github-actions avatar github-actions commented on May 30, 2024

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

from docker-transmission.

abelino avatar abelino commented on May 30, 2024

I've been mounting a volume to override the /defaults/settings.json file. With that approach I am able to define the base default settings and allow the init script to do it's thing i.e. override the username/password. I do believe the dir creation should be handled here but perhaps by grabbing the values from /defaults/settings.json and conditionally creating the incomplete/watch dirs? For example:

/root/etc/cont-init.d/20-config

#!/usr/bin/with-contenv bash

# copy config
[[ ! -f /config/settings.json ]] && cp \
	/defaults/settings.json /config/settings.json

if [ ! -z "$USER" ] && [ ! -z "$PASS" ]; then
	sed -i '/rpc-authentication-required/c\    "rpc-authentication-required": true,' /config/settings.json
	sed -i "/rpc-username/c\    \"rpc-username\": \"$USER\"," /config/settings.json
	sed -i "/rpc-password/c\    \"rpc-password\": \"$PASS\"," /config/settings.json
fi

# update ownership for settings.json
chown abc:abc /config/settings.json

# create downloads folders if it doesn't already exist
settings_path=/defaults/settings.json
download_dir=$(jq '."download-dir"' $settings_path)
if [ ! -d $download_dir ]; then
  mkdir -p $download_dir
fi
chown abc:abc $download_dir

# create incomplete_dir if enabled and update ownership
incomplete_dir_enabled=$(jq '."incomplete-dir-enabled"' $settings_path)
if [[ $incomplete_dir_enabled = 'true' ]]; then
  incomplete_dir=$(jq '."incomplete-dir"' $settings_path)
  mkdir -p $incomplete_dir
  chown abc:abc $incomplete_dir
fi

# create watch_dir if enabled and update ownership
watch_dir_enabled=$(jq '."watch-dir-enabled"' $settings_path)
if [[ $watch_dir_enabled = 'true' ]]; then
  watch_dir=$(jq '."watch-dir"' $settings_path)
  mkdir -p $watch_dir
  chown abc:abc $watch_dir
fi

Something like that. Thoughts?

from docker-transmission.

johnappletree avatar johnappletree commented on May 30, 2024

Hi all!
I created a pull-request that should mitigate this issue.
#142

Cheers,
J.

from docker-transmission.

elisimpson avatar elisimpson commented on May 30, 2024

@mathsaey thanks for the tip about how to disable watch-dir! This really should be fixed in the code so it doesn't need this hack, but I really appreciate the work-around in the meantime.

from docker-transmission.

github-actions avatar github-actions commented on May 30, 2024

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

from docker-transmission.

KodyVB avatar KodyVB commented on May 30, 2024

I know this is old, but I'm posting this solution in case there's anyone else who has this problem in the future.

My fix for this was to just use my own directory instead of /downloads. For the following example, it'll be /media. So instead of downloading something like Linux iso's to /downloads/linux_isos/ it would be to /media/linux_isos/. I also disable the incomplete dirs option in the GUI so it adds the *.part to the end destination and I don't use any watch directories. Using docker-compose, you'll have to run docker-compose stop transmission and docker-compose up transmission to have the changes take effect if you're doing this to an existing container, and you'll have to set the new locations to any existing torrents, using the check mark that says the data is already there. In my experience, after setting the new locations, it wouldn't actually change the locations until I ran docker-compose restart transmission, though. Also, you could add paths to the :/downloads and :/watch options if those mappings matter to you.

---
version: "2.1"
services:
  transmission:
    image: lscr.io/linuxserver/transmission
    container_name: transmission
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - TRANSMISSION_WEB_HOME=/combustion-release/ #optional
      - USER=username #optional
      - PASS=password #optional
      - WHITELIST=iplist #optional
      - HOST_WHITELIST=dnsnane list #optional
    volumes:
      - <path to data>:/config
      - <path to downloads>:/media
    ports:
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: unless-stopped

from docker-transmission.

github-actions avatar github-actions commented on May 30, 2024

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

from docker-transmission.

kifeo avatar kifeo commented on May 30, 2024

Hi @johnappletree , did you push your version to a docker hub ? I would like to use your image. thanks !

from docker-transmission.

johnappletree avatar johnappletree commented on May 30, 2024

@kifeo my changes got declined, the linuxserver wanted to stick to the current state.
You could fix this issue by mounting other folders...

from docker-transmission.

urda avatar urda commented on May 30, 2024

@johnappletree can you link the PR for historical reasons?

from docker-transmission.

kifeo avatar kifeo commented on May 30, 2024

I saw that, too bad. Thanks for the advice!

I changed to :
- /mnt/media/downloads:/media/complete
- ./incomplete:/media/incomplete

and then changed the remote settings with transmission-remote
finally did a 'docker-compose restart transmission'

from docker-transmission.

urda avatar urda commented on May 30, 2024

@urda #142

Thanks, I couldn't seem to find it.

That response from a contributing member is pretty anti-customer coupled with the reality that Discord is NOT FOSS nor is it a place where technical discussions should ever occur in a public project.

I've lost trust in the images here because of this anti-customer and anti-FOSS behavior. Sad.

from docker-transmission.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.