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 09:12:04 +02:00
parent 039b4c7657
commit bded059cd5
3 changed files with 32 additions and 3 deletions

View file

@ -8,7 +8,7 @@ services = ["__APP__"]
name = "Configuration Options"
[main.config.max_upload_size]
ask = "Max upload size"
ask = "Max Upload Size"
type = "number"
help = "Set max_upload_size to the maximum number of bytes you wish to impose on uploaded and imported videos. Upload(s)/Import(s) that exceed this size will by denied by the server. This is a saftey measure so as to not DoS the Tube server instance. Set it to a sensible value you see fit."
bind = "max_upload_size:/var/www/__APP__/config.json"
@ -17,7 +17,7 @@ services = ["__APP__"]
name = "RSS feed information"
[main.rss.feed_title]
ask = "Feed title"
ask = "Feed Title"
type = "string"
help = "Set the feed title for your RSS feed"
bind = "title:/var/www/__APP__/config.json"
@ -27,4 +27,15 @@ services = ["__APP__"]
type = "string"
help = "Set the feed description for your RSS feed"
bind = "description:/var/www/__APP__/config.json"
[main.rss.author_name]
ask = "Author Name"
type = "string"
help = "Set the author name for the RSS feed"
bind = "name:/var/www/__APP__/config.json"
[main.rss.author_email]
ask = "Author Email"
type = "string"
help = "Set the author email for the RSS feed"
bind = "email:/var/www/__APP__/config.json"

View file

@ -33,6 +33,8 @@ app=$YNH_APP_INSTANCE_NAME
max_upload_size=1048576000
feed_title="Feed title"
feed_description="Feed description"
author_name="Author Name"
author_email="author@somewhere.example"
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -55,6 +57,8 @@ 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
ynh_app_setting_set --app=$app --key=feed_title --value=$feed_title
ynh_app_setting_set --app=$app --key=feed_description --value=$feed_description
ynh_app_setting_set --app=$app --key=author_name --value=$author_name
ynh_app_setting_set --app=$app --key=author_email --value=$author_email
#=================================================
# STANDARD MODIFICATIONS

View file

@ -23,6 +23,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size)
feed_title=$(ynh_app_setting_get --app=$app --key=feed_title)
feed_description=$(ynh_app_setting_get --app=$app --key=feed_description)
author_name=$(ynh_app_setting_get --app=$app --key=author_name)
author_email=$(ynh_app_setting_get --app=$app --key=author_email)
#=================================================
# CHECK VERSION
@ -76,6 +78,18 @@ if [ -z "$feed_description" ]; then
ynh_app_setting_set --app=$app --key=feed_description --value=$feed_description
fi
# If author_name doesn't exist, create it
if [ -z "$author_name" ]; then
author_name="Author Name"
ynh_app_setting_set --app=$app --key=author_name --value=$author_name
fi
# If author_email doesn't exist, create it
if [ -z "$author_email" ]; then
author_email="author@somewhere.example"
ynh_app_setting_set --app=$app --key=author_email --value=$author_email
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all