From a4d41441568f93511517fe2e103988841d6973e4 Mon Sep 17 00:00:00 2001 From: Arky Date: Sat, 18 Aug 2018 11:13:16 +0700 Subject: [PATCH] Correct transmission variables and use 'to_json' Ensure that transmission_http_port variable is not reset in iiab-gen-iptables. Remote the extra qoutes and also use to_json to clean the transmission_kalite_languages output. Restructure the defaults section. Update the README documentation. --- .../templates/gateway/iiab-gen-iptables | 1 + roles/transmission/README.rst | 30 +++++++++++++++---- roles/transmission/defaults/main.yml | 19 ++++++------ roles/transmission/tasks/main.yml | 2 +- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/roles/network/templates/gateway/iiab-gen-iptables b/roles/network/templates/gateway/iiab-gen-iptables index 7271e2f32..9daa3e5bd 100755 --- a/roles/network/templates/gateway/iiab-gen-iptables +++ b/roles/network/templates/gateway/iiab-gen-iptables @@ -58,6 +58,7 @@ calibre_port={{ calibre_port }} kiwix_port={{ kiwix_port }} kalite_server_port={{ kalite_server_port }} kolibri_http_port={{ kolibri_http_port }} +transmission_http_port={{ transmission_http_port }} sugarizer_port={{ sugarizer_port }} block_DNS={{ block_DNS }} captive_portal_enabled={{ captive_portal_enabled }} diff --git a/roles/transmission/README.rst b/roles/transmission/README.rst index 91b35a7d8..eeb994ef7 100644 --- a/roles/transmission/README.rst +++ b/roles/transmission/README.rst @@ -4,6 +4,9 @@ Transmission README Transmission is a set of lightweight BitTorrent clients (in GUI, CLI and daemon form). All its incarnations feature a very simple, intuitive interface on top on an efficient, cross-platform back-end. +The transmission program is used to download and seed Ka-Lite packages. Once the packages are download, Please verify the content +before copying them to Ka-Lite content directory. + Caution ------- Usage of transmission consumes significant Internet data and system resources. @@ -12,17 +15,29 @@ Caveat emptor! (That's Latin for "Buyer Beware"). Access ------ -You can login transmission using http://box:9091/ or using the command line program. +You can login transmission using its web interface http://box:9091/ with the following administration account. Username: Admin Password: changeme +Alternatively you can also access transmission using the 'transmission-remote' or 'transmission-remote' on the command line. + +Configuration +-------------- +You can configure transmission using the web interface http://box:9091. + +You can also edit the transmission settings in '/etc/transmission-daemon/settings.json'. Before you start editing the +'settings.json' file, Please ensure that transmission-daemon.service is stop. + +$ sudo systemctl stop transmission-daemon.service +$ sudo nano /etc/transmission-daemon/settings.json + + Adding torrents --------------- +The transmission provisioning system is designed to add ka-Lite packages. You can also use transmission is +download torrent using the Transmission web interface or using 'transmission-remote' program. -The torrents are added by provisioning system based on the variables. You can also add -your own torrent using web UI or command-line option. -s $ transmission-remote -a Known Issues @@ -30,6 +45,11 @@ Known Issues Currently it is not possible to use random ports in the range 65535-49152. It is difficult to open multiple ports in IIAB firewall. - Troubleshooting ---------------- + +Please check if the transmission daemon is running: + +$ sudo systemctl status transmission-daemon.service + +Check the transmission settings '/etc/transmission-daemon/settings.json' are correct. diff --git a/roles/transmission/defaults/main.yml b/roles/transmission/defaults/main.yml index 635e02e4d..f089f9daf 100644 --- a/roles/transmission/defaults/main.yml +++ b/roles/transmission/defaults/main.yml @@ -5,6 +5,14 @@ transmission_install: False transmission_enabled: False +# Transmission default download directory. +transmission_download_dir: /library/transmission + +# Transmission default web and bittorrent ports +transmission_http_port: 9091 +transmission_peer_port: 51413 +transmission_url : "/transmission/" + # Provision Transmission with default torrents from http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ transmission_provision: True transmission_kalite_version: 0.17 @@ -18,15 +26,6 @@ transmission_kalite_languages: - "spanish" - "swahili" -# Transmission default download directory. -transmission_download_dir: /library/transmission - -#TODO Open this port to WAN. -#TODO Also open the default peer port 51413 and range 65535-49152 -transmission_http_port: 9091 -transmission_peer_port: 51413 - -transmission_url : "/transmission/" - +# Transmission administration account transmission_username: Admin transmission_password: changeme diff --git a/roles/transmission/tasks/main.yml b/roles/transmission/tasks/main.yml index 7c2cc8955..eccb9e4c2 100644 --- a/roles/transmission/tasks/main.yml +++ b/roles/transmission/tasks/main.yml @@ -46,7 +46,7 @@ # when: transmission_provision - name: Add ka-lite torrents - shell: /usr/bin/transmission-remote -a http://pantry.learningequality.org/downloads/ka-lite/"{{ transmission_kalite_version }}"/content/ka-lite-0.17-resized-videos-"{{ transmission_kalite_languages }}".torrent + shell: /usr/bin/transmission-remote -a http://pantry.learningequality.org/downloads/ka-lite/{{ transmission_kalite_version }}/content/ka-lite-0.17-resized-videos-{{ transmission_kalite_languages | to_json }}.torrent with_items: "{{ transmission_kalite_languages }}" ignore_errors: yes when: transmission_provision