1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Proof-of-Concept: Install and Start downloading a torrent

This commit is contained in:
Arky 2018-08-17 01:54:55 +07:00
parent 78dace3a3e
commit 6e84639902
5 changed files with 140 additions and 9 deletions

View file

@ -94,6 +94,8 @@ if [ "$services_externally_visible" == "True" ]; then
$IPTABLES -A INPUT -p tcp --dport $kolibri_http_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $kolibri_http_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $calibre_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $calibre_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT $IPTABLES -A INPUT -p tcp --dport $sugarizer_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $transmission_http_port -m state --state NEW -i $wan -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport $transmission_peer_port -m state --state NEW -i $wan -j ACCEPT
fi fi
if [ "$iiab_gateway_enabled" == "True" ]; then if [ "$iiab_gateway_enabled" == "True" ]; then

View file

@ -4,26 +4,26 @@ Transmission README
Transmission is a set of lightweight BitTorrent clients (in GUI, CLI and daemon form). All its incarnations feature a very simple, intuitive 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. interface on top on an efficient, cross-platform back-end.
In Internet in a box we are using transmission-daemon, transmission-cli and transmission-remote-cli. Caution
-------
#transmission-cli - lightweight BitTorrent client (command line programs) Usage of transmission consumes significant Internet data and system resources.
#transmission-daemon - lightweight BitTorrent client (daemon) Caveat emptor! (That's Latin for "Buyer Beware").
#transmission-remote-cli - ncurses interface for the Transmission BitTorrent daemon
Access Access
------ ------
You can access transmission using http://box/port or using the command line program. You can login transmission using http://box:9091/ or using the command line program.
Username: Admin
Password: changeme
Adding torrents Adding torrents
--------------- ---------------
The torrents are added by provisioning system based on the variables. You can also add 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. your own torrent using web UI or command-line option.
$ transmission-remote-cli http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ \ $ transmission-remote -a http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ka-lite-0.17-resized-videos-english.torrent
ka-lite-0.17-resized-videos-english.torrent

View file

@ -4,3 +4,21 @@
# Installation Variables # Installation Variables
transmission_install: False transmission_install: False
transmission_enabled: False transmission_enabled: False
# Provision Transmission with default torrents
transmission_provision: True
transmission_KaLite-Version: 0.17
transmission_KaLite-Languages: English
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_username: Admin
transmission_password: changeme

View file

@ -1,4 +1,14 @@
--- ---
- name: Create Transmission download directory
file:
path: "{{ item }}"
owner: root
group: root
mode: 0755
state: directory
with_items:
- "{{ transmission_download_dir }}"
- name: Install Transmission daemon and cli-tools. - name: Install Transmission daemon and cli-tools.
package: package:
name: "{{ item }}" name: "{{ item }}"
@ -7,6 +17,34 @@
- transmission-daemon - transmission-daemon
- transmission-cli - transmission-cli
- name: Stop Transmission daemon before creating settings.
service:
name: transmission-daemon
state: stopped
- name: Create the transmission-daemon settings
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
owner: root
group: root
with_items:
- { src: 'settings.json.j2', dest: '/etc/transmission-daemon/settings.json', mode: '0644' }
- name: Start Transmission daemon.
service:
name: transmission-daemon
state: restarted
enabled: yes
when: transmission_enabled
# TODO Make this loop transmission_KaLite-Languages
- name: Add a torrent Ka-Lite English
shell: transmission-remote -a http://pantry.learningequality.org/downloads/ka-lite/0.17/content/ka-lite-0.17-resized-videos-english.torrent
ignore_errors: yes
when: transmission_provision
- name: Add transmission to list of services at /etc/iiab/iiab.ini - name: Add transmission to list of services at /etc/iiab/iiab.ini
ini_file: ini_file:
dest: "{{ service_filelist }}" dest: "{{ service_filelist }}"

View file

@ -0,0 +1,73 @@
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"blocklist-url": "http://www.example.com/blocklist",
"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-enabled": false,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 1,
"peer-congestion-algorithm": "",
"peer-id-ttl-hours": 6,
"peer-limit-global": 200,
"peer-limit-per-torrent": 50,
"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,
"preallocation": 1,
"prefetch-enabled": true,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": false,
"rename-partial-files": true,
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-host-whitelist": "",
"rpc-host-whitelist-enabled": true,
"rpc-password": "{{ transmission_password }}",
"rpc-port": "{{ transmission_http_port }}",
"rpc-url": "{{ transmission_url }}",
"rpc-username": "{{ transmission_username }}",
"rpc-whitelist": "127.0.0.1",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"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
}