diff --git a/README.md b/README.md index e1d2b5e..584e58b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Be aware, Redis database backup and restore is not fully implemented. If you want to install Etherpad with plugins and mysql database: https://github.com/YunoHost-Apps/etherpad_mypads_ynh", -**Shipped version:** 1.9.4~ynh1 +**Shipped version:** 1.9.6~ynh1 **Demo:** https://video.etherpad.com/ diff --git a/README_fr.md b/README_fr.md index f3a81e1..2bcacd8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -22,7 +22,7 @@ Attention, la sauvegarde et la restauration de la base de données Redis ne sont Si vous souhaitez installer Etherpad avec les plugins et la base de données mysql : https://github.com/YunoHost-Apps/etherpad_mypads_ynh", -**Version incluse :** 1.9.4~ynh1 +**Version incluse :** 1.9.6~ynh1 **Démo :** https://video.etherpad.com/ diff --git a/conf/credentials.json b/conf/credentials.json index 64ef848..5655057 100644 --- a/conf/credentials.json +++ b/conf/credentials.json @@ -40,6 +40,8 @@ "users": { "__ADMIN__": { + // 1) "password" can be replaced with "hash" if you install ep_hash_auth + // 2) please note that if password is null, the user will not be created "password": "__PASSWORD__", "is_admin": true } diff --git a/conf/systemd.service b/conf/systemd.service index 200bb15..e419287 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,12 +1,13 @@ [Unit] Description=Etherpad-lite: collaborative editor -After=syslog.target network.target postgresql.service +After=syslog.target network.target [Service] Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__INSTALL_DIR__ +WorkingDirectory=__INSTALL_DIR__/ +Environment=ETHERPAD_PRODUCTION=true Environment="NODE_ENV=production" Environment="__YNH_NODE_LOAD_PATH__" ExecStart=__INSTALL_DIR__/src/bin/run.sh diff --git a/manifest.toml b/manifest.toml index 26ba003..de4a0e7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Etherpad" description.en = "Online editor providing collaborative editing in real-time" description.fr = "Éditeur en ligne fournissant l'édition collaborative en temps réel" -version = "1.9.4~ynh1" +version = "1.9.6~ynh1" maintainers = ["eric_G"] @@ -20,8 +20,11 @@ code = "https://github.com/ether/etherpad-lite" yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = true + sso = true + disk = "50M" ram.build = "2G" ram.runtime = "50M" @@ -50,7 +53,7 @@ ram.runtime = "50M" ask.fr = "Choisissez la langue de l'application" type = "select" choices = ["ca", "de", "en", "es", "fr", "gl", "hu", "it", "nl", "pt"] - default = "en" + default = "fr" [install.admin] type = "user" @@ -60,8 +63,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/ether/etherpad-lite/archive/refs/tags/v1.9.4.tar.gz" - sha256 = "5b8ccf2a3c92cbd9bb578f684bc52d2ea27fc3fb30cdc76341f9ccffe0c0ff7f" + url = "https://github.com/ether/etherpad-lite/archive/refs/tags/v1.9.6.tar.gz" + sha256 = "cd0cb2c9c2c4a8f93972b3f5913ff00cd3733c732195df293c8f56f3ce0a018f" autoupdate.strategy = "latest_github_tag" [resources.ports] diff --git a/scripts/change_url b/scripts/change_url index 6898805..3f4d2ab 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,7 +32,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=6 # Start a systemd service ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is" -sleep 120 #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 184ac85..ea12af5 100644 --- a/scripts/install +++ b/scripts/install @@ -36,44 +36,6 @@ ynh_setup_source --dest_dir=$install_dir chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# INSTALL ETHERPAD -#================================================= -ynh_script_progression --message="Installing $app..." --weight=60 - -pushd $install_dir - ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH src/bin/installDeps.sh -popd - -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Configuring $app..." --weight=6 - -ynh_add_config --template="../conf/settings.json" --destination="$install_dir/settings.json" -chmod 400 "$install_dir/settings.json" -chown $app:$app "$install_dir/settings.json" - -if [ "$export" = "abiword" ] -then - # Get AbiWord binary path - abiword_path=`which abiword` - # Set the path of AbiWord into Etherpad config - ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$install_dir/settings.json" -elif [ "$export" = "libreoffice" ] -then - # Get soffice binary path - soffice_path=`which soffice` - # Set the path of soffice into Etherpad config - ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$install_dir/settings.json" -fi -ynh_store_file_checksum --file="$install_dir/settings.json" - -ynh_add_config --template="../conf/credentials.json" --destination="$install_dir/credentials.json" -chmod 400 "$install_dir/credentials.json" -chown $app:$app "$install_dir/credentials.json" - #================================================= # SETUP SYSTEMD #================================================= @@ -90,6 +52,41 @@ ynh_use_logrotate yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/$app.log" +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Configuring $app..." --weight=6 + +abiword_path="null" +soffice_path="null" + +if [[ "$export" == "abiword" ]] +then + abiword_path="\"$(which abiword)\"" +elif [[ "$export" == "libreoffice" ]] +then + soffice_path="\"$(which soffice)\"" +fi + +ynh_add_config --template="settings.json" --destination="$install_dir/settings.json" +ynh_add_config --template="credentials.json" --destination="$install_dir/credentials.json" + +chmod 600 "$install_dir/settings.json" +chown $app:$app "$install_dir/settings.json" + +chmod 600 "$install_dir/credentials.json" +chown $app:$app "$install_dir/credentials.json" + +#================================================= +# INSTALL ETHERPAD +#================================================= +ynh_script_progression --message="Installing $app..." --weight=10 + +pushd $install_dir + ynh_use_nodejs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH ETHERPAD_PRODUCTION=true src/bin/installDeps.sh +popd + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/restore b/scripts/restore index b132b8c..d83404d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,7 +19,12 @@ ynh_restore_file --origin_path="$install_dir" # Restore permissions on app files chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -chmod 400 $install_dir/credentials.json + +chmod 600 "$install_dir/settings.json" +chown $app:$app "$install_dir/settings.json" + +chmod 600 "$install_dir/credentials.json" +chown $app:$app "$install_dir/credentials.json" #================================================= # REINSTALL DEPENDENCIES @@ -49,7 +54,6 @@ yunohost service add $app --description="Collaborative editor" --log="/var/log/$ ynh_script_progression --message="Starting a systemd service..." --weight=8 ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is" -sleep 60 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 5ce9018..ada6dca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,32 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=42 ynh_systemd_action --service_name=$app --action=stop --log_path="systemd" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=2 + +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 --app=$app --key=language --value=$language +fi + +if [ -z "${export:-}" ]; then + export=none + ynh_app_setting_set --app=$app --key=export --value=$export +fi + +if [ -z "${path:-}" ]; then + path="/" + ynh_app_setting_set --app=$app --key=path --value=$path +fi + +if [ -z "${password:-}" ]; then + password=$(ynh_string_random --length=32) + ynh_app_setting_set --app=$app --key=password --value="$password" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -31,7 +57,7 @@ ynh_systemd_action --service_name=$app --action=stop --log_path="systemd" if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$install_dir" --keep="settings.json credentials.json" fi @@ -56,14 +82,39 @@ ynh_use_logrotate --non-append yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/$app.log" +#================================================= +# CONFIGURE ETHERPAD +#================================================= +ynh_script_progression --message="Configure $app..." --weight=3 + +abiword_path="null" +soffice_path="null" + +if [[ "$export" == "abiword" ]] +then + abiword_path="\"$(which abiword)\"" +elif [[ "$export" == "libreoffice" ]] +then + soffice_path="\"$(which soffice)\"" +fi + +ynh_add_config --template="settings.json" --destination="$install_dir/settings.json" +ynh_add_config --template="credentials.json" --destination="$install_dir/credentials.json" + +chmod 600 "$install_dir/settings.json" +chown $app:$app "$install_dir/settings.json" + +chmod 600 "$install_dir/credentials.json" +chown $app:$app "$install_dir/credentials.json" + #================================================= # INSTALL ETHERPAD #================================================= -ynh_script_progression --message="Installing $app..." --weight=90 +ynh_script_progression --message="Installing $app..." --weight=60 pushd $install_dir ynh_use_nodejs - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH src/bin/installDeps.sh + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH ETHERPAD_PRODUCTION=true src/bin/installDeps.sh popd #================================================= diff --git a/tests.toml b/tests.toml index ab97358..412e10e 100644 --- a/tests.toml +++ b/tests.toml @@ -6,4 +6,15 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - #test_upgrade_from.96653aee9379d579a655777ac274355f4afca61c.name = "Upgrade from 5.4" \ No newline at end of file + args.export = "none" + args.password = "##SuperAdminPassword##" + + #test_upgrade_from.96653aee9379d579a655777ac274355f4afca61c.name = "Upgrade from 5.4" + + [with_abiword] + args.export = "abiword" + only = ["install.root"] + + [with_libreoffice] + args.export = "libreoffice" + only = ["install.root"] \ No newline at end of file