[GUIDE] Configuring and using Transmission plugin for permissions

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [GUIDE] Configuring and using Transmission plugin for permissions

      Configuring and Using Transmission

      This is a mini guide to configure transmission to work with OMV.

      Intro

      By default transmission runs under this system daemon username: debian-trasmission, has his own primary group called also debian-transmission, NOT the default group users (GID=100)

      You can check with id debian-transmission and ps aux | grep transmission check first column

      Now as we know all default folders in OMV have the following permission schema:

      Ownership root:users
      Permission 2775

      Under this schema transmission CANNOT write to defaults shared folders created in the webGUI of OMV

      You have different approaches to solve this problem

      1) Add debian-transmission to the group users

      usermod -G users debian-transmission

      Now check with groups debian-transmission

      Note: Consider that with this transmission will be able to write to every default media folder of OpenMediaVault

      2) Change the ownership of the download folders

      We change the shared folder ownership that transmission is using to download

      chown debian-tranmission -R /media/<uuid>/FolderName

      If the folder already exists and has contents or comes from another install or server try

      chown debian-transmission:users -R /media/<uuid>/FolderName
      chmod 2775 -R /media/<uuid>/FolderName

      Notes:
      • Is your choice to user group users here, that means members from that group can delete stuff on that folder.
      • You can do this in the ACL windows without touching the ACL permissions to the right, but the openmediavault still adds a default ACL, that gets displayed at terminal that can confuse, but should not interfere with permission.
      3) ACL

      Open the ACL window and add debian-transmission to read-write, window to the right


      acl.png


      4) World write mode

      In the shared folder section open the reset permission tab, select the shared folder you currently use for transmission and reset to Everyone

      reset.png


      TIPS
      • When a permission problem occurs in transmission with a torrent, the only way to solve it is to delete the torrent, fix the permissions and add the torrent again.
      • Never change /etc/transmission/settings.json file manually, the plugin HAS FULL CONTROL of this file, if you add a change the next time you make a change in the OMV transmission section your change will be gone. The plugin provides a full interface for configuring every json key settings.
      • A flexible umask to transmission helps so files are writable by others, like if you want to edit or delete content from samba, SFTP or any other service
      Umask translation in transmission (Read here )

      Value 0 = 777 folders (666 files) mode. everyone can write
      Value 2 = 775 folders (664 files) mode owner and group can write) ## This is the preferred one
      Value 18 = 755 folders (644 files) mode only the owner can write

      In the plugin section you need to use the values represented in red
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server

      The post was edited 11 times, last by subzero79 ().

    • Bonus track: Unpack script for transmission

      This two scripts should unpack torrents with rar's. The first one will unpack to the same torrent location, the second one will unpack to another defined location. The log function will put some output in syslog.

      Same location
      Display Spoiler

      Shell-Script

      1. #!/bin/bash
      2. ######################
      3. TR_TORRENT_DIR=${TR_TORRENT_DIR:-$1}
      4. TR_TORRENT_NAME=${TR_TORRENT_NAME:-$2}
      5. torrentPath=${TR_TORRENT_DIR}/${TR_TORRENT_NAME}
      6. log_prefix="Transmission-Daemon"
      7. _log() {
      8. logger -t ${log_prefix} "$@"
      9. }
      10. _find_rars () {
      11. find "${1}" -type -f \( -iname \*.rar -o -iname \*.part1.rar -o -iname \*.part01.rar \)
      12. }
      13. _unrar_torrent () {
      14. find "${1}" \( -iname \*.rar -o -iname \*.part1.rar -o -iname \*.part01.rar \) -execdir unrar e {} "${2}" ";"
      15. }
      16. _log "$TR_TORRENT_NAME is finished, processing directory for unpacking"
      17. if [ -f "${torrentPath}" ];then
      18. _log "Single file torrent, nothing to do"
      19. exit
      20. elif [ -n $( _find_rars "${torrentPath}" ) ];then
      21. _log "Torrent with rar files, unpacking"
      22. _unrar_torrent ${torrentPath} .
      23. else
      24. _log "No rar files found"
      25. fi
      Display All



      Another location
      Display Spoiler

      Shell-Script

      1. #!/bin/bash
      2. ######################
      3. TR_TORRENT_DIR=${TR_TORRENT_DIR:-$1}
      4. TR_TORRENT_NAME=${TR_TORRENT_NAME:-$2}
      5. torrentPath=${TR_TORRENT_DIR}/${TR_TORRENT_NAME}
      6. extractLocation="/media/extract/"
      7. log_prefix="Transmission-Daemon"
      8. _log() {
      9. logger -t ${log_prefix} "$@"
      10. }
      11. _find_rars () {
      12. find "${1}" -type -f \( -iname \*.rar -o -iname \*.part1.rar -o -iname \*.part01.rar \)
      13. }
      14. _unrar_torrent () {
      15. find "${1}" \( -iname \*.rar -o -iname \*.part1.rar -o -iname \*.part01.rar \) -execdir unrar e {} "${2}" ";"
      16. }
      17. _log "$TR_TORRENT_NAME is finished, processing directory for unpacking"
      18. if [ -f "${torrentPath}" ];then
      19. _log "Single file torrent, nothing to do"
      20. exit
      21. elif [ -n $( _find_rars "${torrentPath}" ) ];then
      22. _log "Torrent with rar files, unpacking"
      23. mkdir -p "${extractLocation}"/"${TR_TORRENT_NAME}"
      24. _unrar_torrent "${torrentPath}" "${extractLocation}/${TR_TORRENT_NAME}"
      25. else
      26. _log "No rar files found"
      27. fi
      Display All



      Don't forget to make the files executable with chmod +x script.sh
      For testing this scripts without waiting for transmission to finish a torrent just run passing the environmental variables that transmission would use in a real torrent as arguments

      /path/to/script/./script_name torrent/path torrent_name

      Example

      /path/to/script/./script_name /media/7283242e-cb09-40ea-a27e-a91e58cd3dc6/torrent Line.of.Duty.S03E02

      Important note: Don't put the script in a folder in /media, those path in ext4 disks have noexec mount flag so you cannot run any software/script there. You can put the script in /usr/local/bin so you can call them from anywhere.
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server

      The post was edited 6 times, last by subzero79 ().