From 2d929c6d1ee709004c1372ed0fc93e9f218b6686 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Mar 2022 07:04:57 +0100 Subject: [PATCH 1/5] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index d05fc1e..7e80de8 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) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION From 3d1484fc58b47e307f7b0f963b03964a3928cc8a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Mar 2022 07:06:30 +0100 Subject: [PATCH 2/5] Update upgrade --- scripts/upgrade | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7e80de8..36ca1a6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -46,14 +46,14 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +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="systemd" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # Cleaning legacy permissions if ynh_legacy_permissions_exists; then @@ -65,7 +65,7 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -76,7 +76,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --time --weight=1 + ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -89,7 +89,7 @@ chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config @@ -97,14 +97,14 @@ ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 +ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --time --weight=1 +ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="../conf/config.js.template" --destination="$final_path/config.js" @@ -114,7 +114,7 @@ chown $app:$app "$final_path/config.js" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -122,21 +122,21 @@ ynh_add_systemd_config #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Open source alternative Reddit front-end" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -144,4 +144,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last +ynh_script_progression --message="Upgrade of $app completed" --last From e8dc5330f753dcea6bcb6eb5438c1a0b1302217a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Mar 2022 08:25:24 +0100 Subject: [PATCH 3/5] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 36ca1a6..728deba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,6 +116,7 @@ chown $app:$app "$final_path/config.js" #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 +env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config From 5aa11015d260ce8b438e3f6b44f29204770c4743 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Mar 2022 11:44:56 +0100 Subject: [PATCH 4/5] Update upgrade --- scripts/upgrade | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 728deba..e5d3988 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,6 +111,16 @@ ynh_add_config --template="../conf/config.js.template" --destination="$final_pat chmod 400 "$final_path/config.js" chown $app:$app "$final_path/config.js" +#================================================= +# INSTALL THE LOUNGE +#================================================= +ynh_script_progression --message="Installing $app..." --weight=10 + +pushd $final_path + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --no-optional +popd + #================================================= # SETUP SYSTEMD #================================================= From da022ebf2fbf02692f29347872f7415198751ecc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 23 Mar 2022 12:06:15 +0100 Subject: [PATCH 5/5] Update manifest.json --- manifest.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest.json b/manifest.json index ddb21c4..2acb048 100644 --- a/manifest.json +++ b/manifest.json @@ -35,6 +35,10 @@ { "name": "is_public", "type": "boolean", + "help": { + "en": "If enabled, Teddit 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, Teddit sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + }, "default": true } ]