From da2757cefed81d5246ec652aa06ff79e5d3d9c96 Mon Sep 17 00:00:00 2001 From: opi Date: Thu, 4 Dec 2014 10:51:24 +0100 Subject: [PATCH 1/5] [enh] Show human readable size on completed files index. --- conf/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7dd07d5..d7e7aea 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,6 +11,7 @@ location PATHTOCHANGE/ { location PATHTOCHANGE/downloads { alias /home/yunohost.transmission/completed/; autoindex on; + autoindex_exact_size off; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; From 66d593afe8942cf295a4d4392faf5267d91ea490 Mon Sep 17 00:00:00 2001 From: opi Date: Thu, 4 Dec 2014 11:42:49 +0100 Subject: [PATCH 2/5] [enh] Add target blank to downloads button. --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b118002..96846ab 100644 --- a/scripts/install +++ b/scripts/install @@ -46,7 +46,7 @@ sudo yunohost service add transmission-daemon # Patch sources to add a download button sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' -sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html +sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html # Configure Nginx and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf diff --git a/scripts/upgrade b/scripts/upgrade index 96b1ccc..7e12052 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,7 +29,7 @@ if ! grep 'toolbar-downloads' /usr/share/transmission/web/index.html --quiet; th sudo cp ../sources/toolbar-downloads.png /usr/share/transmission/web/style/transmission/images/toolbar-downloads.png sudo bash -c 'cat ../sources/ynh_common.css >> /usr/share/transmission/web/style/transmission/common.css' - sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html + sudo sed -i "s@
@
@g" /usr/share/transmission/web/index.html fi From dee63f93f4bf4bfb4d9fcdaeadfb2c5f3f3490ac Mon Sep 17 00:00:00 2001 From: opi Date: Thu, 4 Dec 2014 11:44:02 +0100 Subject: [PATCH 3/5] [fix] Better directories and files permissions. --- scripts/install | 8 ++++---- scripts/upgrade | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 96846ab..738dbf5 100644 --- a/scripts/install +++ b/scripts/install @@ -30,10 +30,10 @@ 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 755 -R /home/yunohost.transmission -sudo chmod 770 -R /home/yunohost.transmission/{progress,completed} -sudo chown -R www-data /home/yunohost.transmission/completed +sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/ +sudo chown -R debian-transmission:www-data /home/yunohost.transmission/completed +sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done +sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done # Configure Transmission and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/settings.json diff --git a/scripts/upgrade b/scripts/upgrade index 7e12052..1219a22 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,9 +15,10 @@ 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 755 -R /home/yunohost.transmission -sudo chmod 770 -R /home/yunohost.transmission/{progress,completed} +sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/ +sudo chown -R debian-transmission:www-data /home/yunohost.transmission/completed +sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done +sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done # Configure Transmission and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/settings.json From c08151cb8800e1fe5586d3bf9f6ca1f9776e8490 Mon Sep 17 00:00:00 2001 From: opi Date: Thu, 4 Dec 2014 11:48:27 +0100 Subject: [PATCH 4/5] [fix] Permission was too restrictive. --- scripts/install | 3 +-- scripts/upgrade | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 738dbf5..cfd0350 100644 --- a/scripts/install +++ b/scripts/install @@ -30,8 +30,7 @@ sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} -sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/ -sudo chown -R debian-transmission:www-data /home/yunohost.transmission/completed +sudo chown -R debian-transmission:www-data /home/yunohost.transmission/ sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done diff --git a/scripts/upgrade b/scripts/upgrade index 1219a22..4666283 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,8 +15,7 @@ sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} -sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/ -sudo chown -R debian-transmission:www-data /home/yunohost.transmission/completed +sudo chown -R debian-transmission:www-data /home/yunohost.transmission/ sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done From 0e5a22b54519d037b4b9ecd4183fcaf0f825b571 Mon Sep 17 00:00:00 2001 From: opi Date: Thu, 4 Dec 2014 11:53:30 +0100 Subject: [PATCH 5/5] [fix] Prevent www-data to access progress folder. --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index cfd0350..fd5c5cd 100644 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} sudo chown -R debian-transmission:www-data /home/yunohost.transmission/ +sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/progress sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done diff --git a/scripts/upgrade b/scripts/upgrade index 4666283..2902e77 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,6 +16,7 @@ sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} sudo chown -R debian-transmission:www-data /home/yunohost.transmission/ +sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/progress sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done