1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/simple-torrent_ynh.git synced 2024-09-03 20:26:18 +02:00
* Set files directory permissions to 755

* remove auth

* Add help to manifest

*  Set multi_instance to true
This commit is contained in:
Éric Gaspar 2020-09-04 13:55:05 +02:00 committed by GitHub
parent 6083ca879a
commit 7800e7229f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 44 deletions

View file

@ -15,7 +15,7 @@
setup_public=1
upgrade=1
backup_restore=1
multi_instance=0
multi_instance=1
port_already_use=1
change_url=1
;;; Levels
@ -26,4 +26,4 @@ Notification=none
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=4533&

View file

@ -3,8 +3,8 @@
"enginedebug": false,
"MuteEngineLog": true,
"donecmd": "",
"SeedRatio": 1.5,
"uploadrate": "High",
"SeedRatio": "",
"uploadrate": "",
"donecmdthreshold": "30s",
"watchdirectory": "/home/yunohost.__APP__/torrents",
"downloaddirectory": "/home/yunohost.__APP__/downloads",
@ -17,5 +17,4 @@
"scraperurl": "https://raw.githubusercontent.com/boypt/simple-torrent/master/scraper-config.json",
"seedratio": 0,
"trackerlisturl": "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt"
}

View file

@ -8,7 +8,7 @@ User=__APP__
Group=__APP__
Environment=PORT=__PORT__
WorkingDirectory=__FINAL_PATH__
ExecStart=__FINAL_PATH__/__APP__ -c __FINAL_PATH__/config.json --host 127.0.0.1 --auth __ADMIN__:__PASSWORD__
ExecStart=__FINAL_PATH__/__APP__ -c __FINAL_PATH__/config.json --host 127.0.0.1
Restart=always
RestartSec=3

View file

@ -6,7 +6,7 @@
"en": "Self-hosted remote torrent client",
"fr": "Client torrent distant auto-hébergé"
},
"version": "1.2.11~ynh1",
"version": "1.2.11~ynh2",
"url": "https://github.com/boypt/simple-torrent",
"license": "AGPL-3.0-only",
"maintainer": {
@ -15,7 +15,7 @@
"requirements": {
"yunohost": ">= 3.8.1"
},
"multi_instance": false,
"multi_instance": true,
"services": [
"nginx"
],
@ -47,25 +47,11 @@
"en": "Is it a public site?",
"fr": "Est-ce un site public ?"
},
"help": {
"en": "If enabled, Simple Torrent will be accessible by people who do not have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, Simple Torrent sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
},
"default": true
},
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez l'administrateur"
},
"example": "johndoe"
},
{
"name": "password",
"type": "password",
"ask": {
"en": "Set the administrator password",
"fr": "Définissez le mot de passe administrateur"
},
"example": "Choose a password"
}
]
}

View file

@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

View file

@ -23,8 +23,6 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC
password=$YNH_APP_ARG_PASSWORD
admin=$YNH_APP_ARG_ADMIN
architecture=$(ynh_detect_arch)
app=$YNH_APP_INSTANCE_NAME
@ -47,7 +45,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
#=================================================
@ -125,8 +122,6 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="../conf/systemd.service"
ynh_add_systemd_config
@ -141,7 +136,7 @@ ynh_script_progression --message="Securing files and directories..." --weight=1
chown -R $app: $final_path
chown -R $app: /home/yunohost.$app
chmod +x $final_path/$app
chmod -R 777 /home/yunohost.$app/{torrents,downloads}
chmod -R 755 /home/yunohost.$app/{torrents,downloads}
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -86,7 +86,7 @@ ynh_script_progression --message="Restoring user rights..."
chown -R $app: $final_path
chown -R $app: /home/yunohost.$app
chmod +x $final_path/$app
chmod -R 777 /home/yunohost.$app/{torrents,downloads}
chmod -R 755 /home/yunohost.$app/{torrents,downloads}
#=================================================
# RESTORE SYSTEMD

View file

@ -18,12 +18,10 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
peer_port=$(ynh_app_setting_get --app=$app --key=peer_port)
password=$(ynh_app_setting_get --app=$app --key=password)
architecture=$(ynh_detect_arch)
#=================================================
@ -80,7 +78,7 @@ fi
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated nginx config
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
@ -114,10 +112,7 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=2
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="../conf/systemd.service"
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
@ -130,7 +125,7 @@ ynh_script_progression --message="Securing files and directories..."
chown -R $app: $final_path
chown -R $app: /home/yunohost.$app
chmod +x $final_path/$app
chmod -R 777 /home/yunohost.$app/{torrents,downloads}
chmod -R 755 /home/yunohost.$app/{torrents,downloads}
#=================================================
# INTEGRATE SERVICE IN YUNOHOST