From 8e9fe780c200f2d2fbf8cb93c5b553d6983422e8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 08:00:59 +0200 Subject: [PATCH 1/8] Fix --- conf/config.json | 2 +- ...ig_panel.toml.example => config_panel.toml | 0 scripts/install | 2 ++ scripts/upgrade | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) rename config_panel.toml.example => config_panel.toml (100%) diff --git a/conf/config.json b/conf/config.json index c74e8b1..f7b5bf5 100644 --- a/conf/config.json +++ b/conf/config.json @@ -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 diff --git a/config_panel.toml.example b/config_panel.toml similarity index 100% rename from config_panel.toml.example rename to config_panel.toml diff --git a/scripts/install b/scripts/install index ddf44e7..ddd600a 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index c88d24d..cab8f73 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #================================================= From 102b611ea921c4b39be7034adfa4f718fc44aedb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 08:52:35 +0200 Subject: [PATCH 2/8] Fix --- conf/config.json | 4 ++-- config_panel.toml | 15 +++++++++++++++ scripts/install | 5 +++++ scripts/upgrade | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/conf/config.json b/conf/config.json index f7b5bf5..f907bf1 100644 --- a/conf/config.json +++ b/conf/config.json @@ -26,9 +26,9 @@ }, "feed": { "external_url": "https://__DOMAIN__", - "title": "Feed Title", + "title": "__FEED_TITLE__", "link": "http://__DOMAIN__/about", - "description": "Feed Description", + "description": "__FEED_DESCRIPTION__", "author": { "name": "Author Name", "email": "author@somewhere.example" diff --git a/config_panel.toml b/config_panel.toml index 6f7eec5..0092627 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -12,4 +12,19 @@ services = ["__APP__"] 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" + + [main.rss] + name = "RSS feed information" + + [main.rss.feed_title] + ask = "Feed title" + type = "string" + help = "Set the feed title for your RSS feed" + bind = "title:/var/www/__APP__/config.json" + + [main.rss.feed_description] + ask = "Feed Description" + type = "string" + help = "Set the feed description for your RSS feed" + bind = "title:/var/www/__APP__/config.json" \ No newline at end of file diff --git a/scripts/install b/scripts/install index ddd600a..74ac579 100755 --- a/scripts/install +++ b/scripts/install @@ -29,7 +29,10 @@ path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME + max_upload_size=100 +feed_title="Feed title" +feed_description="Feed description" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -50,6 +53,8 @@ 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 +ynh_app_setting_set --app=$app --key=feed_title --value=$feed_title +ynh_app_setting_set --app=$app --key=feed_description --value=$feed_description #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index cab8f73..8fb62a0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,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) 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) #================================================= # CHECK VERSION @@ -61,6 +64,18 @@ if [ -z "$max_upload_size" ]; then ynh_app_setting_set --app=$app --key=max_upload_size --value=$max_upload_size fi +# If feed_title doesn't exist, create it +if [ -z "$feed_title" ]; then + feed_title="Feed title" + ynh_app_setting_set --app=$app --key=feed_title --value=$feed_title +fi + +# If feed_description doesn't exist, create it +if [ -z "$feed_description" ]; then + feed_description="Feed description" + ynh_app_setting_set --app=$app --key=feed_description --value=$feed_description +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all From 039b4c7657b75b79908daddd0ecdb8d09848efa0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 09:02:33 +0200 Subject: [PATCH 3/8] Fix --- conf/config.json | 2 +- config_panel.toml | 2 +- scripts/install | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/config.json b/conf/config.json index f907bf1..9c18303 100644 --- a/conf/config.json +++ b/conf/config.json @@ -10,7 +10,7 @@ "port": __PORT__, "store_path": "tube.db", "upload_path": "__DATADIR__/uploads", - "max_upload_size": __MAX_UPLOAD_SIZE__*1024*1024 + "max_upload_size": __MAX_UPLOAD_SIZE__ }, "thumbnailer": { "timeout": 60 diff --git a/config_panel.toml b/config_panel.toml index 0092627..d4d05a9 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -26,5 +26,5 @@ services = ["__APP__"] ask = "Feed Description" type = "string" help = "Set the feed description for your RSS feed" - bind = "title:/var/www/__APP__/config.json" + bind = "description:/var/www/__APP__/config.json" \ No newline at end of file diff --git a/scripts/install b/scripts/install index 74ac579..36dcc3b 100755 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME -max_upload_size=100 +max_upload_size=1048576000 feed_title="Feed title" feed_description="Feed description" From bded059cd51faf6d3ee4c7408c5e53d94d5f4745 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 09:12:04 +0200 Subject: [PATCH 4/8] Fix --- config_panel.toml | 17 ++++++++++++++--- scripts/install | 4 ++++ scripts/upgrade | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index d4d05a9..c0b29ac 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -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" - \ No newline at end of file + + [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" diff --git a/scripts/install b/scripts/install index 36dcc3b..64e61da 100755 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 8fb62a0..5dbd4de 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 From 1749903d6ebe1331b70b179136ca157fad51073e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 09:14:10 +0200 Subject: [PATCH 5/8] Fix --- conf/config.json | 6 +++--- config_panel.toml | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conf/config.json b/conf/config.json index 9c18303..8fb8ddd 100644 --- a/conf/config.json +++ b/conf/config.json @@ -30,10 +30,10 @@ "link": "http://__DOMAIN__/about", "description": "__FEED_DESCRIPTION__", "author": { - "name": "Author Name", - "email": "author@somewhere.example" + "name": "__AUTHOR_NAME__", + "email": "__AUTHOR_EMAIL__" }, - "copyright": "Copyright Text" + "copyright": "__COPYRIGHT_TEXT__" }, "copyright": { "content": "All Content herein Public Domain and User Contributed." diff --git a/config_panel.toml b/config_panel.toml index c0b29ac..071821e 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -39,3 +39,9 @@ services = ["__APP__"] type = "string" help = "Set the author email for the RSS feed" bind = "email:/var/www/__APP__/config.json" + + [main.rss.copyright_text] + ask = "Copyright Text" + type = "string" + help = "Set copyright text for the RSS feed" + bind = "email:/var/www/__APP__/config.json" From 78ceac07cefb8ebe2fd900d930b186774f4d8227 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 09:16:31 +0200 Subject: [PATCH 6/8] Fix --- scripts/install | 2 ++ scripts/upgrade | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/scripts/install b/scripts/install index 64e61da..823f0d3 100755 --- a/scripts/install +++ b/scripts/install @@ -35,6 +35,7 @@ feed_title="Feed title" feed_description="Feed description" author_name="Author Name" author_email="author@somewhere.example" +copyright_text="Copyright Text" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -59,6 +60,7 @@ 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 +ynh_app_setting_set --app=$app --key=copyright_text --value=$copyright_text #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index 5dbd4de..a53e119 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,7 @@ 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) +copyright_text=$(ynh_app_setting_get --app=$app --key=copyright_text) #================================================= # CHECK VERSION @@ -90,6 +91,13 @@ if [ -z "$author_email" ]; then ynh_app_setting_set --app=$app --key=author_email --value=$author_email fi +# If copyright_text doesn't exist, create it +if [ -z "$copyright_text" ]; then + copyright_text="Copyright Text" + ynh_app_setting_set --app=$app --key=copyright_text --value=$copyright_text +fi + + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all From cf82ceb60baf194671702816b03efb5c91e01fc3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 09:19:08 +0200 Subject: [PATCH 7/8] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 071821e..d0feb40 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -44,4 +44,4 @@ services = ["__APP__"] ask = "Copyright Text" type = "string" help = "Set copyright text for the RSS feed" - bind = "email:/var/www/__APP__/config.json" + bind = "copyright:/var/www/__APP__/config.json" From a939fb4fe9a8fb60023b27a1b5c1949c1be3b4c2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 27 Aug 2022 09:21:43 +0200 Subject: [PATCH 8/8] Update config_panel.toml --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index d0feb40..b49711d 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -43,5 +43,5 @@ services = ["__APP__"] [main.rss.copyright_text] ask = "Copyright Text" type = "string" - help = "Set copyright text for the RSS feed" + help = "Set the copyright text for the RSS feed" bind = "copyright:/var/www/__APP__/config.json"