From 2240b3ee24edc77c32968f6c8c67ed56f656c7ea Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 15:25:46 +0100 Subject: [PATCH 01/48] Update app.src --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index 1016585..89b171d 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.8.4.tar.gz -SOURCE_SUM=b6ad9734a058d3b471cf15c060e609e978797e32559818e9f0a80e0a253c7ba8 +SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.8.12.tar.gz +SOURCE_SUM=a5d490e75aa7a710c28bcc9b88efce528713f83f70e8984b3f9bc661e997d04f SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From fe66afce1f7048764d0fcd94548001b4497a70cf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 15:51:01 +0100 Subject: [PATCH 02/48] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 8fe4898..fd81e8d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ User=__APP__ Group=__APP__ Environment="PATH=__ENV_PATH__" Environment=NODE_ENV=production -ExecStart=__FINALPATH__/bin/safeRun.sh /var/log/__APP__/etherpad.log +ExecStart=__FINALPATH__/src/bin/run.sh /var/log/__APP__/etherpad.log Restart=always [Install] From 5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 16:39:11 +0100 Subject: [PATCH 03/48] Fix --- README.md | 2 +- README_fr.md | 2 +- check_process | 1 - conf/credentials.json | 2 +- conf/systemd.service | 5 +-- config_panel.toml | 8 +---- manifest.json | 24 ++----------- scripts/_variables | 2 +- scripts/actions/reset_default_config | 2 +- scripts/change_url | 2 +- scripts/config | 24 +------------ scripts/install | 45 +++++++++++------------ scripts/restore | 2 +- scripts/upgrade | 54 +++++++++++++--------------- 14 files changed, 62 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index ec2c3dc..3eff617 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time. This package will install the same plugins than [Framapad](https://framapad.org/). -**Shipped version:** 1.8.4 +**Shipped version:** 1.8.12 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 3e90ad5..5548138 100644 --- a/README_fr.md +++ b/README_fr.md @@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst Etherpad est un éditeur en ligne Open Source hautement personnalisable qui permet l'édition collaborative en temps réel. Ce paquet installera les mêmes plugins que [Framapad](https://framapad.org/). -**Version embarquée :** 1.8.4 +**Version embarquée :** 1.8.12 ## Captures d'écran diff --git a/check_process b/check_process index a908e89..870f8f7 100644 --- a/check_process +++ b/check_process @@ -19,7 +19,6 @@ main.pad_configuration.pad_config_alwaysshowchat=1|0 main.pad_configuration.pad_config_show_markdown=1|0 main.pad_configuration.pad_config_automatic_logout=0|1 - main.pad_configuration.pad_config_skinname=noskin|colibris|noskin main.mypads_configuration.mypads=0|1 main.mypads_configuration.useldap=0|1 main.is_public.is_public=1|0 diff --git a/conf/credentials.json b/conf/credentials.json index 02cc320..eb17770 100644 --- a/conf/credentials.json +++ b/conf/credentials.json @@ -44,7 +44,7 @@ "__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": "__PASSWD__", + "password": "__PASSWORD__", "is_admin": true } }, diff --git a/conf/systemd.service b/conf/systemd.service index fd81e8d..645f210 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,9 +6,10 @@ After=syslog.target network.target Type=simple User=__APP__ Group=__APP__ -Environment="PATH=__ENV_PATH__" +WorkingDirectory=__FINALPATH__ Environment=NODE_ENV=production -ExecStart=__FINALPATH__/src/bin/run.sh /var/log/__APP__/etherpad.log +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=__FINALPATH__/src/bin/run.sh Restart=always [Install] diff --git a/config_panel.toml b/config_panel.toml index 8b1f163..7561980 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -46,13 +46,7 @@ name = "Etherpad configuration" ask = "Automatic logout" type = "boolean" default = true - - [main.pad_configuration.pad_config_skinname] - ask = "Theme Name" - choices = ["noskin", "colibris"] - default = "noskin" - help = "noskin is the traditional Etherpad theme. colibris is the new theme." - + [main.mypads_configuration] name = "Mypads configuration" diff --git a/manifest.json b/manifest.json index a44fa03..5007da2 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online editor providing collaborative editing in real-time.", "fr": "Éditeur en ligne fournissant l'édition collaborative en temps réel." }, - "version": "1.8.4~ynh3", + "version": "1.8.12~ynh1", "url": "https://framapad.org", "license": "Apache-2.0", "maintainer": { @@ -18,7 +18,7 @@ "email": "maniackc_dev@crudelis.fr" }], "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -30,38 +30,22 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Etherpad MyPads", - "fr": "Choisissez un domaine pour Etherpad MyPads" - }, "example": "sub.domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Etherpad MyPads", - "fr": "Choisissez un chemin pour Etherpad MyPads" - }, "example": "/pad", "default": "/pad" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose the Etherpad MyPads administrator (must be an existing YunoHost user)", - "fr": "Choisissez l'administrateur Etherpad MyPads (doit être un utilisateur YunoHost existant)" - }, "example": "john" }, { "name": "password", "type": "password", - "ask": { - "en": "Set the administrator password (between 8 and 30 characters)", - "fr": "Définissez le mot de passe administrateur (entre 8 et 30 caractères)" - }, "example": "Choose a password" }, { @@ -77,10 +61,6 @@ { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public website?", - "fr": "Est-ce un site public ?" - }, "help": { "en": "If your Etherpad instance is public, everyone will be able to create a pad or see an existing one.", "fr": "Si votre instance Etherpad est publique, tout le monde pourra créer un pad ou voir un pad existant." diff --git a/scripts/_variables b/scripts/_variables index ec5a324..063a5f7 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -7,7 +7,7 @@ abiword_app_depencencies="abiword" libreoffice_app_dependencies="unoconv libreoffice-writer" # NodeJS version -nodejs_version=12 +nodejs_version=14 # MyPads version # This variable is mostly used to force an upgrade of the package in case of new versions of MyPads. diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config index 19936da..d1404e7 100755 --- a/scripts/actions/reset_default_config +++ b/scripts/actions/reset_default_config @@ -87,7 +87,7 @@ ynh_store_file_checksum --file="$config_file" ynh_script_progression --message="Restarting Etherpad..." --weight=9 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index b3954a7..172752c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -130,7 +130,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=10 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE diff --git a/scripts/config b/scripts/config index ffbe98e..e464243 100644 --- a/scripts/config +++ b/scripts/config @@ -78,16 +78,6 @@ else fi pad_config_automatic_logout="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT:-$old_pad_config_automatic_logout}" -# Etherpad skin -old_pad_config_skinname="$(get_config_value skinName)" -if [ "$old_pad_config_skinname" = "no-skin" ]; then - old_pad_config_skinname=noskin -fi -pad_config_skinname="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SKINNAME:-$old_pad_config_skinname}" -if [ "$pad_config_skinname" = "no-skin" ]; then - pad_config_skinname=noskin -fi - # Mypads if [ -d $final_path/node_modules/ep_mypads ] then @@ -146,7 +136,6 @@ show_config() { ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_ALWAYSSHOWCHAT=$pad_config_alwaysshowchat" ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN=$pad_config_show_markdown" ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT=$pad_config_automatic_logout" - ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SKINNAME=$pad_config_skinname" ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS=$mypads" ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP=$useldap" @@ -230,17 +219,6 @@ apply_config() { restart_etherpad=1 fi - # Plugin option ep_page_view_default - if [ "$pad_config_skinname" != "$old_pad_config_skinname" ] - then - if [ "$pad_config_skinname" = "noskin" ]; then - pad_config_skinname="no-skin" - fi - ynh_replace_string --match_string="\( *\"skinName\" *: \).*," --replace_string="\1\"$pad_config_skinname\"," --target_file="$config_file" - ynh_app_setting_set --app=$app --key=pad_config_skinname --value="$pad_config_skinname" - restart_etherpad=1 - fi - # Export if [ "$export" != "$old_export" ] then @@ -310,7 +288,7 @@ apply_config() { if [ $restart_etherpad -eq 1 ] then # Wait for etherpad to be fully started - ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" + ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" fi #================================================= diff --git a/scripts/install b/scripts/install index ee2e394..93988b3 100644 --- a/scripts/install +++ b/scripts/install @@ -161,16 +161,22 @@ ynh_use_logrotate --specific_user=$app/$app ynh_script_progression --message="Installing Etherpad..." --weight=90 # Install dependencies and proceed to the installation -ynh_use_nodejs -( - cd "$final_path" - mkdir -p node_modules - cd node_modules - [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite - cd ep_etherpad-lite - chown -R $app: $final_path - ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn -) +# ynh_use_nodejs +# ( +# cd "$final_path" +# mkdir -p node_modules +# cd node_modules +# [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite +# cd ep_etherpad-lite +# chown -R $app: $final_path +# ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn +# ) + +chown -R $app: $final_path +pushd $final_path + ynh_use_nodejs + ynh_exec_as $app env "$ynh_node_load_PATH" bin/installDeps.sh +popd #================================================= # CONFIGURE ETHERPAD @@ -178,12 +184,8 @@ ynh_use_nodejs ynh_script_progression --message="Configuring Etherpad..." --weight=6 cp ../conf/settings.json "$final_path/settings.json" -cp ../conf/credentials.json "$final_path/credentials.json" + ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/settings.json" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/credentials.json" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/credentials.json" -ynh_print_OFF; ynh_replace_special_string --match_string="__PASSWD__" --replace_string="$password" --target_file="$final_path/credentials.json"; ynh_print_ON if [ "$export" = "abiword" ] then # Get abiword binary path @@ -207,8 +209,8 @@ fi # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/settings.json" -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$final_path/credentials.json" + +ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" #================================================= # SECURING FILES AND DIRECTORIES @@ -224,9 +226,8 @@ chmod 600 $final_path/credentials.json #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=4 -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" # Create a dedicated systemd config -ynh_add_systemd_config +ynh_add_systemd_config --others_var="ynh_node_load_PATH" #================================================= # ADVERTISE SERVICE IN ADMIN PANEL @@ -295,7 +296,7 @@ fi #================================================= # SETUP FAIL2BAN #================================================= -ynh_script_progression --message="Configuring Fail2ban..." --weight=13 +ynh_script_progression --message="Configuring Fail2Ban..." --weight=13 # Create a dedicated fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=" .* .POST /mypads/api/auth/login HTTP/1.1. 400" --max_retry=5 @@ -325,7 +326,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=20 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" if [ $mypads -eq 1 ] then @@ -333,7 +334,7 @@ then mysql -u $db_name -p$db_pwd $db_name < "../conf/lang_mypads.sql" # Wait for etherpad to be fully started - ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" + ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" fi #================================================= diff --git a/scripts/restore b/scripts/restore index d4da3c7..7dd74e1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -173,7 +173,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=8 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE diff --git a/scripts/upgrade b/scripts/upgrade index 28521a1..d6f402f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,8 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) export=$(ynh_app_setting_get --app=$app --key=export) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON mypads=$(ynh_app_setting_get --app=$app --key=mypads) useldap=$(ynh_app_setting_get --app=$app --key=useldap) overwrite_settings=$(ynh_app_setting_get --app=$app --key=overwrite_settings) @@ -40,14 +42,13 @@ pad_config_showlinenumbers=$(ynh_app_setting_get --app=$app --key=pad_config_sho pad_config_chatandusers=$(ynh_app_setting_get --app=$app --key=pad_config_chatandusers) pad_config_alwaysshowchat=$(ynh_app_setting_get --app=$app --key=pad_config_alwaysshowchat) pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_markdown) -pad_config_skinname=$(ynh_app_setting_get --app=$app --key=pad_config_skinname) #================================================= # CHECK VERSION #================================================= # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" upgrade_type=$(ynh_check_app_version_changed) @@ -209,13 +210,6 @@ fi #================================================= ynh_script_progression --message="Upgrading NodeJS..." --weight=4 -# Remove the old nvm helper. -if [ -d /opt/nvm ] -then - ynh_secure_remove --file="/opt/nvm" - sed --in-place "/NVM_DIR/d" /root/.bashrc -fi - ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= @@ -231,9 +225,24 @@ ynh_exec_warn_less npm cache clean --force ynh_secure_remove --file="$final_path/src/package-lock.json" ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update) + +pushd $final_path + ynh_use_nodejs + 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" npm cache clean --force + #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade + ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_automatic_logut ep_countable ep_delete_empty_pads ep_subscript_and_superscript ep_headings2 ep_author_hover ep_markdown ep_comments_page ep_align ep_font_color ep_font_size ep_spellcheck ep_table_of_contents >> $install_log 2>&1 + if [ $mypads -eq 1 ]; then + # Framapad - Groups and private pads for Etherpad + ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_mypads >> $install_log 2>&1 + fi +popd + + # Then update the additionnal modules (cd "$final_path" -ynh_exec_warn_less npm cache clean --force +#ynh_exec_warn_less npm cache clean --force +ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force while read node_module do # Ignore ep_etherpad-lite, this part is updated before in this script. @@ -251,9 +260,12 @@ do if [ -n "${module_version}" ]; then module_version=@${module_version} fi - ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade ${node_module}${module_version} || true + ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade ${node_module}${module_version} || true done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")") +# ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade ${node_module}${module_version} || true +# done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")") + #================================================= # SPECIFIC UPGRADE #================================================= @@ -315,9 +327,6 @@ then if [ -n "$pad_config_show_markdown" ]; then ynh_replace_string --match_string="\(\"ep_markdown_default\" *: \).*," --replace_string="\1$pad_config_show_markdown," --target_file="$final_path/settings.json" fi - if [ -n "$pad_config_skinname" ]; then - ynh_replace_string --match_string="\(\"skinName\" *: \).*," --replace_string="\1\"$pad_config_skinname\"," --target_file="$final_path/settings.json" - fi # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/settings.json" @@ -326,19 +335,7 @@ then # Overwrite the credentials config file only if it's allowed if [ $overwrite_credentials -eq 1 ] then - # Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. - ynh_backup_if_checksum_is_different --file="$final_path/credentials.json" - cp ../conf/credentials.json "$final_path/credentials.json" - - ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$final_path/credentials.json" - db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON - ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/credentials.json" - ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/credentials.json" - ynh_print_OFF; ynh_replace_special_string --match_string="__PASSWD__" --replace_string="$password" --target_file="$final_path/credentials.json"; ynh_print_ON - - # Recalculate and store the checksum of the file for the next upgrade. - ynh_store_file_checksum --file="$final_path/credentials.json" + ynh_add_config --template="../conf/credentials.json" --destination="$final_path/credentials.json" fi fi @@ -390,8 +387,7 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 # Overwrite the systemd configuration only if it's allowed if [ $overwrite_systemd -eq 1 ] then - ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" - ynh_add_systemd_config + ynh_add_systemd_config --others_var="ynh_node_load_PATH" fi #================================================= From 862cd0e753e7bad06b782a8b8c519e81cd87f7ee Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 17:11:07 +0100 Subject: [PATCH 04/48] Fix --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 93988b3..4f402c0 100644 --- a/scripts/install +++ b/scripts/install @@ -110,6 +110,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Creating a MySQL database..." db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name diff --git a/scripts/upgrade b/scripts/upgrade index d6f402f..393eb76 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) export=$(ynh_app_setting_get --app=$app --key=export) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) ynh_print_OFF; password=$(ynh_app_setting_get --app=$app --key=password); ynh_print_ON mypads=$(ynh_app_setting_get --app=$app --key=mypads) From f32f00f7a35e93087996d32993758d98d0ff4db7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 19:05:01 +0100 Subject: [PATCH 05/48] Update upgrade --- scripts/upgrade | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 393eb76..b3b1b81 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -218,30 +218,26 @@ ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Upgrading Etherpad npm modules..." --weight=60 -# Update the main modules of etherpad -chown -R $app: $final_path -(cd "$final_path/src" -ynh_exec_warn_less npm cache clean --force -# Remove package-lock.json to prevent any shit during npm update... -ynh_secure_remove --file="$final_path/src/package-lock.json" -ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update) +# # Update the main modules of etherpad +# chown -R $app: $final_path +# (cd "$final_path/src" +# ynh_exec_warn_less npm cache clean --force +# # Remove package-lock.json to prevent any shit during npm update... +# ynh_secure_remove --file="$final_path/src/package-lock.json" +# ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update) -pushd $final_path - ynh_use_nodejs - 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" npm cache clean --force - #ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade - ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_automatic_logut ep_countable ep_delete_empty_pads ep_subscript_and_superscript ep_headings2 ep_author_hover ep_markdown ep_comments_page ep_align ep_font_color ep_font_size ep_spellcheck ep_table_of_contents >> $install_log 2>&1 - if [ $mypads -eq 1 ]; then - # Framapad - Groups and private pads for Etherpad - ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_mypads >> $install_log 2>&1 - fi -popd +# pushd $final_path +# ynh_use_nodejs +# ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh + +# popd # Then update the additionnal modules -(cd "$final_path" +pushd $final_path + ynh_use_nodejs + ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh #ynh_exec_warn_less npm cache clean --force ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force while read node_module @@ -262,7 +258,8 @@ do module_version=@${module_version} fi ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade ${node_module}${module_version} || true -done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")") +done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")" +popd # ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade ${node_module}${module_version} || true # done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")") From 9684b59824b18ea781efb8a26df5d7c3d51a8264 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 19:48:35 +0100 Subject: [PATCH 06/48] Upgrade to version 1.8.13 --- README.md | 4 ++-- README_fr.md | 6 +++--- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3eff617..f39c831 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ You can also find a configuration file for Etherpad at this path `/var/www/ether ## Documentation - * Official documentation: http://etherpad.org/doc/v1.8.4 - * YunoHost documentation: https://yunohost.org/#/app_etherpad_mypads + * Official documentation: http://etherpad.org/doc/v1.8.13 + * YunoHost documentation: https://yunohost.org/en/app_etherpad_mypads ## YunoHost specific features diff --git a/README_fr.md b/README_fr.md index 5548138..fba0ca7 100644 --- a/README_fr.md +++ b/README_fr.md @@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst Etherpad est un éditeur en ligne Open Source hautement personnalisable qui permet l'édition collaborative en temps réel. Ce paquet installera les mêmes plugins que [Framapad](https://framapad.org/). -**Version embarquée :** 1.8.12 +**Version embarquée :** 1.8.13 ## Captures d'écran @@ -30,8 +30,8 @@ Vous pouvez accéder à deux panneaux d'administration différents, pour Etherpa ## Documentation - * Documentation officielle : http://etherpad.org/doc/v1.8.4 - * Documentation YunoHost : https://yunohost.org/#/app_etherpad_mypads_fr + * Documentation officielle : http://etherpad.org/doc/v1.8.13 + * Documentation YunoHost : https://yunohost.org/fr/app_etherpad_mypads ## Fonctionnalités spécifiques à YunoHost diff --git a/conf/app.src b/conf/app.src index 89b171d..2c28073 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.8.12.tar.gz -SOURCE_SUM=a5d490e75aa7a710c28bcc9b88efce528713f83f70e8984b3f9bc661e997d04f +SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.8.13.tar.gz +SOURCE_SUM=c83052daf3b0af8aa3c19a8308e21fcbcfecca99aeb3e8047383875f855443f1 SOURCE_SUM_PRG=sha256sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 5007da2..9e7d0dd 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Online editor providing collaborative editing in real-time.", "fr": "Éditeur en ligne fournissant l'édition collaborative en temps réel." }, - "version": "1.8.12~ynh1", + "version": "1.8.13~ynh1", "url": "https://framapad.org", "license": "Apache-2.0", "maintainer": { From 93988920bc8485bfc0bbfe56e35003b7299297b3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 21:17:45 +0100 Subject: [PATCH 07/48] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b3b1b81..7331316 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -413,7 +413,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=9 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE From 7336d8edd3a483914e14b146b7978abd607398c8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 21:40:50 +0100 Subject: [PATCH 08/48] Fix --- README.md | 2 +- pull_request_template.md | 11 ++----- scripts/actions/add_remove_libreoffice | 10 +++--- scripts/config | 10 +++--- scripts/install | 28 +++++------------ scripts/restore | 2 +- scripts/upgrade | 43 +++++++------------------- 7 files changed, 34 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index f39c831..8c12a5e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time. This package will install the same plugins than [Framapad](https://framapad.org/). -**Shipped version:** 1.8.12 +**Shipped version:** 1.8.13 ## Screenshots diff --git a/pull_request_template.md b/pull_request_template.md index d7cd620..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -11,13 +11,6 @@ - [ ] Upgrade from last version tested. - [ ] Can be reviewed and tested. -## Validation +## Package_check results --- -*Minor decision* -- [ ] **Code review** : -- [ ] **Approval (LGTM)** : -*Code review and approval have to be from a member of @YunoHost-Apps/apps-group* -- **CI succeeded** : -[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/etherpad_mypads_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/etherpad_mypads_ynh%20PR-NUM-/) -*Please replace '-NUM-' in this link by the PR number.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/actions/add_remove_libreoffice b/scripts/actions/add_remove_libreoffice index 106ecbd..5335985 100755 --- a/scripts/actions/add_remove_libreoffice +++ b/scripts/actions/add_remove_libreoffice @@ -67,18 +67,18 @@ fi ynh_script_progression --message="$action2 LibreOffice..." --weight=3 -# Load common variables, and especially libreoffice dependencies. +# Load common variables, and especially LibreOffice dependencies. source scripts/_variables dependencies="" if [ $libreoffice -eq 1 ] then - # Add libreoffice dependencies if libreoffice has to be installed + # Add LibreOffice dependencies if libreoffice has to be installed dependencies="$dependencies $libreoffice_app_dependencies" fi if [ $abiword -eq 1 ] then - # Add abiword dependencies if abiword is already installed to keep it as a dependence. + # Add Abiword dependencies if abiword is already installed to keep it as a dependence. dependencies="$dependencies $abiword_app_depencencies" fi @@ -95,11 +95,11 @@ ynh_package_autopurge if [ $libreoffice -eq 1 ] then - # Set libreoffice as default export app + # Set LibreOffice as default export app yunohost app config apply $app -a "YNH_CONFIG_MAIN_EXPORT_EXPORT=libreoffice" elif [ $abiword -eq 1 ] then - # Set abiword as default export app + # Set Abiword as default export app yunohost app config apply $app -a "YNH_CONFIG_MAIN_EXPORT_EXPORT=abiword" else # Remove any export app diff --git a/scripts/config b/scripts/config index e464243..747a464 100644 --- a/scripts/config +++ b/scripts/config @@ -78,7 +78,7 @@ else fi pad_config_automatic_logout="${YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT:-$old_pad_config_automatic_logout}" -# Mypads +# MyPads if [ -d $final_path/node_modules/ep_mypads ] then # Enable @@ -89,7 +89,7 @@ else fi mypads="${YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS:-$old_mypads}" -# Ldap for Mypads +# Ldap for MyPads if grep -q "//noldap" $config_file then # Disable @@ -224,7 +224,7 @@ apply_config() { then if [ "$export" = "abiword" ] then - # if abiword isn't installed, call the action add_remove_abiword. + # if Abiword isn't installed, call the action add_remove_abiword. if ! which abiword > /dev/null then yunohost app action run $app add_remove_abiword @@ -233,7 +233,7 @@ apply_config() { ynh_replace_string --match_string="\(\"soffice\" *: \).*," --replace_string="\1null," --target_file="$config_file" elif [ "$export" = "libreoffice" ] then - # if libreoffice isn't installed, call the action add_remove_libreoffice. + # if LibreOffice isn't installed, call the action add_remove_libreoffice. if ! which soffice > /dev/null then yunohost app action run $app add_remove_libreoffice @@ -250,7 +250,7 @@ apply_config() { restart_etherpad=1 fi - # Mypads + # MyPads if [ "$mypads" != "$old_mypads" ] then ynh_use_nodejs diff --git a/scripts/install b/scripts/install index 4f402c0..c41ae94 100644 --- a/scripts/install +++ b/scripts/install @@ -114,6 +114,14 @@ db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=3 + +# Create a dedicated system user +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -131,14 +139,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a dedicated system user -ynh_system_user_create --username=$app --home_dir=$final_path - #================================================= # SPECIFIC SETUP #================================================= @@ -161,18 +161,6 @@ ynh_use_logrotate --specific_user=$app/$app #================================================= ynh_script_progression --message="Installing Etherpad..." --weight=90 -# Install dependencies and proceed to the installation -# ynh_use_nodejs -# ( -# cd "$final_path" -# mkdir -p node_modules -# cd node_modules -# [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite -# cd ep_etherpad-lite -# chown -R $app: $final_path -# ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn -# ) - chown -R $app: $final_path pushd $final_path ynh_use_nodejs diff --git a/scripts/restore b/scripts/restore index 7dd74e1..266deaf 100644 --- a/scripts/restore +++ b/scripts/restore @@ -154,7 +154,7 @@ systemctl enable $app.service --quiet #================================================= # RESTORE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the Fail2ban configuration..." --weight=6 +ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=6 ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 7331316..af77c10 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -170,6 +170,14 @@ ynh_script_progression --message="Stopping Etherpad service..." --weight=3 ynh_systemd_action --action=stop +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -218,22 +226,6 @@ ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Upgrading Etherpad npm modules..." --weight=60 -# # Update the main modules of etherpad -# chown -R $app: $final_path -# (cd "$final_path/src" -# ynh_exec_warn_less npm cache clean --force -# # Remove package-lock.json to prevent any shit during npm update... -# ynh_secure_remove --file="$final_path/src/package-lock.json" -# ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update) - - -# pushd $final_path -# ynh_use_nodejs -# ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh - -# popd - - # Then update the additionnal modules pushd $final_path ynh_use_nodejs @@ -261,9 +253,6 @@ do done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")" popd -# ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade ${node_module}${module_version} || true -# done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")") - #================================================= # SPECIFIC UPGRADE #================================================= @@ -286,13 +275,13 @@ then then # Get abiword binary path abiword_path=`which abiword` - # Set the path of abiword into etherpad config + # Set the path of Abiword into Etherpad config ynh_replace_string --match_string="\"abiword\" : null" --replace_string="\"abiword\" : \"$abiword_path\"" --target_file="$final_path/settings.json" elif [ "$export" = "libreoffice" ] then # Get soffice binary path soffice_path=`which soffice` - # Set the path of soffice into etherpad config + # Set the path of soffice into Etherpad config ynh_replace_string --match_string="\"soffice\" : null" --replace_string="\"soffice\" : \"$soffice_path\"" --target_file="$final_path/settings.json" fi @@ -303,7 +292,7 @@ then fi ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/settings.json" - # Use ldap for mypads + # Use LDAP for MyPads if [ $mypads -eq 1 ] && [ $useldap -eq 1 ] then ynh_replace_string --match_string="//noldap" --replace_string="" --target_file="$final_path/settings.json" @@ -337,14 +326,6 @@ then fi fi -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path - #================================================= # SECURING FILES AND DIRECTORIES #================================================= @@ -364,7 +345,7 @@ yunohost service add $app --description="Collaborative editor" --log="/var/log/$ #================================================= # UPGRADE FAIL2BAN #================================================= -ynh_script_progression --message="Reconfiguring Fail2ban..." --weight=8 +ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8 # Create a dedicated fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=" .* .POST /mypads/api/auth/login HTTP/1.1. 400" --max_retry=5 From 2926ce927b1159989ac7c724e30ced73180e125d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 21:42:12 +0100 Subject: [PATCH 09/48] Update check_process --- check_process | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 870f8f7..5ea099e 100644 --- a/check_process +++ b/check_process @@ -1,4 +1,4 @@ -;; Test complet avec libreoffice et mypads +;; Test complet avec LibreOffice et MyPads ; Manifest domain="domain.tld" (DOMAIN) path="/path" (PATH) @@ -39,7 +39,7 @@ change_url=1 actions=1 config_panel=1 -;; Test sans mypads +;; Test sans MyPads ; Manifest domain="domain.tld" (DOMAIN) path="/path" (PATH) @@ -55,7 +55,7 @@ setup_root=1 upgrade=1 backup_restore=1 -;; Test abiword +;; Test Abiword ; Manifest domain="domain.tld" (DOMAIN) path="/" (PATH) From 3d3fa0b1012f043ce8e213fb40852d9f5c838c00 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 21:53:17 +0100 Subject: [PATCH 10/48] Update config --- scripts/config | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index 747a464..4d7a27d 100644 --- a/scripts/config +++ b/scripts/config @@ -206,6 +206,7 @@ apply_config() { then ynh_use_nodejs pushd "$final_path" + ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$pad_config_automatic_logout" = "0" ] then ynh_replace_string --match_string="^\(.*\"automatic_logut.*$\)" --replace_string="\/\/\1" --target_file="$config_file" @@ -255,6 +256,7 @@ apply_config() { then ynh_use_nodejs pushd "$final_path" + ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$mypads" = "1" ] then npm install ep_mypads@${mypads_version} @@ -269,8 +271,8 @@ apply_config() { restart_etherpad=1 fi - # Ldap for Mypads - if [ "$useldap" != "$old_useldap" ] + # LDAP for MyPads + if [ "$useldap" != "$old_useldap" ] then if [ "$useldap" = "1" ] then From 3dc9ab4937d385b16d1e1c03a554af9f95a74538 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 23:00:59 +0100 Subject: [PATCH 11/48] Fix --- conf/systemd.service | 9 +++++++++ scripts/actions/reset_default_config | 2 +- scripts/change_url | 2 +- scripts/config | 2 +- scripts/install | 6 +++--- scripts/restore | 2 +- scripts/upgrade | 6 ++++-- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 645f210..66cfd37 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,16 @@ WorkingDirectory=__FINALPATH__ Environment=NODE_ENV=production Environment="__YNH_NODE_LOAD_PATH__" ExecStart=__FINALPATH__/src/bin/run.sh +StandardOutput=append:/var/log/__APP__/etherpad.log +StandardError=inherit Restart=always +PrivateDevices=true +ProtectControlGroups=true +ProtectHome=true +ProtectKernelTunables=true +ProtectSystem=full +RestrictSUIDSGID=true + [Install] WantedBy=multi-user.target diff --git a/scripts/actions/reset_default_config b/scripts/actions/reset_default_config index d1404e7..19936da 100755 --- a/scripts/actions/reset_default_config +++ b/scripts/actions/reset_default_config @@ -87,7 +87,7 @@ ynh_store_file_checksum --file="$config_file" ynh_script_progression --message="Restarting Etherpad..." --weight=9 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 172752c..b3954a7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -130,7 +130,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=10 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE diff --git a/scripts/config b/scripts/config index 4d7a27d..a231fe9 100644 --- a/scripts/config +++ b/scripts/config @@ -290,7 +290,7 @@ apply_config() { if [ $restart_etherpad -eq 1 ] then # Wait for etherpad to be fully started - ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" + ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" fi #================================================= diff --git a/scripts/install b/scripts/install index c41ae94..a87f067 100644 --- a/scripts/install +++ b/scripts/install @@ -222,7 +222,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/etherpad.log" +yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/etherpad.log" #================================================= # INSTALL FRAMAPAD'S PLUGINS @@ -315,7 +315,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=20 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" if [ $mypads -eq 1 ] then @@ -323,7 +323,7 @@ then mysql -u $db_name -p$db_pwd $db_name < "../conf/lang_mypads.sql" # Wait for etherpad to be fully started - ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" + ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" fi #================================================= diff --git a/scripts/restore b/scripts/restore index 266deaf..7ea3d2f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -173,7 +173,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=8 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE diff --git a/scripts/upgrade b/scripts/upgrade index af77c10..d04b8b8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_ #================================================= # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" upgrade_type=$(ynh_check_app_version_changed) @@ -188,6 +188,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=4 + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" fi @@ -394,7 +396,7 @@ ynh_systemd_action --action=reload --service_name=nginx ynh_script_progression --message="Restarting Etherpad..." --weight=9 # Wait for etherpad to be fully started -ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="systemd" --timeout="120" +ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" #================================================= # DEACTIVE MAINTENANCE MODE From dbe5603e4b157fef28841bb37a67a4eb42ec4ff5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 23:27:54 +0100 Subject: [PATCH 12/48] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index a87f067..aa72600 100644 --- a/scripts/install +++ b/scripts/install @@ -279,7 +279,7 @@ then # Find the /div just after the field to open a pad mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) # In order to add a link to mypads plugin. - sed -i "$mod_line s@div>@&\n\t

Mypads
@" $final_path/src/templates/index.html + sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html fi #================================================= From 650bc45dae0dc382e55f6736540943fc5e0c8922 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Mar 2021 23:43:07 +0100 Subject: [PATCH 13/48] Update CHANGELOG.md --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 691cfab..08cac69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,21 @@ Changelog ========= +## [1.8.13~ynh1]() - 2021-03-22 + +#### Changed +* [Upgrade to 1.8.13]() +* [Upgrade NodeJS to 14]() +* [Update to MyPads 1.7.19]() +* [Upgrade plugins to upstream]() +* [Set new permissions] + +#### Added +* [ep_countable plugin (working again)]() + +#### Disabled +* [ep_page_view plugin (now part of the core)]() + ## [1.8.4~ynh1](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/pull/105) - 2020-08-09 #### Changed From a7a9c44193b6cf9346d2cc70ce7f508ba1467d40 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 10:16:03 +0100 Subject: [PATCH 14/48] Fix --- CHANGELOG.md | 15 ++++++++------- conf/systemd.service | 11 +++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08cac69..77ec8f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,17 +4,18 @@ Changelog ## [1.8.13~ynh1]() - 2021-03-22 #### Changed -* [Upgrade to 1.8.13]() -* [Upgrade NodeJS to 14]() -* [Update to MyPads 1.7.19]() -* [Upgrade plugins to upstream]() -* [Set new permissions] +* [Upgrade to 1.8.13](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/9684b59824b18ea781efb8a26df5d7c3d51a8264) +* [Upgrade NodeJS to 14](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) +* [Update to MyPads 1.7.19](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) +* [Upgrade plugins to upstream](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) +* [Use new permission system](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) +* [Set YunoHost requirements to 4.1.7](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) #### Added -* [ep_countable plugin (working again)]() +* [ep_countable plugin (working again)](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) #### Disabled -* [ep_page_view plugin (now part of the core)]() +* [ep_page_view plugin (now part of the core)](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/def10182c0d7e7aa8a9123e3606203fbd37a20ea) ## [1.8.4~ynh1](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/pull/105) - 2020-08-09 diff --git a/conf/systemd.service b/conf/systemd.service index 66cfd37..f2a54ed 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -14,12 +14,11 @@ StandardOutput=append:/var/log/__APP__/etherpad.log StandardError=inherit Restart=always -PrivateDevices=true -ProtectControlGroups=true -ProtectHome=true -ProtectKernelTunables=true -ProtectSystem=full -RestrictSUIDSGID=true +#PrivateDevices=true +#ProtectControlGroups=true +#ProtectHome=true +#ProtectKernelTunables=true +#ProtectSystem=full [Install] WantedBy=multi-user.target From 0074340c1b383db8b84e309cb3b75a546c74d442 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 10:58:56 +0100 Subject: [PATCH 15/48] Fix --- CHANGELOG.md | 2 +- scripts/upgrade | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77ec8f5..b9bca72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ Changelog ========= -## [1.8.13~ynh1]() - 2021-03-22 +## [1.8.13~ynh1]() - 2021-03-23 #### Changed * [Upgrade to 1.8.13](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/9684b59824b18ea781efb8a26df5d7c3d51a8264) diff --git a/scripts/upgrade b/scripts/upgrade index d04b8b8..555a088 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -229,6 +229,8 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Upgrading Etherpad npm modules..." --weight=60 # Then update the additionnal modules +chown -R $app: $final_path + pushd $final_path ynh_use_nodejs ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh From 8128ac54176839750cc0012c68d2c7b3421570d3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 11:12:09 +0100 Subject: [PATCH 16/48] remove action public_private --- actions.toml | 26 +++++------ check_process | 2 +- config_panel.toml | 14 +++--- scripts/actions/public_private | 80 ---------------------------------- scripts/config | 30 ++++++------- 5 files changed, 36 insertions(+), 116 deletions(-) delete mode 100755 scripts/actions/public_private diff --git a/actions.toml b/actions.toml index 0273bb8..75b4cf9 100644 --- a/actions.toml +++ b/actions.toml @@ -34,17 +34,17 @@ command = "/bin/bash scripts/actions/reset_default_config \"settings.json\"" accepted_return_codes = [0] description = "Reset the config file settings.json." -[public_private] -name = "Move to public or private" -command = "/bin/bash scripts/actions/public_private" -# user = "root" # optional -# cwd = "/" # optional -# accepted_return_codes = [0, 1, 2, 3] # optional -accepted_return_codes = [0] -description = "Change the public access of the app." +# [public_private] +# name = "Move to public or private" +# command = "/bin/bash scripts/actions/public_private" +# # user = "root" # optional +# # cwd = "/" # optional +# # accepted_return_codes = [0, 1, 2, 3] # optional +# accepted_return_codes = [0] +# description = "Change the public access of the app." - [public_private.arguments] - [public_private.arguments.is_public] - type = "boolean" - ask = "Is it a public app?" - default = true +# [public_private.arguments] +# [public_private.arguments.is_public] +# type = "boolean" +# ask = "Is it a public app?" +# default = true diff --git a/check_process b/check_process index 5ea099e..9e83d55 100644 --- a/check_process +++ b/check_process @@ -21,7 +21,7 @@ main.pad_configuration.pad_config_automatic_logout=0|1 main.mypads_configuration.mypads=0|1 main.mypads_configuration.useldap=0|1 - main.is_public.is_public=1|0 + #main.is_public.is_public=1|0 main.overwrite_files.overwrite_settings=0|1 main.overwrite_files.overwrite_credentials=0|1 main.overwrite_files.overwrite_nginx=0|1 diff --git a/config_panel.toml b/config_panel.toml index 7561980..2a5dd93 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -62,14 +62,14 @@ name = "Etherpad configuration" default = true - [main.is_public] - name = "Public access" + # [main.is_public] + # name = "Public access" - [main.is_public.is_public] - ask = "Is it a public website?" - type = "boolean" - default = true - help = "If your Etherpad instance is public, everyone will be able to create a pad or see an existing one." + # [main.is_public.is_public] + # ask = "Is it a public website?" + # type = "boolean" + # default = true + # help = "If your Etherpad instance is public, everyone will be able to create a pad or see an existing one." [main.overwrite_files] diff --git a/scripts/actions/public_private b/scripts/actions/public_private deleted file mode 100755 index 39d6d3b..0000000 --- a/scripts/actions/public_private +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source /usr/share/yunohost/helpers - -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -# Get is_public -is_public=${YNH_ACTION_IS_PUBLIC} - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF ARGUMENTS ARE CORRECT -#================================================= - -#================================================= -# CHECK IF AN ACTION HAS TO BE DONE -#================================================= - -is_public_old=$(ynh_app_setting_get --app=$app --key=is_public) - -if [ $is_public -eq $is_public_old ] -then - ynh_die --message="is_public is already set as $is_public." --ret_code=0 -fi - -#================================================= -# SPECIFIC ACTION -#================================================= -# MOVE TO PUBLIC OR PRIVATE -#================================================= - -if [ $is_public -eq 0 ]; then - public_private="private" -else - public_private="public" -fi -ynh_script_progression --message="Moving the application to $public_private..." --weight=3 - -if [ $is_public -eq 0 ] -then - ynh_app_setting_set --app=$app --key=skipped_uris --value="/admin" # etherpad admin page doesn't support SSO... -else - ynh_app_setting_set --app=$app --key=skipped_uris --value="/" -fi - -ynh_script_progression --message="Upgrading SSOwat configuration..." -# Regen ssowat configuration -yunohost app ssowatconf - -# Update the config of the app -ynh_app_setting_set --app=$app --key=is_public --value=$is_public - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." - -ynh_systemd_action --service_name=nginx --action=reload - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last diff --git a/scripts/config b/scripts/config index a231fe9..4d4f02c 100644 --- a/scripts/config +++ b/scripts/config @@ -89,7 +89,7 @@ else fi mypads="${YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS:-$old_mypads}" -# Ldap for MyPads +# LDAP for MyPads if grep -q "//noldap" $config_file then # Disable @@ -100,9 +100,9 @@ else fi useldap="${YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP:-$old_useldap}" -# is_public -old_is_public="$(ynh_app_setting_get --app=$app --key=is_public)" -is_public="${YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC:-$old_is_public}" +# # is_public +# old_is_public="$(ynh_app_setting_get --app=$app --key=is_public)" +# is_public="${YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC:-$old_is_public}" # Overwrite settings.json file old_overwrite_settings="$(ynh_app_setting_get --app=$app --key=overwrite_settings)" @@ -140,7 +140,7 @@ show_config() { ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS=$mypads" ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP=$useldap" - ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public" + #ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public" ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_SETTINGS=$overwrite_settings" ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_CREDENTIALS=$overwrite_credentials" @@ -297,16 +297,16 @@ apply_config() { # MODIFY PUBLIC ACCESSIBILITY #================================================= - # Change public accessibility - if [ "$is_public" != "$old_is_public" ] - then - if [ "$is_public" = "1" ] - then - yunohost app action run $app public_private --args is_public=1 - else - yunohost app action run $app public_private --args is_public=0 - fi - fi + # # Change public accessibility + # if [ "$is_public" != "$old_is_public" ] + # then + # if [ "$is_public" = "1" ] + # then + # yunohost app action run $app public_private --args is_public=1 + # else + # yunohost app action run $app public_private --args is_public=0 + # fi + # fi #================================================= # MODIFY OVERWRITTING SETTINGS From f57b6f49354814449a8590fdee759124e72897f5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 11:30:11 +0100 Subject: [PATCH 17/48] Fix --- actions.toml | 15 --------------- check_process | 1 - config_panel.toml | 12 +----------- scripts/config | 23 ++--------------------- 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/actions.toml b/actions.toml index 75b4cf9..e80eab8 100644 --- a/actions.toml +++ b/actions.toml @@ -33,18 +33,3 @@ command = "/bin/bash scripts/actions/reset_default_config \"settings.json\"" # accepted_return_codes = [0, 1, 2, 3] # optional accepted_return_codes = [0] description = "Reset the config file settings.json." - -# [public_private] -# name = "Move to public or private" -# command = "/bin/bash scripts/actions/public_private" -# # user = "root" # optional -# # cwd = "/" # optional -# # accepted_return_codes = [0, 1, 2, 3] # optional -# accepted_return_codes = [0] -# description = "Change the public access of the app." - -# [public_private.arguments] -# [public_private.arguments.is_public] -# type = "boolean" -# ask = "Is it a public app?" -# default = true diff --git a/check_process b/check_process index 9e83d55..85976fe 100644 --- a/check_process +++ b/check_process @@ -21,7 +21,6 @@ main.pad_configuration.pad_config_automatic_logout=0|1 main.mypads_configuration.mypads=0|1 main.mypads_configuration.useldap=0|1 - #main.is_public.is_public=1|0 main.overwrite_files.overwrite_settings=0|1 main.overwrite_files.overwrite_credentials=0|1 main.overwrite_files.overwrite_nginx=0|1 diff --git a/config_panel.toml b/config_panel.toml index 2a5dd93..631ba72 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -49,7 +49,7 @@ name = "Etherpad configuration" [main.mypads_configuration] - name = "Mypads configuration" + name = "MyPads configuration" [main.mypads_configuration.mypads] ask = "Enable MyPads plugin?" @@ -62,16 +62,6 @@ name = "Etherpad configuration" default = true - # [main.is_public] - # name = "Public access" - - # [main.is_public.is_public] - # ask = "Is it a public website?" - # type = "boolean" - # default = true - # help = "If your Etherpad instance is public, everyone will be able to create a pad or see an existing one." - - [main.overwrite_files] name = "Overwriting config files during an upgrade" diff --git a/scripts/config b/scripts/config index 4d4f02c..44e0926 100644 --- a/scripts/config +++ b/scripts/config @@ -100,10 +100,6 @@ else fi useldap="${YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP:-$old_useldap}" -# # is_public -# old_is_public="$(ynh_app_setting_get --app=$app --key=is_public)" -# is_public="${YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC:-$old_is_public}" - # Overwrite settings.json file old_overwrite_settings="$(ynh_app_setting_get --app=$app --key=overwrite_settings)" overwrite_settings="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_SETTINGS:-$old_overwrite_settings}" @@ -205,7 +201,7 @@ apply_config() { if [ "$pad_config_automatic_logout" != "$old_pad_config_automatic_logout" ] then ynh_use_nodejs - pushd "$final_path" + pushd "$final_path/src" ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$pad_config_automatic_logout" = "0" ] then @@ -255,7 +251,7 @@ apply_config() { if [ "$mypads" != "$old_mypads" ] then ynh_use_nodejs - pushd "$final_path" + pushd "$final_path/src" ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$mypads" = "1" ] then @@ -293,21 +289,6 @@ apply_config() { ynh_systemd_action --action=restart --line_match="You can access your Etherpad instance at" --log_path="/var/log/$app/etherpad.log" --timeout="120" fi - #================================================= - # MODIFY PUBLIC ACCESSIBILITY - #================================================= - - # # Change public accessibility - # if [ "$is_public" != "$old_is_public" ] - # then - # if [ "$is_public" = "1" ] - # then - # yunohost app action run $app public_private --args is_public=1 - # else - # yunohost app action run $app public_private --args is_public=0 - # fi - # fi - #================================================= # MODIFY OVERWRITTING SETTINGS #================================================= From 09916b614efa909efc3ec111c62eb0d2f0119c85 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 11:47:15 +0100 Subject: [PATCH 18/48] Remove multi_instance installation --- check_process | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 85976fe..285af8f 100644 --- a/check_process +++ b/check_process @@ -34,7 +34,7 @@ setup_public=1 upgrade=1 backup_restore=1 - multi_instance=1 + multi_instance=0 change_url=1 actions=1 config_panel=1 diff --git a/manifest.json b/manifest.json index 9e7d0dd..5288aec 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "requirements": { "yunohost": ">= 4.1.7" }, - "multi_instance": true, + "multi_instance": false, "services": [ "nginx", "mysql" From 327696200cf8e239581d05906b67861d96994f9a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 15:28:49 +0100 Subject: [PATCH 19/48] Update config --- scripts/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/config b/scripts/config index 44e0926..d75ba13 100644 --- a/scripts/config +++ b/scripts/config @@ -201,6 +201,7 @@ apply_config() { if [ "$pad_config_automatic_logout" != "$old_pad_config_automatic_logout" ] then ynh_use_nodejs + chown -R $app: $final_path pushd "$final_path/src" ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$pad_config_automatic_logout" = "0" ] @@ -251,6 +252,7 @@ apply_config() { if [ "$mypads" != "$old_mypads" ] then ynh_use_nodejs + chown -R $app: $final_path pushd "$final_path/src" ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$mypads" = "1" ] From 8a05956b81c08535d7db7f2eea3c17812e75b9cb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 23 Mar 2021 21:41:01 +0100 Subject: [PATCH 20/48] Fix --- scripts/_variables | 2 +- scripts/config | 14 ++++---------- scripts/upgrade | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/_variables b/scripts/_variables index 063a5f7..e7b1ac2 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -17,7 +17,7 @@ mypads_version=1.7.19 ep_align_version=0.3.31 ep_author_hover_version=0.3.17 ep_automatic_logut_version=1.0.8 -ep_comments_page_version=0.1.58 +ep_comments_page_version=0.1.59 ep_countable_version=0.0.9 ep_delete_empty_pads_version=0.0.7 ep_font_color_version=0.0.40 diff --git a/scripts/config b/scripts/config index d75ba13..d814acc 100644 --- a/scripts/config +++ b/scripts/config @@ -132,12 +132,8 @@ show_config() { ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_ALWAYSSHOWCHAT=$pad_config_alwaysshowchat" ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_SHOW_MARKDOWN=$pad_config_show_markdown" ynh_return "YNH_CONFIG_MAIN_PAD_CONFIGURATION_PAD_CONFIG_AUTOMATIC_LOGOUT=$pad_config_automatic_logout" - ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_MYPADS=$mypads" ynh_return "YNH_CONFIG_MAIN_MYPADS_CONFIGURATION_USELDAP=$useldap" - - #ynh_return "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public" - ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_SETTINGS=$overwrite_settings" ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_CREDENTIALS=$overwrite_credentials" ynh_return "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx" @@ -201,16 +197,15 @@ apply_config() { if [ "$pad_config_automatic_logout" != "$old_pad_config_automatic_logout" ] then ynh_use_nodejs - chown -R $app: $final_path pushd "$final_path/src" ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$pad_config_automatic_logout" = "0" ] then ynh_replace_string --match_string="^\(.*\"automatic_logut.*$\)" --replace_string="\/\/\1" --target_file="$config_file" - npm uninstall ep_automatic_logut + ynh_exec_as $app env "$ynh_node_load_PATH" npm uninstall ep_automatic_logut else ynh_replace_string --match_string="^\/\/\(.*\"automatic_logut.*$\)" --replace_string="\1" --target_file="$config_file" - npm install ep_automatic_logut@${ep_automatic_logut_version} + ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_automatic_logut@${ep_automatic_logut_version} fi popd chown -R $app: $final_path/node_modules @@ -252,14 +247,13 @@ apply_config() { if [ "$mypads" != "$old_mypads" ] then ynh_use_nodejs - chown -R $app: $final_path pushd "$final_path/src" ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$mypads" = "1" ] then - npm install ep_mypads@${mypads_version} + ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_mypads@${mypads_version} else - npm uninstall ep_mypads + ynh_exec_as $app env "$ynh_node_load_PATH" npm uninstall ep_mypads fi popd chown -R $app: $final_path/node_modules diff --git a/scripts/upgrade b/scripts/upgrade index 555a088..56b7d19 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -336,8 +336,8 @@ fi # Set files ownership to etherpad chown -R $app: $final_path -chmod 600 "$final_path/credentials.json" # Restrict access to credentials.json +chmod 600 "$final_path/credentials.json" chown $app -R /var/log/$app/etherpad.log #================================================= From 78c922492917e5ad4b7f4bcbf11b9618c4c90360 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 09:01:59 +0100 Subject: [PATCH 21/48] Update upgrade --- scripts/upgrade | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 56b7d19..979630f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -188,10 +188,22 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=4 + # Create a temporary directory + tmpdir="$(mktemp -d)" + # Backup the config file in the temp dir + cp -a "$final_path/settings.json" "$tmpdir/settings.json" + ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + # Copy the admin saved settings from tmp directory to final config path + cp -a "$tmpdir/settings.json" "$final_path/settings.json" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" + fi #================================================= From 6ba8b0608c2417b6f583e98c0b5534238a50d6d5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 12:04:53 +0100 Subject: [PATCH 22/48] Add permissions --- scripts/install | 3 ++- scripts/restore | 1 + scripts/upgrade | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index aa72600..5322536 100644 --- a/scripts/install +++ b/scripts/install @@ -206,7 +206,8 @@ ynh_add_config --template="../conf/credentials.json" --destination="$final_path/ #================================================= # Set files ownership to etherpad -chown -R $app: $final_path +chown -R $app:$app $final_path +chmod o-rwx $final_path # Restrict access to credentials.json chmod 600 $final_path/credentials.json diff --git a/scripts/restore b/scripts/restore index 7ea3d2f..80e93f4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -136,6 +136,7 @@ ynh_exec_warn_less npm cache clean --force # Restore permissions on app files chown -R $app: $final_path +chmod o-rwx $final_path #================================================= # ADVERTISE SERVICE IN ADMIN PANEL diff --git a/scripts/upgrade b/scripts/upgrade index 979630f..717695a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -348,6 +348,7 @@ fi # Set files ownership to etherpad chown -R $app: $final_path +chmod o-rwx $final_path # Restrict access to credentials.json chmod 600 "$final_path/credentials.json" chown $app -R /var/log/$app/etherpad.log From b8d31a16062b833254376432ea3ece05dc31de9f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 14:39:37 +0100 Subject: [PATCH 23/48] Fix --- scripts/actions/add_remove_abiword | 2 +- scripts/actions/add_remove_libreoffice | 2 +- scripts/config | 8 ++++---- scripts/remove | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/actions/add_remove_abiword b/scripts/actions/add_remove_abiword index 891ab94..24622ee 100755 --- a/scripts/actions/add_remove_abiword +++ b/scripts/actions/add_remove_abiword @@ -84,7 +84,7 @@ fi # Rebuild the meta package and install the new dependencies ( cd scripts # Move to scripts directory to allow the helper to find the manifest where it expects to find it. -ynh_install_app_dependencies $dependencies) +ynh_exec_warn_less ynh_install_app_dependencies $dependencies) # Remove all unused dependencies ynh_package_autopurge diff --git a/scripts/actions/add_remove_libreoffice b/scripts/actions/add_remove_libreoffice index 5335985..24bc7dd 100755 --- a/scripts/actions/add_remove_libreoffice +++ b/scripts/actions/add_remove_libreoffice @@ -84,7 +84,7 @@ fi # Rebuild the meta package and install the new dependencies ( cd scripts # Move to scripts directory to allow the helper to find the manifest where it expects to find it. -ynh_install_app_dependencies $dependencies) +ynh_exec_warn_less ynh_install_app_dependencies $dependencies) # Remove all unused dependencies ynh_package_autopurge diff --git a/scripts/config b/scripts/config index d814acc..41f406d 100644 --- a/scripts/config +++ b/scripts/config @@ -197,8 +197,8 @@ apply_config() { if [ "$pad_config_automatic_logout" != "$old_pad_config_automatic_logout" ] then ynh_use_nodejs - pushd "$final_path/src" - ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory + #pushd "$final_path/src" + #ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$pad_config_automatic_logout" = "0" ] then ynh_replace_string --match_string="^\(.*\"automatic_logut.*$\)" --replace_string="\/\/\1" --target_file="$config_file" @@ -247,8 +247,8 @@ apply_config() { if [ "$mypads" != "$old_mypads" ] then ynh_use_nodejs - pushd "$final_path/src" - ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory + #pushd "$final_path/src" + #ynh_secure_remove --file="$final_path/src/package-lock.json" #added to fix saveError ENOENT: no such file or directory if [ "$mypads" = "1" ] then ynh_exec_as $app env "$ynh_node_load_PATH" npm install ep_mypads@${mypads_version} diff --git a/scripts/remove b/scripts/remove index 60f8e32..f7bf183 100755 --- a/scripts/remove +++ b/scripts/remove @@ -50,7 +50,7 @@ if [ "$export" != "none" ] then ynh_script_progression --message="Removing dependencies..." --weight=60 # Remove metapackage and its dependencies - ynh_remove_app_dependencies + ynh_exec_warn_less ynh_remove_app_dependencies fi #================================================= From 3f96954a5cfd769d3d327176a1eba92bc4bad5b2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 18:30:50 +0100 Subject: [PATCH 24/48] Silence warnings --- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 5322536..e6eba05 100644 --- a/scripts/install +++ b/scripts/install @@ -92,9 +92,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." --weight=120 if [ "$export" = "abiword" ]; then - ynh_install_app_dependencies $abiword_app_depencencies + ynh_exec_warn_less ynh_install_app_dependencies $abiword_app_depencencies elif [ "$export" = "libreoffice" ]; then - ynh_install_app_dependencies $libreoffice_app_dependencies + ynh_exec_warn_less ynh_install_app_dependencies $libreoffice_app_dependencies fi #================================================= diff --git a/scripts/restore b/scripts/restore index 80e93f4..e037cda 100644 --- a/scripts/restore +++ b/scripts/restore @@ -110,9 +110,9 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_script_progression --message="Reinstalling dependencies..." --weight=60 if [ "$export" = "abiword" ]; then - ynh_install_app_dependencies $abiword_app_depencencies + ynh_exec_warn_less ynh_install_app_dependencies $abiword_app_depencencies elif [ "$export" = "libreoffice" ]; then - ynh_install_app_dependencies $libreoffice_app_dependencies + ynh_exec_warn_less ynh_install_app_dependencies $libreoffice_app_dependencies fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 717695a..b0122e3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -212,9 +212,9 @@ fi ynh_script_progression --message="Upgrading dependencies..." --weight=5 if [ "$export" = "abiword" ]; then - ynh_install_app_dependencies $abiword_app_depencencies + ynh_exec_warn_less ynh_install_app_dependencies $abiword_app_depencencies elif [ "$export" = "libreoffice" ]; then - ynh_install_app_dependencies $libreoffice_app_dependencies + ynh_exec_warn_less ynh_install_app_dependencies $libreoffice_app_dependencies fi #================================================= From 9ebe46347eea33a5d3b5e7b2510e289927f6d9ed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 19:33:03 +0100 Subject: [PATCH 25/48] Update upgrade --- scripts/upgrade | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b0122e3..47428fd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -188,21 +188,21 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=4 - # Create a temporary directory - tmpdir="$(mktemp -d)" - # Backup the config file in the temp dir - cp -a "$final_path/settings.json" "$tmpdir/settings.json" + # # Create a temporary directory + # tmpdir="$(mktemp -d)" + # # Backup the config file in the temp dir + # cp -a "$final_path/settings.json" "$tmpdir/settings.json" - ynh_secure_remove --file="$final_path" + # ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" - # Copy the admin saved settings from tmp directory to final config path - cp -a "$tmpdir/settings.json" "$final_path/settings.json" + # # Copy the admin saved settings from tmp directory to final config path + # cp -a "$tmpdir/settings.json" "$final_path/settings.json" - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + # # Remove the tmp directory securely + # ynh_secure_remove --file="$tmpdir" fi From 4717d3212b89d68fe91f4a662bbc8c88f52a6ed6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 19:39:55 +0100 Subject: [PATCH 26/48] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 47428fd..996597b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -193,7 +193,7 @@ then # # Backup the config file in the temp dir # cp -a "$final_path/settings.json" "$tmpdir/settings.json" - # ynh_secure_remove --file="$final_path" + ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" From da81b6f25a196a74133f91a6c9f430b5a88549b9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 24 Mar 2021 21:42:02 +0100 Subject: [PATCH 27/48] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e6eba05..1eecedf 100644 --- a/scripts/install +++ b/scripts/install @@ -240,7 +240,7 @@ npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>& # Framapad - Adds comments on sidebar and link it to the text. npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 # Framapad - Displays paragraphs, sentences, words and characters counts. -npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 +#npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 # Framapad - Delete pads which were never edited npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 # Framapad - Apply colors to fonts From 3b0fda0002701ff6488d18616031e97f57f6c1bb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Apr 2021 23:22:07 +0200 Subject: [PATCH 28/48] Update _variables --- scripts/_variables | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/_variables b/scripts/_variables index e7b1ac2..aa06a24 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -14,17 +14,17 @@ nodejs_version=14 mypads_version=1.7.19 # Plugin versions -ep_align_version=0.3.31 -ep_author_hover_version=0.3.17 +ep_align_version=0.3.32 +ep_author_hover_version=0.3.18 ep_automatic_logut_version=1.0.8 -ep_comments_page_version=0.1.59 +ep_comments_page_version=0.1.60 ep_countable_version=0.0.9 ep_delete_empty_pads_version=0.0.7 -ep_font_color_version=0.0.40 -ep_headings2_version=0.2.26 -ep_markdown_version=0.1.30 +ep_font_color_version=0.0.41 +ep_headings2_version=0.2.27 +ep_markdown_version=0.1.31 ep_page_view_version=0.5.24 -ep_spellcheck_version=0.0.25 -ep_subscript_and_superscript_version=0.2.22 -ep_table_of_contents_version=0.3.18 -ep_font_size_version=0.4.19 +ep_spellcheck_version=0.0.26 +ep_subscript_and_superscript_version=0.2.23 +ep_table_of_contents_version=0.3.19 +ep_font_size_version=0.4.21 From e8b86d1835f47219a9fd3a6735f6f95356bc0d28 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 23 Apr 2021 23:49:28 +0200 Subject: [PATCH 29/48] Update _variables --- scripts/_variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_variables b/scripts/_variables index aa06a24..483a4d3 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -11,7 +11,7 @@ nodejs_version=14 # MyPads version # This variable is mostly used to force an upgrade of the package in case of new versions of MyPads. -mypads_version=1.7.19 +mypads_version=1.7.20 # Plugin versions ep_align_version=0.3.32 From 912daa7e1e5afa0cc0a397778efae5d706293092 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 29 Apr 2021 19:34:40 +0200 Subject: [PATCH 30/48] Update _variables --- scripts/_variables | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/_variables b/scripts/_variables index 483a4d3..be97fdf 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -14,17 +14,17 @@ nodejs_version=14 mypads_version=1.7.20 # Plugin versions -ep_align_version=0.3.32 +ep_align_version=0.3.33 ep_author_hover_version=0.3.18 ep_automatic_logut_version=1.0.8 ep_comments_page_version=0.1.60 -ep_countable_version=0.0.9 +ep_countable_version=0.0.11 ep_delete_empty_pads_version=0.0.7 ep_font_color_version=0.0.41 ep_headings2_version=0.2.27 ep_markdown_version=0.1.31 ep_page_view_version=0.5.24 ep_spellcheck_version=0.0.26 -ep_subscript_and_superscript_version=0.2.23 +ep_subscript_and_superscript_version=0.2.26 ep_table_of_contents_version=0.3.19 ep_font_size_version=0.4.21 From a258539bfa8fa5c466fc473451add340c9e09d50 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 29 Apr 2021 19:46:13 +0200 Subject: [PATCH 31/48] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9bca72..3f9f69b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Changelog #### Changed * [Upgrade to 1.8.13](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/9684b59824b18ea781efb8a26df5d7c3d51a8264) * [Upgrade NodeJS to 14](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) -* [Update to MyPads 1.7.19](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) +* [Update to MyPads 1.7.20]() * [Upgrade plugins to upstream](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) * [Use new permission system](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) * [Set YunoHost requirements to 4.1.7](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) From 2b3e4fcc44014d70bcc3d1bc1d261797ef207a10 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 29 Apr 2021 19:46:47 +0200 Subject: [PATCH 32/48] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1eecedf..e6eba05 100644 --- a/scripts/install +++ b/scripts/install @@ -240,7 +240,7 @@ npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>& # Framapad - Adds comments on sidebar and link it to the text. npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 # Framapad - Displays paragraphs, sentences, words and characters counts. -#npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 +npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 # Framapad - Delete pads which were never edited npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 # Framapad - Apply colors to fonts From 7a1639e1d94b58f4755816416f22a8b5012d775e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 19:42:16 +0200 Subject: [PATCH 33/48] Upgrade plugins --- README.md | 6 +++--- README_fr.md | 6 +++--- scripts/_variables | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8c12a5e..79dc6fc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allow you to install Etherpad quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.* ## Overview Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time. @@ -43,8 +43,8 @@ You can also find a configuration file for Etherpad at this path `/var/www/ether #### Supported architectures -* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/) -* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/) +* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/) +* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/) ## Limitations diff --git a/README_fr.md b/README_fr.md index fba0ca7..f1d4c03 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,7 +6,7 @@ *[Read this readme in english.](./README.md)* > *Ce package vous permet d'installer Etherpad rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.* +Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/install_fr) pour savoir comment l'installer et en profiter.* ## Résumé Etherpad est un éditeur en ligne Open Source hautement personnalisable qui permet l'édition collaborative en temps réel. @@ -42,8 +42,8 @@ Vous pouvez accéder à deux panneaux d'administration différents, pour Etherpa #### Architectures supportées -* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/) -* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/) +* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/etherpad_mypads.svg)](https://ci-apps.yunohost.org/ci/apps/etherpad_mypads/) +* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/etherpad_mypads.svg)](https://ci-apps-arm.yunohost.org/ci/apps/etherpad_mypads/) ## Limitations diff --git a/scripts/_variables b/scripts/_variables index be97fdf..4d71ef6 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -14,17 +14,17 @@ nodejs_version=14 mypads_version=1.7.20 # Plugin versions -ep_align_version=0.3.33 -ep_author_hover_version=0.3.18 +ep_align_version=0.3.34 +ep_author_hover_version=0.3.19 ep_automatic_logut_version=1.0.8 ep_comments_page_version=0.1.60 ep_countable_version=0.0.11 ep_delete_empty_pads_version=0.0.7 -ep_font_color_version=0.0.41 +ep_font_color_version=0.0.42 ep_headings2_version=0.2.27 -ep_markdown_version=0.1.31 +ep_markdown_version=0.1.32 ep_page_view_version=0.5.24 -ep_spellcheck_version=0.0.26 +ep_spellcheck_version=0.0.27 ep_subscript_and_superscript_version=0.2.26 -ep_table_of_contents_version=0.3.19 -ep_font_size_version=0.4.21 +ep_table_of_contents_version=0.3.20 +ep_font_size_version=0.4.22 From bb5601ff35968d5e35737197cceb4c43843dd239 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 23:39:39 +0200 Subject: [PATCH 34/48] Update upgrade --- scripts/upgrade | 79 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 996597b..7082e99 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -247,28 +247,67 @@ pushd $final_path ynh_use_nodejs ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh #ynh_exec_warn_less npm cache clean --force -ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force -while read node_module -do - # Ignore ep_etherpad-lite, this part is updated before in this script. - if [ "$node_module" = "ep_etherpad-lite" ]; then - continue - fi - echo "Update $node_module" - # Build the name of the variable with the version. - module_version=${node_module}_version - # Get the content of the variable (from the file _variables) - module_version=${!module_version:-} - # If the module has no version stored in a variable into the file, keep it empty. - # That way, the upgrade will not be specific to a version. - ## Otherwise, add @ before the version number to force the upgrade to this version. - if [ -n "${module_version}" ]; then - module_version=@${module_version} - fi - ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade ${node_module}${module_version} || true -done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")" +# ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force +# while read node_module +# do +# # Ignore ep_etherpad-lite, this part is updated before in this script. +# if [ "$node_module" = "ep_etherpad-lite" ]; then +# continue +# fi +# echo "Update $node_module" +# # Build the name of the variable with the version. +# module_version=${node_module}_version +# # Get the content of the variable (from the file _variables) +# module_version=${!module_version:-} +# # If the module has no version stored in a variable into the file, keep it empty. +# # That way, the upgrade will not be specific to a version. +# ## Otherwise, add @ before the version number to force the upgrade to this version. +# if [ -n "${module_version}" ]; then +# module_version=@${module_version} +# fi +# ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm install --upgrade ${node_module}${module_version} || true +# done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")" popd +#================================================= +# INSTALL FRAMAPAD'S PLUGINS +#================================================= +ynh_script_progression --message="Installing Etherpad plugins..." --weight=90 + +pushd "$final_path" +# Add Left/Center/Right/Justify to lines of text in a pad +npm install ep_align@${ep_align_version} >> $install_log 2>&1 +# Framapad - Adds author names to span titles +npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 +# Automatically disconnects user after some period of time (Prevent server overload) +npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1 +# Framapad - Adds comments on sidebar and link it to the text. +npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 +# Framapad - Displays paragraphs, sentences, words and characters counts. +npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 +# Framapad - Delete pads which were never edited +npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 +# Framapad - Apply colors to fonts +npm install ep_font_color@${ep_font_color_version} >> $install_log 2>&1 +# Framapad - Adds heading support to Etherpad Lite. +npm install ep_headings2@${ep_headings2_version} >> $install_log 2>&1 +# Framapad - Edit and Export as Markdown in Etherpad +npm install ep_markdown@${ep_markdown_version} >> $install_log 2>&1 +if [ $mypads -eq 1 ]; then + # Framapad - Groups and private pads for etherpad + npm install ep_mypads@${mypads_version} >> $install_log 2>&1 +fi +# Framapad - Add support to do 'Spell checking' +npm install ep_spellcheck@${ep_spellcheck_version} >> $install_log 2>&1 +# Framapad - Add support for Subscript and Superscript +npm install ep_subscript_and_superscript@${ep_subscript_and_superscript_version} >> $install_log 2>&1 +# Framapad - View a table of contents for your pad +npm install ep_table_of_contents@${ep_table_of_contents_version} >> $install_log 2>&1 +# Framapad - User Pad Contents font size can be set in settings, this does not effect other peoples views +npm install ep_font_size@${ep_font_size_version} >> $install_log 2>&1 +popd +chown -R $app: $final_path/node_modules + #================================================= # SPECIFIC UPGRADE #================================================= From 13687edae78546d8a39eb664f9ef6646e2825c28 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 May 2021 23:43:21 +0200 Subject: [PATCH 35/48] Update upgrade --- scripts/upgrade | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7082e99..6479233 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ # Load common variables for all scripts. source _variables - source _common.sh source /usr/share/yunohost/helpers @@ -235,6 +234,16 @@ ynh_script_progression --message="Upgrading NodeJS..." --weight=4 ynh_install_nodejs --nodejs_version=$nodejs_version +#================================================= +# HANDLE LOG FILES AND LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." + +# Create log directory +install_log=/var/log/$app/installation.log +touch $install_log +chown $app -R /var/log/$app + #================================================= # UPGRADE NPM MODULES #================================================= From 7feb45a51688866450f58bb1f496d6dd17303633 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 2 May 2021 16:13:48 +0200 Subject: [PATCH 36/48] Update upgrade --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6479233..e1d564f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -247,7 +247,7 @@ chown $app -R /var/log/$app #================================================= # UPGRADE NPM MODULES #================================================= -ynh_script_progression --message="Upgrading Etherpad npm modules..." --weight=60 +ynh_script_progression --message="Upgrading Etherpad..." --weight=60 # Then update the additionnal modules chown -R $app: $final_path @@ -255,7 +255,7 @@ chown -R $app: $final_path pushd $final_path ynh_use_nodejs ynh_exec_as $app env "$ynh_node_load_PATH" src/bin/installDeps.sh -#ynh_exec_warn_less npm cache clean --force +# ynh_exec_warn_less npm cache clean --force # ynh_exec_warn_less ynh_exec_as $app env "$ynh_node_load_PATH" npm cache clean --force # while read node_module # do From 74acfa13ff4239dcca66b44d226f414647ee62bd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 2 May 2021 17:30:56 +0200 Subject: [PATCH 37/48] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index e1d564f..f4bb497 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -443,7 +443,7 @@ then # Find the /div just after the field to open a pad mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) # In order to add a link to mypads plugin. - sed -i "$mod_line s@div>@&\n\t

Mypads
@" $final_path/src/templates/index.html + sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html fi #================================================= From 67650253834c6316cc4bab4f7190cc5daec0ad69 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 May 2021 18:13:59 +0200 Subject: [PATCH 38/48] Update CHANGELOG.md --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c5effa..c1680dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,14 +8,10 @@ Changelog * [Upgrade NodeJS to 14](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) * [Update to MyPads 1.7.20]() * [Upgrade plugins to upstream](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/943ec31536dabe4f2146253f3e478598cdafe4bf) -* [Set YunoHost requirements to 4.1.7](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) #### Added * [ep_countable plugin (working again)](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/5d3ce9996e3f4d0812b000467e5ae2d9ee5416e0) -#### Disabled -* [ep_page_view plugin (now part of the core)](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/commit/def10182c0d7e7aa8a9123e3606203fbd37a20ea) - ## [1.8.4~ynh3](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/pull/133) - 2021-04-23 #### Changed From 8b8f0eac566b6dfedac31bcd4c6f8af382aa6888 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 May 2021 18:14:30 +0200 Subject: [PATCH 39/48] enable countable plugin --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 1eecedf..e6eba05 100644 --- a/scripts/install +++ b/scripts/install @@ -240,7 +240,7 @@ npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>& # Framapad - Adds comments on sidebar and link it to the text. npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 # Framapad - Displays paragraphs, sentences, words and characters counts. -#npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 +npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 # Framapad - Delete pads which were never edited npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 # Framapad - Apply colors to fonts From ca3ab3b7d48b0c8e01729eb46e930e6d973d475f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 May 2021 18:14:36 +0200 Subject: [PATCH 40/48] Update _variables --- scripts/_variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_variables b/scripts/_variables index 4d71ef6..e89bc02 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -21,7 +21,7 @@ ep_comments_page_version=0.1.60 ep_countable_version=0.0.11 ep_delete_empty_pads_version=0.0.7 ep_font_color_version=0.0.42 -ep_headings2_version=0.2.27 +ep_headings2_version=0.2.28 ep_markdown_version=0.1.32 ep_page_view_version=0.5.24 ep_spellcheck_version=0.0.27 From f9039099e36bb98379d466f7ababea329a0f32a7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 May 2021 21:02:17 +0200 Subject: [PATCH 41/48] Add ynh_npm --- check_process | 2 +- manifest.json | 2 +- scripts/install | 28 ++++++++++++++-------------- scripts/upgrade | 28 ++++++++++++++-------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/check_process b/check_process index 285af8f..85976fe 100644 --- a/check_process +++ b/check_process @@ -34,7 +34,7 @@ setup_public=1 upgrade=1 backup_restore=1 - multi_instance=0 + multi_instance=1 change_url=1 actions=1 config_panel=1 diff --git a/manifest.json b/manifest.json index 7cffa6e..7f318cf 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "requirements": { "yunohost": ">= 4.1.7" }, - "multi_instance": false, + "multi_instance": true, "services": [ "nginx", "mysql" diff --git a/scripts/install b/scripts/install index e6eba05..5c4cb22 100644 --- a/scripts/install +++ b/scripts/install @@ -232,35 +232,35 @@ ynh_script_progression --message="Installing Etherpad plugins..." --weight=90 pushd "$final_path" # Add Left/Center/Right/Justify to lines of text in a pad -npm install ep_align@${ep_align_version} >> $install_log 2>&1 +ynh_npm install ep_align@${ep_align_version} >> $install_log 2>&1 # Framapad - Adds author names to span titles -npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 +ynh_npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 # Automatically disconnects user after some period of time (Prevent server overload) -npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1 +ynh_npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1 # Framapad - Adds comments on sidebar and link it to the text. -npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 +ynh_npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 # Framapad - Displays paragraphs, sentences, words and characters counts. -npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 +ynh_npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 # Framapad - Delete pads which were never edited -npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 +ynh_npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 # Framapad - Apply colors to fonts -npm install ep_font_color@${ep_font_color_version} >> $install_log 2>&1 +ynh_npm install ep_font_color@${ep_font_color_version} >> $install_log 2>&1 # Framapad - Adds heading support to Etherpad Lite. -npm install ep_headings2@${ep_headings2_version} >> $install_log 2>&1 +ynh_npm install ep_headings2@${ep_headings2_version} >> $install_log 2>&1 # Framapad - Edit and Export as Markdown in Etherpad -npm install ep_markdown@${ep_markdown_version} >> $install_log 2>&1 +ynh_npm install ep_markdown@${ep_markdown_version} >> $install_log 2>&1 if [ $mypads -eq 1 ]; then # Framapad - Groups and private pads for etherpad - npm install ep_mypads@${mypads_version} >> $install_log 2>&1 + ynh_npm install ep_mypads@${mypads_version} >> $install_log 2>&1 fi # Framapad - Add support to do 'Spell checking' -npm install ep_spellcheck@${ep_spellcheck_version} >> $install_log 2>&1 +ynh_npm install ep_spellcheck@${ep_spellcheck_version} >> $install_log 2>&1 # Framapad - Add support for Subscript and Superscript -npm install ep_subscript_and_superscript@${ep_subscript_and_superscript_version} >> $install_log 2>&1 +ynh_npm install ep_subscript_and_superscript@${ep_subscript_and_superscript_version} >> $install_log 2>&1 # Framapad - View a table of contents for your pad -npm install ep_table_of_contents@${ep_table_of_contents_version} >> $install_log 2>&1 +ynh_npm install ep_table_of_contents@${ep_table_of_contents_version} >> $install_log 2>&1 # Framapad - User Pad Contents font size can be set in settings, this does not effect other peoples views -npm install ep_font_size@${ep_font_size_version} >> $install_log 2>&1 +ynh_npm install ep_font_size@${ep_font_size_version} >> $install_log 2>&1 popd chown -R $app: $final_path/node_modules diff --git a/scripts/upgrade b/scripts/upgrade index f4bb497..4b82926 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -285,35 +285,35 @@ ynh_script_progression --message="Installing Etherpad plugins..." --weight=90 pushd "$final_path" # Add Left/Center/Right/Justify to lines of text in a pad -npm install ep_align@${ep_align_version} >> $install_log 2>&1 +ynh_npm install ep_align@${ep_align_version} >> $install_log 2>&1 # Framapad - Adds author names to span titles -npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 +ynh_npm install ep_author_hover@${ep_author_hover_version} >> $install_log 2>&1 # Automatically disconnects user after some period of time (Prevent server overload) -npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1 +ynh_npm install ep_automatic_logut@${ep_automatic_logut_version} >> $install_log 2>&1 # Framapad - Adds comments on sidebar and link it to the text. -npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 +ynh_npm install ep_comments_page@${ep_comments_page_version} >> $install_log 2>&1 # Framapad - Displays paragraphs, sentences, words and characters counts. -npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 +ynh_npm install ep_countable@${ep_countable_version} >> $install_log 2>&1 # Framapad - Delete pads which were never edited -npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 +ynh_npm install ep_delete_empty_pads@${ep_delete_empty_pads_version} >> $install_log 2>&1 # Framapad - Apply colors to fonts -npm install ep_font_color@${ep_font_color_version} >> $install_log 2>&1 +ynh_npm install ep_font_color@${ep_font_color_version} >> $install_log 2>&1 # Framapad - Adds heading support to Etherpad Lite. -npm install ep_headings2@${ep_headings2_version} >> $install_log 2>&1 +ynh_npm install ep_headings2@${ep_headings2_version} >> $install_log 2>&1 # Framapad - Edit and Export as Markdown in Etherpad -npm install ep_markdown@${ep_markdown_version} >> $install_log 2>&1 +ynh_npm install ep_markdown@${ep_markdown_version} >> $install_log 2>&1 if [ $mypads -eq 1 ]; then # Framapad - Groups and private pads for etherpad - npm install ep_mypads@${mypads_version} >> $install_log 2>&1 + ynh_npm install ep_mypads@${mypads_version} >> $install_log 2>&1 fi # Framapad - Add support to do 'Spell checking' -npm install ep_spellcheck@${ep_spellcheck_version} >> $install_log 2>&1 +ynh_npm install ep_spellcheck@${ep_spellcheck_version} >> $install_log 2>&1 # Framapad - Add support for Subscript and Superscript -npm install ep_subscript_and_superscript@${ep_subscript_and_superscript_version} >> $install_log 2>&1 +ynh_npm install ep_subscript_and_superscript@${ep_subscript_and_superscript_version} >> $install_log 2>&1 # Framapad - View a table of contents for your pad -npm install ep_table_of_contents@${ep_table_of_contents_version} >> $install_log 2>&1 +ynh_npm install ep_table_of_contents@${ep_table_of_contents_version} >> $install_log 2>&1 # Framapad - User Pad Contents font size can be set in settings, this does not effect other peoples views -npm install ep_font_size@${ep_font_size_version} >> $install_log 2>&1 +ynh_npm install ep_font_size@${ep_font_size_version} >> $install_log 2>&1 popd chown -R $app: $final_path/node_modules From bef653b4d987ef4a0983c9dc528f1e6b1ae31588 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 May 2021 22:14:35 +0200 Subject: [PATCH 42/48] Fix --- scripts/install | 9 ++++++--- scripts/upgrade | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 5c4cb22..ad079eb 100644 --- a/scripts/install +++ b/scripts/install @@ -6,9 +6,12 @@ # IMPORT GENERIC HELPERS #================================================= +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + sleep 60 +fi + # Load common variables for all scripts. source _variables - source _common.sh source /usr/share/yunohost/helpers @@ -270,7 +273,7 @@ chown -R $app: $final_path/node_modules if [ $mypads -eq 1 ] then - # Add a link to etherpad to allow anonymous pads creation from Mypads. + # Add a link to Etherpad to allow anonymous pads creation from MyPads. ynh_replace_string --match_string="^ *\"DESCRIPTION\": .*" --replace_string="&Pads anonymes" --target_file=$final_path/node_modules/ep_mypads/static/l10n/fr.json ynh_replace_string --match_string="^ *\"DESCRIPTION\": .*" --replace_string="&Anonymous pads" --target_file=$final_path/node_modules/ep_mypads/static/l10n/en.json # And a link to etherpad admin from Mypads. @@ -288,7 +291,7 @@ fi #================================================= ynh_script_progression --message="Configuring Fail2Ban..." --weight=13 -# Create a dedicated fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=" .* .POST /mypads/api/auth/login HTTP/1.1. 400" --max_retry=5 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4b82926..6724a45 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -412,7 +412,7 @@ yunohost service add $app --description="Collaborative editor" --log="/var/log/$ #================================================= ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=8 -# Create a dedicated fail2ban config +# Create a dedicated Fail2Ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=" .* .POST /mypads/api/auth/login HTTP/1.1. 400" --max_retry=5 #================================================= From 2ee32ce4e36a575c21cd2b1477afa86fc53761a9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 4 May 2021 23:47:37 +0200 Subject: [PATCH 43/48] Update install --- scripts/install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index ad079eb..06a3063 100644 --- a/scripts/install +++ b/scripts/install @@ -281,9 +281,10 @@ then ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | Etherpad admin" --target_file=$final_path/node_modules/ep_mypads/static/l10n/fr.json # Find the /div just after the field to open a pad - mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) + #mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) # In order to add a link to mypads plugin. - sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html + #sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html + sed -i '157i

MyPads
' $final_path/src/templates/index.html fi #================================================= From 509199dcf8a0e3f363bad3b9690e62d480baf2dc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 5 May 2021 00:01:16 +0200 Subject: [PATCH 44/48] Fix triple mypads links --- scripts/install | 4 ++-- scripts/upgrade | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 06a3063..9399bc2 100644 --- a/scripts/install +++ b/scripts/install @@ -280,9 +280,9 @@ then ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | Etherpad admin" --target_file=$final_path/node_modules/ep_mypads/static/l10n/en.json ynh_replace_string --match_string="^ *\"FOOTER\": .*2.0" --replace_string="& | Etherpad admin" --target_file=$final_path/node_modules/ep_mypads/static/l10n/fr.json - # Find the /div just after the field to open a pad + ## Find the /div just after the field to open a pad #mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) - # In order to add a link to mypads plugin. + ## In order to add a link to MyPads plugin. #sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html sed -i '157i

MyPads
' $final_path/src/templates/index.html fi diff --git a/scripts/upgrade b/scripts/upgrade index 6724a45..8594965 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -440,10 +440,11 @@ fi if [ "$upgrade_type" == "UPGRADE_APP" ] && [ $mypads -eq 1 ] then - # Find the /div just after the field to open a pad - mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) - # In order to add a link to mypads plugin. - sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html + # # Find the /div just after the field to open a pad + # mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) + # # In order to add a link to mypads plugin. + # sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html + sed -i '157i

MyPads
' $final_path/src/templates/index.html fi #================================================= From 71a179ef95dbf441a49ed76481fad0ba49313e5e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 5 May 2021 08:26:29 +0200 Subject: [PATCH 45/48] Remove text-decoration --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9399bc2..b8f2f3b 100644 --- a/scripts/install +++ b/scripts/install @@ -284,7 +284,7 @@ then #mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) ## In order to add a link to MyPads plugin. #sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html - sed -i '157i

MyPads
' $final_path/src/templates/index.html + sed -i '157i

MyPads
' $final_path/src/templates/index.html fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8594965..91c6c14 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -444,7 +444,7 @@ then # mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) # # In order to add a link to mypads plugin. # sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html - sed -i '157i

MyPads
' $final_path/src/templates/index.html + sed -i '157i

MyPads
' $final_path/src/templates/index.html fi #================================================= From d7425cda38f199e086308ae482fc029c9b114902 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 5 May 2021 08:46:16 +0200 Subject: [PATCH 46/48] Do not send password by email --- scripts/install | 6 +----- scripts/remove | 2 +- scripts/restore | 4 ---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index b8f2f3b..f96a9f3 100644 --- a/scripts/install +++ b/scripts/install @@ -340,7 +340,7 @@ admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4) if [ $mypads -eq 1 ] then - Informations="You can access 2 different admin panels, for Etherpad by accessing https://$domain${path_url%/}/admin and for MyPads by accessing https://$domain${path_url%/}/mypads/?/admin." + Informations="You can access two different admin panels, for Etherpad by accessing https://$domain${path_url%/}/admin and for MyPads by accessing https://$domain${path_url%/}/mypads/?/admin." else Informations="You can access the admin panel by accessing https://$domain${path_url%/}/admin." fi @@ -349,10 +349,6 @@ ynh_print_OFF echo "$Informations You can also find a config file for Etherpad at this path /var/www/etherpad_mypads/settings.json. -Your credentials for the admin panel are: -- login : $admin -- password : $password - You can configure this app easily by using the experimental config-panel feature $admin_panel/config-panel. You can also find some specific actions for this app by using the experimental action feature $admin_panel/actions. diff --git a/scripts/remove b/scripts/remove index f7bf183..5378b48 100755 --- a/scripts/remove +++ b/scripts/remove @@ -97,7 +97,7 @@ ynh_remove_logrotate #================================================= ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=7 -# Remove the dedicated fail2ban config +# Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config #================================================= diff --git a/scripts/restore b/scripts/restore index e037cda..49073ed 100644 --- a/scripts/restore +++ b/scripts/restore @@ -198,10 +198,6 @@ ynh_print_OFF echo "$Informations You can also find a config file for Etherpad at this path /var/www/etherpad_mypads/settings.json. -Your credentials for the admin panel are: -- login : $admin -- password : $password - If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh" > mail_to_send ynh_send_readme_to_admin --app_message="mail_to_send" --recipients="$admin" --type=restore From 782a36010c5520e4a174d991e6cb10edbd5b2243 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 5 May 2021 19:43:24 +0200 Subject: [PATCH 47/48] Nicer link color for MyPads --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f96a9f3..d52d9d6 100644 --- a/scripts/install +++ b/scripts/install @@ -284,7 +284,7 @@ then #mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) ## In order to add a link to MyPads plugin. #sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html - sed -i '157i

MyPads
' $final_path/src/templates/index.html + sed -i '157i

MyPads
' $final_path/src/templates/index.html fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 91c6c14..2d8f8b5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -444,7 +444,7 @@ then # mod_line=$(grep -nA5 "index.createOpenPad" $final_path/src/templates/index.html | grep "" | cut -d '-' -f 1) # # In order to add a link to mypads plugin. # sed -i "$mod_line s@div>@&\n\t

MyPads
@" $final_path/src/templates/index.html - sed -i '157i

MyPads
' $final_path/src/templates/index.html + sed -i '157i

MyPads
' $final_path/src/templates/index.html fi #================================================= From 55ab8c9ceb06d67da2d73f59fa826a29b37106b0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 5 May 2021 19:59:21 +0200 Subject: [PATCH 48/48] Update settings.json --- conf/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/settings.json b/conf/settings.json index 13cd91d..8eee7b0 100644 --- a/conf/settings.json +++ b/conf/settings.json @@ -113,7 +113,7 @@ * "full-width-editor" variant (by default editor is rendered as a page, with * a max-width of 900px). */ - "skinVariants": "super-light-toolbar super-light-editor light-background", + "skinVariants": "light-toolbar super-light-editor dark-background", /* * IP and port which Etherpad should bind at.