mirror of
https://github.com/YunoHost-Apps/simple-torrent_ynh.git
synced 2024-09-03 20:26:18 +02:00
parent
0f074c1f07
commit
380c42d1bd
7 changed files with 33 additions and 14 deletions
|
@ -6,8 +6,8 @@
|
|||
"SeedRatio": "",
|
||||
"uploadrate": "",
|
||||
"donecmdthreshold": "30s",
|
||||
"watchdirectory": "/home/yunohost.__APP__/torrents",
|
||||
"downloaddirectory": "/home/yunohost.__APP__/downloads",
|
||||
"watchdirectory": "/home/yunohost.app/__APP__/torrents",
|
||||
"downloaddirectory": "/home/yunohost.app/__APP__/downloads",
|
||||
"enableseeding": true,
|
||||
"enableupload": true,
|
||||
"incomingport": "__PEER_PORT__",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Self-hosted remote torrent client",
|
||||
"fr": "Client torrent distant auto-hébergé"
|
||||
},
|
||||
"version": "1.2.15~ynh2",
|
||||
"version": "1.2.15~ynh3",
|
||||
"url": "https://github.com/boypt/simple-torrent",
|
||||
"license": "AGPL-3.0-only",
|
||||
"maintainer": {
|
||||
|
|
|
@ -41,7 +41,7 @@ ynh_backup --src_path="$final_path"
|
|||
# BACKUP DATA
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/home/yunohost.$app" --is_big
|
||||
ynh_backup --src_path="/home/yunohost.app/$app" --is_big
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
|
|
|
@ -70,7 +70,7 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
|
|
|
@ -51,7 +51,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
|
|||
#=================================================
|
||||
# FIND AND OPEN A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring firewall..." --weight=0
|
||||
ynh_script_progression --message="Finding an available port..." --weight=0
|
||||
|
||||
# Find an available port
|
||||
port=$(ynh_find_port --port=3000)
|
||||
|
@ -60,6 +60,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
# Find incoming port peers connect to
|
||||
peer_port=$(ynh_find_port --port=50007)
|
||||
# Open this port
|
||||
ynh_script_progression --message="Configuring firewall..." --weight=1
|
||||
ynh_exec_warn_less yunohost firewall allow Both $peer_port
|
||||
ynh_app_setting_set --app=$app --key=peer_port --value=$peer_port
|
||||
|
||||
|
@ -98,7 +99,7 @@ ynh_add_nginx_config
|
|||
# CREATE DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
mkdir -p /home/yunohost.${app}/{torrents,downloads}
|
||||
mkdir -p /home/yunohost.app/$app/{torrents,downloads}
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
|
@ -131,9 +132,9 @@ ynh_script_progression --message="Securing files and directories..." --weight=1
|
|||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chown -R $app: /home/yunohost.$app
|
||||
chown -R $app: /home/yunohost.app
|
||||
chmod +x $final_path/$app
|
||||
chmod -R 755 /home/yunohost.$app/{torrents,downloads}
|
||||
chmod -R 755 /home/yunohost.app/$app/{torrents,downloads}
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
|
@ -67,7 +67,7 @@ ynh_restore_file --origin_path="$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring $app data..." --weight=10
|
||||
|
||||
ynh_restore_file --origin_path="/home/yunohost.$app" --not_mandatory
|
||||
ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
|
@ -84,9 +84,9 @@ ynh_script_progression --message="Restoring user rights..."
|
|||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chown -R $app: /home/yunohost.$app
|
||||
chown -R $app: /home/yunohost.app/$app
|
||||
chmod +x $final_path/$app
|
||||
chmod -R 755 /home/yunohost.$app/{torrents,downloads}
|
||||
chmod -R 755 /home/yunohost.app/$app/{torrents,downloads}
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
|
|
|
@ -30,6 +30,18 @@ ynh_script_progression --message="Checking version..."
|
|||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -91,6 +103,12 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
|||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# CREATE DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
mkdir -p /home/yunohost.app/$app/{torrents,downloads}
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -116,9 +134,9 @@ ynh_add_systemd_config
|
|||
ynh_script_progression --message="Securing files and directories..."
|
||||
|
||||
chown -R $app: $final_path
|
||||
chown -R $app: /home/yunohost.$app
|
||||
chown -R $app: /home/yunohost.app/$app
|
||||
chmod +x $final_path/$app
|
||||
chmod -R 755 /home/yunohost.$app/{torrents,downloads}
|
||||
chmod -R 755 /home/yunohost.app/$app/{torrents,downloads}
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
Loading…
Add table
Reference in a new issue