1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/transmission_ynh.git synced 2024-09-04 01:46:12 +02:00
This commit is contained in:
Kload 2013-10-29 13:14:27 +00:00
commit 70b375114e
6 changed files with 150 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.swp
*.swo

4
README.md Normal file
View file

@ -0,0 +1,4 @@
Transmission for YunoHost
-------------------------
http://www.transmissionbt.com/

6
conf/nginx.conf Normal file
View file

@ -0,0 +1,6 @@
location PATHTOCHANGE/transmission {
proxy_pass http://127.0.0.1:9091PATHTOCHANGE/transmission;
}
location PATHTOCHANGE {
proxy_pass http://127.0.0.1:9091/;
}

70
conf/settings.json Normal file
View file

@ -0,0 +1,70 @@
{
"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": "/home/yunohost.transmission/completed",
"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": "/home/yunohost.transmission/progress",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-limit-global": 240,
"peer-limit-per-torrent": 60,
"peer-port": 51413,
"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": 1,
"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-password": "{22ef1abe361f619946cf9ce68c442d27f73512d5lL3qJ6bY",
"rpc-port": 9091,
"rpc-url": "PATHTOCHANGE/transmission/",
"rpc-username": "transmission",
"rpc-whitelist": "127.0.0.1",
"rpc-whitelist-enabled": false,
"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
}

30
manifest.json Normal file
View file

@ -0,0 +1,30 @@
{
"name": "Transmission",
"id": "transmission",
"description": {
"en": "A Fast, Easy, and Free BitTorrent Client",
"fr": "Un client BitTorrent libre et rapide"
},
"developer": {
"name": "kload",
"email": "kload@kload.fr",
"url": "http://kload.fr"
},
"multi_instance": "false",
"arguments": {
"install": [
{
"name": "domain",
"ask": {
"en": "Choose a domain for Transmission (i.e. mydomain.org)"
}
},
{
"name": "path",
"ask": {
"en": "Choose a path for Transmission (i.e. /torrent)"
}
}
]
}
}

38
scripts/install Normal file
View file

@ -0,0 +1,38 @@
#!/bin/bash
# Retrieve arguments
domain=$1
path=$2
sudo yunohost app checkurl $domain$path -a transmission
if [[ ! $? -eq 0 ]]; then exit 1 fi
# Remove trailing "/" for next commands
path=${path%/}
# Check port availability
sudo yunohost app checkport 9091
if [[ ! $? -eq 0 ]]; then exit 1 fi
sudo yunohost app checkport 51413
if [[ ! $? -eq 0 ]]; then exit 1 fi
# Install official debian package
sudo apt-get install transmission-daemon -y -qq
# Make directories and set rights
sudo mkdir -p /home/yunohost.transmission/{progress,completed}
sudo chgrp debian-transmission /home/yunohost.transmission/{progress,completed}
sudo chmod 770 -R /home/yunohost.transmission/{progress,completed}
# Configure Transmission and reload
sed -i "s@/PATHTOCHANGE@$path@g" ../conf/settings.json
sudo cp ../conf/settings.json /etc/transmission-daemon/settings.json
sudo service transmission-daemon reload
# Open port in firewall
sudo yunohost firewall allow TCP 51413
# Configure Nginx and reload
sed -i "s@/PATHTOCHANGE@$path@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/transmission.conf
sudo service nginx reload