1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/transmission_ynh.git synced 2024-09-04 01:46:12 +02:00

Set new datadir

This commit is contained in:
ericgaspar 2021-07-01 18:14:21 +02:00
parent 143a4eded5
commit d50df7d032
No known key found for this signature in database
GPG key ID: 574F281483054D44
12 changed files with 89 additions and 83 deletions

View file

@ -1,8 +1,7 @@
;; Test complet
auto_remove=1
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
domain="domain.tld"
path="/path"
; Checks
pkg_linter=1
setup_sub_dir=1

View file

@ -13,7 +13,7 @@ location __PATH__/ {
}
location __PATH__/downloads/ {
alias /home/yunohost.transmission/completed/;
alias /home/yunohost.app/__APP__/completed/;
autoindex on;
autoindex_exact_size off;

View file

@ -12,7 +12,7 @@
"blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/home/yunohost.transmission/completed",
"download-dir": "/home/yunohost.app/transmission/completed",
"download-limit": 100,
"download-limit-enabled": 0,
"download-queue-enabled": true,
@ -20,7 +20,7 @@
"encryption": 1,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/home/yunohost.transmission/progress",
"incomplete-dir": "/home/yunohost.app/transmission/progress",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
@ -70,6 +70,6 @@
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true,
"watch-dir": "/home/yunohost.transmission/watched",
"watch-dir": "/home/yunohost.app/transmission/watched",
"watch-dir-enabled": true
}

17
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,17 @@
## Additionnal informations
Alternative to WebUI :
You can use remote client on different platforms to manage your Transmission server:
* Dekstop: Transmission-remote-GUI: https://github.com/transmission-remote-gui/transgui
* Mobile: Transdroid: http://www.transdroid.org/
* More clients here: https://transmissionbt.com/resources/
You can use the following information to connect your server:
* Remote host: Your domain or IP address (don't add folder)
* Port: 443
* SSL: Enabled
* User: Your Yunohost Username
* Password: Password of the Yunohost User above
* RPC Path: /torrent/transmission/rpc (if you used the standard folder)

17
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,17 @@
## Informations additionnelles
Alternative à WebUI :
Vous pouvez utiliser le client de contrôle à distance des différentes plateformes pour gérer votre serveur Transmission :
* Bureau : Transmission-remote-GUI : https://github.com/transmission-remote-gui/transgui
* Mobile : Transdroid : http://www.transdroid.org/
* Plus de clients ici : https://transmissionbt.com/resources/
Vous pouvez utiliser les informations suivantes pour vous connecter à votre serveur :
* Hôte distant : Votre domaine ou adresse IP (n'ajoutez pas le répertoire)
* Port : 443
* SSL : Activé
* Utilisateur : Votre nom d'utilisateur YunoHost
* Mot de passe : Le mot de passe de l'utilisateur YunoHost utilisé
* Répertoire RPC : `/torrent/transmission/rpc` (si vous utilisez le répertoire par défaut)

View file

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View file

@ -6,15 +6,23 @@
"en": "A Fast, Easy, and Free BitTorrent Client",
"fr": "Un client BitTorrent libre et rapide"
},
"version": "1.0~ynh4",
"version": "2.94-2~ynh1",
"url": "https://www.transmissionbt.com/",
"upstream": {
"license": "GPL-3.0",
"website": "https://www.transmissionbt.com/",
"demo": "https://demo.example.com",
"admindoc": "https://github.com/transmission/transmission/wiki",
"userdoc": "https://yunohost.org/en/app_transmission",
"code": "https://github.com/transmission/transmission"
},
"license": "GPL-3.0",
"maintainer": {
"name": "",
"email": ""
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.2.4"
},
"multi_instance": false,
"services": [

View file

@ -18,45 +18,3 @@ pkg_dependencies="transmission-daemon transmission-cli transmission-common acl"
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Install or update the main directory yunohost.multimedia
#
# usage: ynh_multimedia_build_main_dir
ynh_multimedia_build_main_dir () {
local ynh_media_release="v1.2"
local checksum="806a827ba1902d6911095602a9221181"
# Download yunohost.multimedia scripts
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1
# Check the control sum
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|| ynh_die "Corrupt source"
# Check if the package acl is installed. Or install it.
ynh_package_is_installed 'acl' \
|| ynh_package_install acl
# Extract
mkdir yunohost.multimedia-master
tar -xf ${ynh_media_release}.tar.gz -C yunohost.multimedia-master --strip-components 1
./yunohost.multimedia-master/script/ynh_media_build.sh
}
# Add a directory in yunohost.multimedia
# This "directory" will be a symbolic link to a existing directory.
#
# usage: ynh_multimedia_addfolder "Source directory" "Destination directory"
#
# | arg: -s, --source_dir= - Source directory - The real directory which contains your medias.
# | arg: -d, --dest_dir= - Destination directory - The name and the place of the symbolic link, relative to "/home/yunohost.multimedia"
ynh_multimedia_addfolder () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=source_dir= [d]=dest_dir= )
local source_dir
local dest_dir
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$source_dir" --dest="$dest_dir"
}

View file

@ -24,6 +24,7 @@ ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -55,7 +56,7 @@ fi
ynh_backup --src_path="/usr/share/transmission"
ynh_backup --src_path="/var/lib/transmission-daemon"
ynh_backup --src_path="/home/yunohost.transmission" --is_big
ynh_backup --src_path="$datadir" --is_big
#=================================================
# END OF SCRIPT

View file

@ -91,17 +91,17 @@ ynh_add_nginx_config
#=================================================
# CREATE DIRECTORIES
#=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1
mkdir -p /home/yunohost.transmission/{progress,completed,watched}
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
#=================================================
# SECURING FILES AND DIRECTORIES
#=================================================
mkdir -p $datadir/{progress,completed,watched}
chown -R debian-transmission:www-data /home/yunohost.transmission/
chown -R debian-transmission: /home/yunohost.transmission/{progress,watched}
chmod -R 764 /home/yunohost.transmission
chmod -R 777 /home/yunohost.transmission/watched
chown -R debian-transmission:www-data $datadir
chown -R debian-transmission: $datadir/{progress,watched}
chmod -R 764 $datadir
chmod -R 777 $datadir/watched
#=================================================
# CONFIGURE TRANSMISSION
@ -149,11 +149,11 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=4
ynh_multimedia_build_main_dir
# Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move)
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission" --dest_dir="share/Torrents"
ynh_multimedia_addfolder --source_dir="$datadir" --dest_dir="share/Torrents"
# And share completed directory
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission/completed" --dest_dir="share/Torrents"
ynh_multimedia_addfolder --source_dir="$datadir/completed" --dest_dir="share/Torrents"
# Share also watched directory, to allow to use it easily
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission/watched" --dest_dir="share/Torrent to download"
ynh_multimedia_addfolder --source_dir="$datadir/watched" --dest_dir="share/Torrent to download"
#=================================================
# PATCH SOURCE TO ADD A DOWNLOAD BUTTON

View file

@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
peer_port=$(ynh_app_setting_get --app=$app --key=peer_port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -91,17 +92,17 @@ ynh_secure_remove --file=/var/lib/transmission-daemon
ynh_restore_file --origin_path=/var/lib/transmission-daemon
# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup.
ynh_restore_file --origin_path="/home/yunohost.transmission" --not_mandatory
ynh_restore_file --origin_path="$datadir" --not_mandatory
#=================================================
# RESTORE USER RIGHTS
#=================================================
mkdir -p /home/yunohost.transmission/{progress,completed,watched}
chown -R debian-transmission:www-data /home/yunohost.transmission/
chown -R debian-transmission: /home/yunohost.transmission/{progress,watched}
chmod -R 640 /home/yunohost.transmission
chmod -R 777 /home/yunohost.transmission/watched
mkdir -p $datadir/{progress,completed,watched}
chown -R debian-transmission:www-data $datadir
chown -R debian-transmission: $datadir/{progress,watched}
chmod -R 640 $datadir
chmod -R 777 $datadir/watched
#=================================================
# YUNOHOST MULTIMEDIA INTEGRATION
@ -110,11 +111,11 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=4
ynh_multimedia_build_main_dir
# Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move)
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission" --dest_dir="share/Torrents"
ynh_multimedia_addfolder --source_dir="$datadir" --dest_dir="share/Torrents"
# And share completed directory
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission/completed" --dest_dir="share/Torrents"
ynh_multimedia_addfolder --source_dir="$datadir/completed" --dest_dir="share/Torrents"
# Share also watched directory, to allow to use it easily
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission/watched" --dest_dir="share/Torrent to download"
ynh_multimedia_addfolder --source_dir="$datadir/watched" --dest_dir="share/Torrent to download"
#=================================================
# START TRANSMISSION

View file

@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
port=$(ynh_app_setting_get --app=$app --key=port)
peer_port=$(ynh_app_setting_get --app=$app --key=peer_port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# CHECK VERSION
@ -45,6 +46,12 @@ fi
# Add peer_port also on UDP.
ynh_exec_warn_less yunohost firewall allow UDP $peer_port
if [ -z "$datadir" ]; then
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
cp /home/yunohost.$app /home/yunohost.app/$app
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -90,16 +97,14 @@ ynh_install_app_dependencies $pkg_dependencies
# CREATE DIRECTORIES
#=================================================
mkdir -p /home/yunohost.transmission/{progress,completed,watched}
datadir=/home/yunohost.app/$app
#=================================================
# SECURING FILES AND DIRECTORIES
#=================================================
mkdir -p $datadir/{progress,completed,watched}
chown -R debian-transmission:www-data /home/yunohost.transmission/
chown -R debian-transmission: /home/yunohost.transmission/{progress,watched}
chmod -R 764 /home/yunohost.transmission
chmod -R 777 /home/yunohost.transmission/watched
chown -R debian-transmission:www-data $datadir
chown -R debian-transmission: $datadir/{progress,watched}
chmod -R 764 $datadir
chmod -R 777 $datadir/watched
#=================================================
# CONFIGURE TRANSMISSION
@ -154,11 +159,11 @@ ynh_script_progression --message="Adding multimedia directories..." --weight=3
ynh_multimedia_build_main_dir
# Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move)
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission" --dest_dir="share/Torrents"
ynh_multimedia_addfolder --source_dir="$datadir" --dest_dir="share/Torrents"
# And share completed directory
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission/completed" --dest_dir="share/Torrents"
ynh_multimedia_addfolder --source_dir="$datadir/completed" --dest_dir="share/Torrents"
# Share also watched directory, to allow to use it easily
ynh_multimedia_addfolder --source_dir="/home/yunohost.transmission/watched" --dest_dir="share/Torrent to download"
ynh_multimedia_addfolder --source_dir="$datadir/watched" --dest_dir="share/Torrent to download"
#=================================================
# PATCH SOURCE TO ADD A DOWNLOAD BUTTON