1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tube_ynh.git synced 2024-09-04 01:46:11 +02:00
This commit is contained in:
ericgaspar 2022-08-27 08:00:59 +02:00
parent 29b052e144
commit 8e9fe780c2
4 changed files with 22 additions and 1 deletions

View file

@ -10,7 +10,7 @@
"port": __PORT__,
"store_path": "tube.db",
"upload_path": "__DATADIR__/uploads",
"max_upload_size": 104857600
"max_upload_size": __MAX_UPLOAD_SIZE__*1024*1024
},
"thumbnailer": {
"timeout": 60

View file

@ -29,6 +29,7 @@ path_url="/"
is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
max_upload_size=100
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -48,6 +49,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
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=max_upload_size --value=$max_upload_size
#=================================================
# STANDARD MODIFICATIONS

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size)
#=================================================
# CHECK VERSION
@ -49,6 +50,24 @@ 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"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If max_upload_size doesn't exist, create it
if [ -z "$max_upload_size" ]; then
max_upload_size=100
ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# CREATE DEDICATED USER
#=================================================