diff --git a/manifest.toml b/manifest.toml index 40f214e..68a262f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://etherpad.org/doc/v2.0.2/" code = "https://github.com/ether/etherpad-lite" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/change_url b/scripts/change_url index d16ad80..4a5a274 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -22,7 +22,6 @@ ynh_config_change_url_nginx #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service=$app --action=restart --log_path=systemd --wait_until="Your Etherpad version is" #================================================= diff --git a/scripts/install b/scripts/install index 113cec3..cefd3f9 100644 --- a/scripts/install +++ b/scripts/install @@ -15,7 +15,6 @@ ynh_nodejs_install #================================================= ynh_script_progression "Creating a Redis database..." -# Configure redis redis_db=$(ynh_redis_get_free_db) ynh_app_setting_set --key=redis_db --value="$redis_db" @@ -26,8 +25,6 @@ ynh_script_progression "Setting up source files..." ynh_setup_source --dest_dir=$install_dir -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= @@ -60,21 +57,14 @@ fi ynh_config_add --template="settings.json" --destination="$install_dir/settings.json" ynh_config_add --template="credentials.json" --destination="$install_dir/credentials.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/settings.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/settings.json" - -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/credentials.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/credentials.json" - #================================================= # INSTALL ETHERPAD #================================================= ynh_script_progression "Installing $app..." pushd $install_dir - - ynh_hide_warnings env node_load_PATH corepack enable && corepack prepare pnpm@latest --activate - ynh_hide_warnings env node_load_PATH pnpm --recursive i --production + ynh_hide_warnings corepack enable && corepack prepare pnpm@latest --activate + ynh_hide_warnings pnpm --recursive i --production popd #================================================= diff --git a/scripts/remove b/scripts/remove index cd5e1b1..b6f4450 100644 --- a/scripts/remove +++ b/scripts/remove @@ -3,8 +3,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD REMOVE #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index 61b932c..8e66a0d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,14 +10,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/settings.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/settings.json" - -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/credentials.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/credentials.json" - #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -26,8 +18,7 @@ ynh_script_progression "Reinstalling dependencies..." ynh_nodejs_install pushd "$install_dir" - - ynh_hide_warnings env node_load_PATH corepack enable && corepack prepare pnpm@latest --activate + ynh_hide_warnings corepack enable && corepack prepare pnpm@latest --activate popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 340c128..4e3f55f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,29 +15,13 @@ ynh_systemctl --service=$app --action=stop --log_path="systemd" #================================================= ynh_script_progression "Ensuring downward compatibility..." -if [ -z "${language:-}" ]; then - # If upgrading from a version which doesn't support translations, set language to English by default - language=en - ynh_app_setting_set --key=language --value=$language -fi +ynh_app_setting_set_default --key=language --value=en -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=export --value=none -if [ -z "${export:-}" ]; then - export=none - ynh_app_setting_set --key=export --value=$export -fi +ynh_app_setting_set_default --key=export --value=none -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=path --value="/" -if [ -z "${path:-}" ]; then - path="/" - ynh_app_setting_set --key=path --value=$path -fi +ynh_app_setting_set_default --key=path --value="/" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=password --value=$(ynh_string_random --length=32) -if [ -z "${password:-}" ]; then - password=$(ynh_string_random --length=32) - ynh_app_setting_set --key=password --value="$password" -fi +ynh_app_setting_set_default --key=password --value=$(ynh_string_random --length=32) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -46,8 +30,6 @@ ynh_script_progression "Upgrading source files..." ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="settings.json credentials.json" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION #================================================= @@ -82,21 +64,14 @@ fi ynh_config_add --template="settings.json" --destination="$install_dir/settings.json" ynh_config_add --template="credentials.json" --destination="$install_dir/credentials.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/settings.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/settings.json" - -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/credentials.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/credentials.json" - #================================================= # INSTALL ETHERPAD #================================================= ynh_script_progression "Installing $app..." pushd $install_dir - - ynh_hide_warnings env node_load_PATH corepack enable && corepack prepare pnpm@latest --activate - ynh_hide_warnings env node_load_PATH pnpm --recursive i --production + ynh_hide_warnings corepack enable && corepack prepare pnpm@latest --activate + ynh_hide_warnings pnpm --recursive i --production ynh_safe_rm "$install_dir/var/minified*" popd