From 970afab1da67f029f8cdc1b515ab0005ee2e1f48 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 7 Mar 2021 23:17:58 -0500 Subject: [PATCH 01/15] Transmission group change: root to debian-transmission --- roles/transmission/defaults/main.yml | 2 +- roles/transmission/tasks/enable-or-disable.yml | 2 +- vars/default_vars.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/transmission/defaults/main.yml b/roles/transmission/defaults/main.yml index 023fbc224..ae49da71b 100644 --- a/roles/transmission/defaults/main.yml +++ b/roles/transmission/defaults/main.yml @@ -7,7 +7,7 @@ # Transmission download directory & general owner/group # transmission_download_dir: "{{ content_base }}/transmission/" # /library/transmission/ # transmission_user: debian-transmission -# transmission_group: root +# transmission_group: debian-transmission # Monitor downloads at http://box:9091 or http://box:9091/transmission using Admin/changeme # transmission_http_port: 9091 diff --git a/roles/transmission/tasks/enable-or-disable.yml b/roles/transmission/tasks/enable-or-disable.yml index a5ec5b3b6..16bb091de 100644 --- a/roles/transmission/tasks/enable-or-disable.yml +++ b/roles/transmission/tasks/enable-or-disable.yml @@ -13,7 +13,7 @@ -n {{ transmission_username }}:{{ transmission_password }} -a http://pantry.learningequality.org/downloads/ka-lite/{{ transmission_kalite_version }}/content/ka-lite-0.17-resized-videos-{{ item }}.torrent with_items: "{{ transmission_kalite_languages }}" - when: transmission_enabled and transmission_provision and transmission_kalite_languages is defined and transmission_kalite_languages is not none + when: transmission_enabled and transmission_provision and transmission_kalite_languages is defined and transmission_kalite_languages is not none # '!= None' also works (i.e. to avoid var value 'null', with type 'NoneType') ignore_errors: yes - name: Disable & Stop 'transmission-daemon' service, if not transmission_enabled diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 1f7351cc9..b85cea197 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -507,11 +507,11 @@ transmission_password: changeme # Transmission download directory & general owner/group transmission_download_dir: "{{ content_base }}/transmission/" # /library/transmission/ transmission_user: debian-transmission -transmission_group: root +transmission_group: debian-transmission # Monitor downloads at http://box:9091 or http://box:9091/transmission using Admin/changeme transmission_http_port: 9091 -transmission_url : /transmission/ +transmission_url: /transmission/ transmission_peer_port: 51413 # Provision Transmission with torrent(s) from http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ From f8c619deac56710f33d0aebf7a19ab07743717b3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 7 Mar 2021 23:40:43 -0500 Subject: [PATCH 02/15] Update roles/transmission/README.rst --- roles/transmission/README.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index b61385d5d..4b1f89c87 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -1,3 +1,11 @@ +.. |ss| raw:: html + + + +.. |se| raw:: html + + + =================== Transmission README =================== @@ -68,7 +76,7 @@ You can also download other torrents using Transmission's web interface, or by t Known Issues ------------ -* Default Transmission user/group may need fixing (https://github.com/transmission/transmission/issues/537) in some circumstances. You can set Ansible variables 'transmission_user' and 'transmission_group' e.g. in /opt/iiab/iiab/roles/transmission/defaults/main.yml (you might need 'User=' and 'Group=' in systemd unit file /lib/systemd/system/transmission-daemon.service — e.g. both might need to be set to 'debian-transmission' — if so then run 'systemctl daemon-reload' and 'systemctl restart transmission-daemon'). +* |ss| Default Transmission user/group may need fixing (https://github.com/transmission/transmission/issues/537) in some circumstances. You can set Ansible variables 'transmission_user' and 'transmission_group' e.g. in /opt/iiab/iiab/roles/transmission/defaults/main.yml (you might need 'User=' and 'Group=' in systemd unit file /lib/systemd/system/transmission-daemon.service — e.g. both might need to be set to 'debian-transmission' — if so then run 'systemctl daemon-reload' and 'systemctl restart transmission-daemon'). |se| `PR #2703 `_ * Random Ports: Currently it is not possible to use random ports in the range 49152-65535. It is difficult to open multiple ports in IIAB's iptables-based firewall. From d63c463591820d9e3c86a5fb56e3e35246957831 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 7 Mar 2021 23:45:01 -0500 Subject: [PATCH 03/15] Update roles/transmission/README.rst --- roles/transmission/README.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 4b1f89c87..e9e2952dd 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -5,7 +5,10 @@ .. |se| raw:: html - + +.. |nbsp| unicode:: 0xA0 + :trim: + =================== Transmission README =================== @@ -76,7 +79,7 @@ You can also download other torrents using Transmission's web interface, or by t Known Issues ------------ -* |ss| Default Transmission user/group may need fixing (https://github.com/transmission/transmission/issues/537) in some circumstances. You can set Ansible variables 'transmission_user' and 'transmission_group' e.g. in /opt/iiab/iiab/roles/transmission/defaults/main.yml (you might need 'User=' and 'Group=' in systemd unit file /lib/systemd/system/transmission-daemon.service — e.g. both might need to be set to 'debian-transmission' — if so then run 'systemctl daemon-reload' and 'systemctl restart transmission-daemon'). |se| `PR #2703 `_ +* |ss| Default Transmission user/group may need fixing (https://github.com/transmission/transmission/issues/537) in some circumstances. You can set Ansible variables 'transmission_user' and 'transmission_group' e.g. in /opt/iiab/iiab/roles/transmission/defaults/main.yml (you might need 'User=' and 'Group=' in systemd unit file /lib/systemd/system/transmission-daemon.service — e.g. both might need to be set to 'debian-transmission' — if so then run 'systemctl daemon-reload' and 'systemctl restart transmission-daemon'). |se| |nbsp| `PR #2703 `_ * Random Ports: Currently it is not possible to use random ports in the range 49152-65535. It is difficult to open multiple ports in IIAB's iptables-based firewall. From ddb3f25f69c15ff4dde833ff4dca62011e2b444c Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 8 Mar 2021 08:19:03 -0500 Subject: [PATCH 04/15] transmission/tasks/install.yml: update inline comments --- roles/transmission/tasks/install.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/transmission/tasks/install.yml b/roles/transmission/tasks/install.yml index 684b3fe14..a26361a05 100644 --- a/roles/transmission/tasks/install.yml +++ b/roles/transmission/tasks/install.yml @@ -9,8 +9,8 @@ file: state: directory path: "{{ transmission_download_dir }}" # /library/transmission - owner: "{{ transmission_user }}" # debian-transmission - group: "{{ transmission_group }}" # root + owner: "{{ transmission_user }}" # debian-transmission + group: "{{ transmission_group }}" # debian-transmission # mode: '0755' - name: Stop 'transmission-daemon' systemd service, before modifying its settings @@ -23,9 +23,9 @@ template: src: settings.json.j2 dest: /etc/transmission-daemon/settings.json - owner: "{{ transmission_user }}" # debian-transmission - group: "{{ transmission_group }}" # root - # mode: '0644' + owner: "{{ transmission_user }}" # debian-transmission + group: "{{ transmission_group }}" # debian-transmission + # mode: '0600' # RECORD Transmission AS INSTALLED From f11b296a25565b86e31148342e4a904781f95510 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 8 Mar 2021 08:36:51 -0500 Subject: [PATCH 05/15] kalite/tasks/install.yml: cleaner comments / Ansible output --- roles/kalite/tasks/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 0ba4a0941..16a9a1341 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -5,7 +5,7 @@ timeout: "{{ download_timeout }}" when: internet_available -# 2020-01-19: https://github.com/piwheels/packages/issues/74 says the following is not longer needed... +# 2020-01-19: https://github.com/piwheels/packages/issues/74 says the following is no longer needed... #- name: Run 'mv /etc/pip.conf /etc/pip.conf.see-iiab-issue-2139' as "TEMPORARY" workaround (2020-01-17) for piwheels.org's setuptools Python 2/3 brokenness on RPi (https://github.com/iiab/iiab/issues/2139) # command: mv /etc/pip.conf /etc/pip.conf.see-iiab-issue-2139 # ignore_errors: yes @@ -31,7 +31,7 @@ when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19) # long form of (is_debian_11+ or is_ubuntu_20+) -- name: Use pip to install KA Lite static to {{ kalite_venv }} +- name: Use pip to install ka-lite-static to {{ kalite_venv }} pip: name: ka-lite-static version: "{{ kalite_version }}" From a35d820eabdf565e68e2c6a4463353a3be29fbc6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 11 Mar 2021 22:36:33 -0500 Subject: [PATCH 06/15] Update calibre-web/tasks/install.yml --- roles/calibre-web/tasks/install.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/calibre-web/tasks/install.yml b/roles/calibre-web/tasks/install.yml index 9f58f1383..b6411b7f4 100644 --- a/roles/calibre-web/tasks/install.yml +++ b/roles/calibre-web/tasks/install.yml @@ -13,13 +13,13 @@ line: ' ' state: present -- name: "Create 3 Calibre-Web folders to store data and config files: {{ calibreweb_home }}, {{ calibreweb_venv_path }}, {{ calibreweb_config }} (all set to {{ calibreweb_user }}:{{ apache_user }}, '0755')" +- name: "Create 3 Calibre-Web folders to store data and config files: {{ calibreweb_home }}, {{ calibreweb_venv_path }}, {{ calibreweb_config }} (all set to {{ calibreweb_user }}:{{ apache_user }})" file: state: directory path: "{{ item }}" owner: "{{ calibreweb_user }}" # root group: "{{ apache_user }}" # www-data on debuntu - mode: '0755' + #mode: '0755' with_items: - "{{ calibreweb_home }}" # /library/calibre-web - "{{ calibreweb_config }}" # /library/calibre-web/config @@ -74,7 +74,7 @@ dest: "{{ calibreweb_home }}" # /library/calibre-web owner: "{{ calibreweb_user }}" # root group: "{{ apache_user }}" # www-data on debuntu - mode: '0644' + #mode: '0644' backup: yes with_items: - roles/calibre-web/files/metadata.db @@ -88,7 +88,7 @@ dest: "{{ calibreweb_config }}" # /library/calibre-web/config owner: "{{ calibreweb_user }}" # root group: "{{ apache_user }}" # www-data on debuntu - mode: '0644' + #mode: '0644' backup: yes when: not metadatadb.stat.exists #when: calibreweb_provision From 4496989846d5a453ddde8ca7c31f3af2094f3375 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 13 Mar 2021 18:49:46 -0500 Subject: [PATCH 07/15] Transmission: cleanup of obsolete vars, default values & doc --- roles/transmission/README.rst | 15 +++++++++-- roles/transmission/defaults/main.yml | 2 ++ .../transmission/tasks/enable-or-disable.yml | 3 +++ roles/transmission/templates/settings.json.j2 | 25 ++++++++----------- vars/default_vars.yml | 2 ++ 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index e9e2952dd..96c5987a2 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -59,7 +59,7 @@ Then edit the file:: nano /etc/transmission-daemon/settings.json -Here are some short explanations, as to what those 70+ variables mean: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files +Here are some short explanations, as to what those ~68 variables mean: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files After saving your changes in 'settings.json' restart Transmission by running:: @@ -74,7 +74,7 @@ Please read the lettered instructions (A, B, C, D) in `/etc/iiab/local_vars.yml You can also download other torrents using Transmission's web interface, or by typing 'transmission-remote' at the command-line:: - transmission-remote -a + transmission-remote -n Admin:changeme -a Known Issues ------------ @@ -95,3 +95,14 @@ Re-check that Transmission's settings are correct here: (by following the instru :: /etc/transmission-daemon/settings.json + +More advanced configuration and status are in directory ``/var/lib/transmission-daemon/info/`` here:: + + blocklists/ + dht.dat + resume/ + settings.json -> /etc/transmission-daemon/settings.json + stats.json + torrents/ + +These are further explained in https://github.com/transmission/transmission/wiki/Configuration-Files (to correspond with the above path, apt package transmission-daemon sets user debian-transmission's home directory to /var/lib/transmission-daemon in /etc/passwd). diff --git a/roles/transmission/defaults/main.yml b/roles/transmission/defaults/main.yml index ae49da71b..70f155c63 100644 --- a/roles/transmission/defaults/main.yml +++ b/roles/transmission/defaults/main.yml @@ -12,6 +12,8 @@ # Monitor downloads at http://box:9091 or http://box:9091/transmission using Admin/changeme # transmission_http_port: 9091 # transmission_url: /transmission/ +# transmission_whitelist: 127.0.0.1,192.168.*.*,172.18.96.*,10.8.0.* +# transmission_whitelist_enabled: false # Use lowercase # transmission_peer_port: 51413 # Provision Transmission with torrent(s) from http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ diff --git a/roles/transmission/tasks/enable-or-disable.yml b/roles/transmission/tasks/enable-or-disable.yml index 16bb091de..8804c5b17 100644 --- a/roles/transmission/tasks/enable-or-disable.yml +++ b/roles/transmission/tasks/enable-or-disable.yml @@ -6,6 +6,9 @@ state: restarted when: transmission_enabled +- debug: + var: transmission_kalite_languages + - name: Add PAUSED KA Lite torrent(s) to transmission-daemon's queue shell: > /usr/bin/transmission-remote diff --git a/roles/transmission/templates/settings.json.j2 b/roles/transmission/templates/settings.json.j2 index 8e62d0e6f..a88b478b5 100644 --- a/roles/transmission/templates/settings.json.j2 +++ b/roles/transmission/templates/settings.json.j2 @@ -13,34 +13,31 @@ "cache-size-mb": 4, "dht-enabled": true, "download-dir": "{{ transmission_download_dir }}", - "download-limit": 100, - "download-limit-enabled": 0, "download-queue-enabled": true, "download-queue-size": 5, "encryption": 1, "idle-seeding-limit": 30, "idle-seeding-limit-enabled": false, - "incomplete-dir": "/var/lib/transmission-daemon/Downloads", + "incomplete-dir": "/var/lib/transmission-daemon/downloads", "incomplete-dir-enabled": false, "lpd-enabled": false, - "max-peers-global": 200, - "message-level": 1, + "message-level": 2, "peer-congestion-algorithm": "", "peer-id-ttl-hours": 6, - "peer-limit-global": 200, - "peer-limit-per-torrent": 50, + "peer-limit-global": 240, + "peer-limit-per-torrent": 60, "peer-port": {{ transmission_peer_port }}, "peer-port-random-high": 65535, "peer-port-random-low": 49152, "peer-port-random-on-start": false, "peer-socket-tos": "default", "pex-enabled": true, - "port-forwarding-enabled": false, + "port-forwarding-enabled": true, "preallocation": 1, "prefetch-enabled": true, "queue-stalled-enabled": true, "queue-stalled-minutes": 30, - "ratio-limit": 2, + "ratio-limit": 2.0, "ratio-limit-enabled": false, "rename-partial-files": true, "rpc-authentication-required": true, @@ -52,8 +49,8 @@ "rpc-port": {{ transmission_http_port }}, "rpc-url": "{{ transmission_url }}", "rpc-username": "{{ transmission_username }}", - "rpc-whitelist": "127.0.0.1,192.168.*.*,172.18.96.*,10.8.0.*", - "rpc-whitelist-enabled": false, + "rpc-whitelist": "{{ transmission_whitelist }}", + "rpc-whitelist-enabled": "{{ transmission_whitelist_enabled }}", "scrape-paused-torrents-enabled": true, "script-torrent-done-enabled": false, "script-torrent-done-filename": "", @@ -66,8 +63,8 @@ "start-added-torrents": true, "trash-original-torrent-files": false, "umask": 18, - "upload-limit": 100, - "upload-limit-enabled": 0, "upload-slots-per-torrent": 14, - "utp-enabled": true + "utp-enabled": true, + "watch-dir": "", + "watch-dir-enabled": false } diff --git a/vars/default_vars.yml b/vars/default_vars.yml index b85cea197..25860b3e9 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -512,6 +512,8 @@ transmission_group: debian-transmission # Monitor downloads at http://box:9091 or http://box:9091/transmission using Admin/changeme transmission_http_port: 9091 transmission_url: /transmission/ +transmission_whitelist: 127.0.0.1,192.168.*.*,172.18.96.*,10.8.0.* +transmission_whitelist_enabled: false # Use lowercase transmission_peer_port: 51413 # Provision Transmission with torrent(s) from http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ From 2f246e80acea6c565445e3530757c98fa8412845 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 13 Mar 2021 19:41:17 -0500 Subject: [PATCH 08/15] Update roles/transmission/README.rst --- roles/transmission/README.rst | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 96c5987a2..cce77b949 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -28,30 +28,24 @@ Caveat emptor! (That's Latin for "Buyer Beware") Using It -------- -Install Transmission by setting 'transmission_install' and 'transmission_enabled' to True in `/etc/iiab/local_vars.yml `_ — carefully choosing language(s) for KA Lite videos you want to download — and then run:: +Install Transmission by setting 'transmission_install' and 'transmission_enabled' to True in `/etc/iiab/local_vars.yml `_ — carefully choosing language(s) for KA Lite videos you want to download — and then install IIAB. Or, if IIAB is already installed, run as root:: cd /opt/iiab/iiab ./runrole transmission - ./iiab-network - -Or if you prefer a complete reinstall of IIAB:: - - cd /opt/iiab/iiab - ./iiab-install --reinstall -Login to Transmission's web interface http://box:9091 using administrative account:: +Log in to Transmission's web interface http://box:9091 using administrative account:: Username: Admin Password: changeme -Alternatively, you can run ``transmission-remote`` at the command-line. +If you prefer the command-line, you can instead run `transmission-remote `_ commands. Configuration ------------- Configure Transmission using its web interface: http://box:9091 -More settings can be changed within /etc/transmission-daemon/settings.json if you first ensure that the transmission-daemon.service is stopped:: +More settings can be changed within `/etc/transmission-daemon/settings.json `_ if you first ensure that the transmission-daemon.service is stopped:: systemctl stop transmission-daemon @@ -61,7 +55,7 @@ Then edit the file:: Here are some short explanations, as to what those ~68 variables mean: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files -After saving your changes in 'settings.json' restart Transmission by running:: +After saving your changes in 'settings.json', restart Transmission by running:: systemctl restart transmission-daemon @@ -72,16 +66,16 @@ Transmission can facilitate provisioning content onto your IIAB, e.g. by adding Please read the lettered instructions (A, B, C, D) in `/etc/iiab/local_vars.yml `_ and 'KA Lite Administration: What tips & tricks exist?' at http://FAQ.IIAB.IO outlining how to use Transmission to download and then install KA Lite content. -You can also download other torrents using Transmission's web interface, or by typing 'transmission-remote' at the command-line:: +You can also download other torrents using Transmission's web interface, or by typing `transmission-remote `_ at the command-line:: - transmission-remote -n Admin:changeme -a + transmission-remote -n Admin:changeme -a Known Issues ------------ * |ss| Default Transmission user/group may need fixing (https://github.com/transmission/transmission/issues/537) in some circumstances. You can set Ansible variables 'transmission_user' and 'transmission_group' e.g. in /opt/iiab/iiab/roles/transmission/defaults/main.yml (you might need 'User=' and 'Group=' in systemd unit file /lib/systemd/system/transmission-daemon.service — e.g. both might need to be set to 'debian-transmission' — if so then run 'systemctl daemon-reload' and 'systemctl restart transmission-daemon'). |se| |nbsp| `PR #2703 `_ -* Random Ports: Currently it is not possible to use random ports in the range 49152-65535. It is difficult to open multiple ports in IIAB's iptables-based firewall. +* Random Ports: Currently it is not possible to use random ports in the range 49152-65535. It is difficult to open multiple ports in IIAB's `iptables-based firewall `_. Troubleshooting --------------- From 41cbfdfaf27101c7ebfecae63248f36093a094ae Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Mar 2021 10:07:46 -0400 Subject: [PATCH 09/15] Elaborate/Clarify roles/transmission/README.rst --- roles/transmission/README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index cce77b949..927a0cefc 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -84,13 +84,13 @@ Verify that transmission-daemon is running:: systemctl status transmission-daemon -Re-check that Transmission's settings are correct here: (by following the instructions above, under 'Configuration') +Re-check that Transmission's settings are correct here: (by following the instructions above, under `Configuration <./README.rst#Configuration>`_) :: /etc/transmission-daemon/settings.json -More advanced configuration and status are in directory ``/var/lib/transmission-daemon/info/`` here:: +More advanced configuration and status are in directory ``/var/lib/transmission-daemon/info/`` (symlinked to /var/lib/transmission-daemon/.config/transmission-daemon/) here:: blocklists/ dht.dat @@ -99,4 +99,4 @@ More advanced configuration and status are in directory ``/var/lib/transmission- stats.json torrents/ -These are further explained in https://github.com/transmission/transmission/wiki/Configuration-Files (to correspond with the above path, apt package transmission-daemon sets user debian-transmission's home directory to /var/lib/transmission-daemon in /etc/passwd). +These are further explained in https://github.com/transmission/transmission/wiki/Configuration-Files (to align with the above, apt package transmission-daemon sets user debian-transmission's home directory to ``/var/lib/transmission-daemon`` in /etc/passwd). From ac4158ec76f026f84f06e81fae759c35fe94ff7f Mon Sep 17 00:00:00 2001 From: root Date: Sun, 14 Mar 2021 17:46:14 -0400 Subject: [PATCH 10/15] Transmission fixes as it doesn't follow its own docs --- roles/transmission/README.rst | 4 ++- roles/transmission/tasks/install.yml | 35 ++++++++++++++++--- roles/transmission/templates/settings.json.j2 | 6 ++-- vars/default_vars.yml | 4 +-- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index cce77b949..097aa0cc4 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -59,6 +59,8 @@ After saving your changes in 'settings.json', restart Transmission by running:: systemctl restart transmission-daemon +*2021-03-14: Transmission 2.94 and 3.00 were intermittently* **ignoring** */etc/transmission-daemon/settings.json (presumably when the file was deemed problematic/missing/etc) and creating their own* ``/var/lib/transmission-daemon/.config/transmission-daemon/settings.json`` *(i.e. suddenly a FILE instead of transmission-deamon's out-of-the-box SYMLINK to /etc/transmission-daemon/settings.json). IIAB `PR #2707 `_ should fix this problem, by reversing the direction of the symlink created by apt. See* `Troubleshooting <./README.rst#Troubleshooting>`_ *below.* + Adding Torrents --------------- @@ -95,7 +97,7 @@ More advanced configuration and status are in directory ``/var/lib/transmission- blocklists/ dht.dat resume/ - settings.json -> /etc/transmission-daemon/settings.json + settings.json <- /etc/transmission-daemon/settings.json (`PR #2707 `_ CREATES THIS SYMLINK!) stats.json torrents/ diff --git a/roles/transmission/tasks/install.yml b/roles/transmission/tasks/install.yml index a26361a05..015116b82 100644 --- a/roles/transmission/tasks/install.yml +++ b/roles/transmission/tasks/install.yml @@ -19,13 +19,38 @@ state: stopped ignore_errors: yes -- name: Install /etc/transmission-daemon/settings.json from template - template: - src: settings.json.j2 - dest: /etc/transmission-daemon/settings.json +- name: Back up prior /etc/transmission-daemon/settings.json (original file from apt, or new symlink contents) to /etc/transmission-daemon/settings.json.old* + copy: + src: /etc/transmission-daemon/settings.json + dest: /etc/transmission-daemon/settings.json.old + mode: preserve owner: "{{ transmission_user }}" # debian-transmission group: "{{ transmission_group }}" # debian-transmission - # mode: '0600' + backup: yes + ignore_errors: yes + +- name: "Back up IIAB's templated version to /etc/transmission-daemon/settings.json.iiab" + template: + src: settings.json.j2 + dest: /etc/transmission-daemon/settings.json.iiab + owner: "{{ transmission_user }}" # debian-transmission + group: "{{ transmission_group }}" # debian-transmission + mode: '0600' + +- name: Install /var/lib/transmission-daemon/.config/transmission-daemon/settings.json from template + template: + src: settings.json.j2 + dest: /var/lib/transmission-daemon/.config/transmission-daemon/settings.json + owner: "{{ transmission_user }}" # debian-transmission + group: "{{ transmission_group }}" # debian-transmission + mode: '0600' + +- name: "Reverse Transmission's fragile OOTB symlink -- instead we establish /etc/transmission-daemon/settings.json -> /var/lib/transmission-daemon/.config/transmission-daemon/settings.json -- REASON: /etc/transmission-daemon/settings.json was intermittently being IGNORED, as Transmission sometimes breaks its own symlink from /var/lib/transmission-daemon/.config/transmission-daemon/settings.json (by turning it into a file instead)" + file: + path: /etc/transmission-daemon/settings.json + src: /var/lib/transmission-daemon/.config/transmission-daemon/settings.json + state: link + force: yes # RECORD Transmission AS INSTALLED diff --git a/roles/transmission/templates/settings.json.j2 b/roles/transmission/templates/settings.json.j2 index a88b478b5..d0fc5ad14 100644 --- a/roles/transmission/templates/settings.json.j2 +++ b/roles/transmission/templates/settings.json.j2 @@ -24,8 +24,8 @@ "message-level": 2, "peer-congestion-algorithm": "", "peer-id-ttl-hours": 6, - "peer-limit-global": 240, - "peer-limit-per-torrent": 60, + "peer-limit-global": 200, + "peer-limit-per-torrent": 50, "peer-port": {{ transmission_peer_port }}, "peer-port-random-high": 65535, "peer-port-random-low": 49152, @@ -50,7 +50,7 @@ "rpc-url": "{{ transmission_url }}", "rpc-username": "{{ transmission_username }}", "rpc-whitelist": "{{ transmission_whitelist }}", - "rpc-whitelist-enabled": "{{ transmission_whitelist_enabled }}", + "rpc-whitelist-enabled": {{ transmission_whitelist_enabled }}, "scrape-paused-torrents-enabled": true, "script-torrent-done-enabled": false, "script-torrent-done-filename": "", diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 25860b3e9..8dc0ddc90 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -512,8 +512,8 @@ transmission_group: debian-transmission # Monitor downloads at http://box:9091 or http://box:9091/transmission using Admin/changeme transmission_http_port: 9091 transmission_url: /transmission/ -transmission_whitelist: 127.0.0.1,192.168.*.*,172.18.96.*,10.8.0.* -transmission_whitelist_enabled: false # Use lowercase +transmission_whitelist: 127.0.0.1,::1,192.168.*.*,172.18.96.*,10.8.0.* +transmission_whitelist_enabled: "false" # LOWERCASE STRING for settings.json transmission_peer_port: 51413 # Provision Transmission with torrent(s) from http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ From 2ae6e8b11e0b38942184fada2021664f81983d09 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Mar 2021 18:01:19 -0400 Subject: [PATCH 11/15] Clean up roles/transmission/README.rst --- roles/transmission/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 097aa0cc4..e94b33e16 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -59,7 +59,7 @@ After saving your changes in 'settings.json', restart Transmission by running:: systemctl restart transmission-daemon -*2021-03-14: Transmission 2.94 and 3.00 were intermittently* **ignoring** */etc/transmission-daemon/settings.json (presumably when the file was deemed problematic/missing/etc) and creating their own* ``/var/lib/transmission-daemon/.config/transmission-daemon/settings.json`` *(i.e. suddenly a FILE instead of transmission-deamon's out-of-the-box SYMLINK to /etc/transmission-daemon/settings.json). IIAB `PR #2707 `_ should fix this problem, by reversing the direction of the symlink created by apt. See* `Troubleshooting <./README.rst#Troubleshooting>`_ *below.* +*2021-03-14: Transmission 2.94 and 3.00 were intermittently* **ignoring** */etc/transmission-daemon/settings.json (presumably when the file was deemed problematic/missing/etc) and creating their own* ``/var/lib/transmission-daemon/.config/transmission-daemon/settings.json`` *(i.e. suddenly a FILE instead of transmission-deamon's out-of-the-box SYMLINK to /etc/transmission-daemon/settings.json). IIAB* `PR #2707 `_ *should fix this problem, by reversing the direction of the symlink created by apt. See* `Troubleshooting <./README.rst#Troubleshooting>`_ *below.* Adding Torrents --------------- @@ -97,7 +97,7 @@ More advanced configuration and status are in directory ``/var/lib/transmission- blocklists/ dht.dat resume/ - settings.json <- /etc/transmission-daemon/settings.json (`PR #2707 `_ CREATES THIS SYMLINK!) + settings.json <- /etc/transmission-daemon/settings.json (PR #2707 CREATES THIS SYMLINK!) stats.json torrents/ From 7d53e4834ab887d3b8a9a29bff86ae0428fca64d Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Mar 2021 20:06:03 -0400 Subject: [PATCH 12/15] transmission/README.rst: How to turn on logging & PID --- roles/transmission/README.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 72a78df63..67481991f 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -102,3 +102,16 @@ More advanced configuration and status are in directory ``/var/lib/transmission- torrents/ These are further explained in https://github.com/transmission/transmission/wiki/Configuration-Files (to align with the above, apt package transmission-daemon sets user debian-transmission's home directory to ``/var/lib/transmission-daemon`` in /etc/passwd). + +Logging +------- + +To turn on logging and/or record the Process ID (PID), follow these instructions: https://pawelrychlicki.pl/Home/Details/59/transmission-daemon-doesnt-create-a-log-file-nor-a-pid-file-ubuntu-server-1804 + +This gives permissions to user ``debian-transmission`` — if you use these 3 lines in ``/lib/systemd/system/transmission-daemon.service`` : + +:: + + RuntimeDirectory=transmission-daemon + LogsDirectory=transmission-daemon + ExecStart=/usr/bin/transmission-daemon -f --log-error --log-debug --logfile /var/log/transmission-daemon/transmission.log --pid-file /run/transmission-daemon/transmission.pid From ba62be5cb41e0f6525504d808361d70c3cfdba1b Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Mar 2021 20:12:55 -0400 Subject: [PATCH 13/15] transmission/README.rst: Advice on editing /lib unit files --- roles/transmission/README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 67481991f..53de76d8a 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -115,3 +115,5 @@ This gives permissions to user ``debian-transmission`` — if you use these 3 li RuntimeDirectory=transmission-daemon LogsDirectory=transmission-daemon ExecStart=/usr/bin/transmission-daemon -f --log-error --log-debug --logfile /var/log/transmission-daemon/transmission.log --pid-file /run/transmission-daemon/transmission.pid + +Noting that one should not normally edit files in ``/lib`` or ``/usr/lib`` — systemd has a command for customizing unit files: ``systemctl edit --full transmission-daemon.service`` From d2466db164dcf80ca7625145094ead4f53f29a3a Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Mar 2021 20:34:39 -0400 Subject: [PATCH 14/15] roles/transmission/README.rst: grammar tweak --- roles/transmission/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 53de76d8a..2de521963 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -77,7 +77,7 @@ Known Issues * |ss| Default Transmission user/group may need fixing (https://github.com/transmission/transmission/issues/537) in some circumstances. You can set Ansible variables 'transmission_user' and 'transmission_group' e.g. in /opt/iiab/iiab/roles/transmission/defaults/main.yml (you might need 'User=' and 'Group=' in systemd unit file /lib/systemd/system/transmission-daemon.service — e.g. both might need to be set to 'debian-transmission' — if so then run 'systemctl daemon-reload' and 'systemctl restart transmission-daemon'). |se| |nbsp| `PR #2703 `_ -* Random Ports: Currently it is not possible to use random ports in the range 49152-65535. It is difficult to open multiple ports in IIAB's `iptables-based firewall `_. +* Random Ports: Currently it is not possible to use random ports in the range 49152-65535, as it's difficult to open multiple ports in IIAB's `iptables-based firewall `_. Troubleshooting --------------- From b78a972252b3c8a9344a1ddd5ad221dcbdcaea60 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 14 Mar 2021 20:41:57 -0400 Subject: [PATCH 15/15] transmission/defaults/main.yml: Bring doc back into alsignment w/ default_vars.yml --- roles/transmission/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/transmission/defaults/main.yml b/roles/transmission/defaults/main.yml index 70f155c63..380ea6048 100644 --- a/roles/transmission/defaults/main.yml +++ b/roles/transmission/defaults/main.yml @@ -12,8 +12,8 @@ # Monitor downloads at http://box:9091 or http://box:9091/transmission using Admin/changeme # transmission_http_port: 9091 # transmission_url: /transmission/ -# transmission_whitelist: 127.0.0.1,192.168.*.*,172.18.96.*,10.8.0.* -# transmission_whitelist_enabled: false # Use lowercase +# transmission_whitelist: 127.0.0.1,::1,192.168.*.*,172.18.96.*,10.8.0.* +# transmission_whitelist_enabled: "false" # LOWERCASE STRING for settings.json # transmission_peer_port: 51413 # Provision Transmission with torrent(s) from http://pantry.learningequality.org/downloads/ka-lite/0.17/content/