From 91d42b2b5ccba52dcbd706fa3865ea4e6f047060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Jul 2022 23:47:12 +0200 Subject: [PATCH 1/5] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index c1891a8..85ecdc7 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -22,7 +22,7 @@ ep_align_version=0.3.53 ep_author_hover_version=0.3.37 ep_comments_page_version=1.0.5 ep_countable_version=0.0.13 -ep_delete_empty_pads_version=0.0.9 +ep_delete_empty_pads_version=0.0.10 ep_font_color_version=0.0.63 ep_headings2_version=0.2.44 ep_markdown_version=0.1.50 From 9c8b18b17da6d6fbe40db13814e65e27996be9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Jul 2022 23:53:27 +0200 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe4cc93..d848fff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ Changelog ========= +## [1.8.18~ynh2]() - 2022-07-26 + +#### Fixed +* [Fix unicode support](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/pull/174/commits/f9afcc4447fc2ec97355622645023a56551e3d4b) + + +## [1.8.18~ynh1]() - 2022-07-18 + +#### Changed +* [Upgrade to 1.8.18](https://github.com/YunoHost-Apps/etherpad_mypads_ynh/pull/171) + + ## [1.8.17~ynh1]() - 2022-02-24 #### Changed From a5c254dde3372ad6ba5da0e7fbb56cbd74c39105 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 28 Sep 2022 03:49:45 +0200 Subject: [PATCH 3/5] Apply last example_ynh --- conf/app.src | 2 +- conf/systemd.service | 4 ++-- ...panel.toml.exemple => config_panel.toml.example | 0 scripts/_common.sh | 8 ++++---- scripts/backup | 3 +++ scripts/change_url | 3 +-- scripts/install | 10 +++++----- scripts/remove | 8 ++++---- scripts/restore | 14 +++++++------- scripts/upgrade | 9 ++++----- 10 files changed, 31 insertions(+), 30 deletions(-) rename config_panel.toml.exemple => config_panel.toml.example (100%) diff --git a/conf/app.src b/conf/app.src index 51159f6..1328508 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,7 @@ SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.8.18.tar.gz SOURCE_SUM=67ccc0bac94e146b26fbddcf8330e0f543a4ff82213c420a376644614a7ff2c4 SOURCE_SUM_PRG=sha256sum -ARCH_FORMAT=tar.gz +SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/conf/systemd.service b/conf/systemd.service index 6c5ff08..863f647 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -15,7 +15,7 @@ StandardError=inherit Restart=always # Sandboxing options to harden security -# Depending on specificities of your service/app, you may need to tweak these +# Depending on specificities of your service/app, you may need to tweak these # .. but this should be a good baseline # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html NoNewPrivileges=yes @@ -42,7 +42,7 @@ CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW -CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG [Install] WantedBy=multi-user.target diff --git a/config_panel.toml.exemple b/config_panel.toml.example similarity index 100% rename from config_panel.toml.exemple rename to config_panel.toml.example diff --git a/scripts/_common.sh b/scripts/_common.sh index 85ecdc7..9d6ae90 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -35,10 +35,6 @@ ep_font_size_version=0.4.44 # PERSONAL HELPERS #================================================= -#================================================= -# FUTUR OFFICIAL HELPERS -#================================================= - #================================================= # EXPERIMENTAL HELPERS #================================================= @@ -400,3 +396,7 @@ ynh_app_changelog () { echo "No significative changes from the changelog..." > "${final_changelog}_lite" fi } + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= diff --git a/scripts/backup b/scripts/backup index 42d7600..73519a8 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,6 +14,9 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/change_url b/scripts/change_url index 07725a9..fecc25e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -45,7 +45,6 @@ ynh_script_progression --message="Backing up the app before changing its URL (ma # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - ynh_clean_check_starting # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" @@ -124,7 +123,7 @@ ynh_systemd_action --service_name=$app --action=restart --line_match="You can ac #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index d0db0b6..b092207 100644 --- a/scripts/install +++ b/scripts/install @@ -18,7 +18,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -42,7 +42,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." --weight=1 if [ "${#password}" -lt 8 ] || [ "${#password}" -gt 30 ] then @@ -109,7 +109,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." +ynh_script_progression --message="Creating a MySQL database..." --weight=1 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -144,7 +144,7 @@ ynh_add_nginx_config #================================================= # HANDLE LOG FILES AND LOGROTATE #================================================= -ynh_script_progression --message="Configuring log rotation..." +ynh_script_progression --message="Configuring log rotation..." --weight=1 # Create log directory mkdir -p /var/log/$app @@ -250,7 +250,7 @@ popd if [ $mypads -eq 1 ] then - ynh_script_progression --message="Some hacks..." + ynh_script_progression --message="Some hacks..." --weight=1 # 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 diff --git a/scripts/remove b/scripts/remove index a95f897..676b806 100755 --- a/scripts/remove +++ b/scripts/remove @@ -47,7 +47,7 @@ ynh_remove_systemd_config #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 # Remove the app-specific logrotate config ynh_remove_logrotate @@ -63,7 +63,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -79,7 +79,7 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." --weight=1 if [ "$export" != "none" ] then @@ -102,7 +102,7 @@ ynh_remove_fail2ban_config #================================================= # REMOVE VARIOUS FILES #================================================= -ynh_script_progression --message="Removing various files..." +ynh_script_progression --message="Removing various files..." --weight=1 # Remove the log files ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index 6a72769..3f33f3e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + true } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -40,7 +40,7 @@ password=$(ynh_app_setting_get --app=$app --key=password) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." --weight=1 test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -99,7 +99,7 @@ ynh_use_nodejs #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -124,7 +124,7 @@ chown $app -R /var/log/$app #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -132,14 +132,14 @@ systemctl enable $app.service --quiet #================================================= # RESTORE THE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/etherpad.log" @@ -155,7 +155,7 @@ ynh_systemd_action --service_name=$app --action=restart --line_match="You can ac #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --action=reload --service_name=nginx diff --git a/scripts/upgrade b/scripts/upgrade index 52a2f53..cb2e0c5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,7 +45,7 @@ pad_config_show_markdown=$(ynh_app_setting_get --app=$app --key=pad_config_show_ #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." +ynh_script_progression --message="Checking version..." --weight=1 # 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" @@ -60,7 +60,6 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - ynh_clean_check_starting # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -180,7 +179,7 @@ ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -392,7 +391,7 @@ ynh_use_logrotate --non-append --specific_user=$app/$app #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/etherpad.log" @@ -414,7 +413,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failrege #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload From 832a34a75f02adf88f98452f36bedcdb439fa1e5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 28 Sep 2022 04:17:37 +0200 Subject: [PATCH 4/5] Update updater.sh --- .github/workflows/updater.sh | 80 ++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index baafd8f..7643763 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,9 +9,6 @@ # Since each app is different, maintainers can adapt its contents so as to perform # automatic actions when a new upstream release is detected. -# Remove this exit command when you are ready to run this Action -#exit 1 - #================================================= # FETCHING LATEST RELEASE AND ITS ASSETS #================================================= @@ -23,25 +20,29 @@ repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1] version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} + version=${version:1} fi # Setting up the environment variables echo "Current version: $current_version" echo "Latest release from upstream: $version" echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV # For the time being, let's assume the script will fail echo "PROCEED=false" >> $GITHUB_ENV # Proceed only if the retrieved version is greater than the current one if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 + echo "::warning ::No new version available" + exit 0 # Proceed only if a PR for this new version does not already exist elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 + echo "::warning ::A branch already exists for this update" + exit 0 fi # Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) @@ -57,52 +58,53 @@ echo "${#assets[@]} available asset(s)" # Let's loop over the array of assets URLs for asset_url in ${assets[@]}; do -echo "Handling asset at $asset_url" + echo "Handling asset at $asset_url" -# Assign the asset to a source file in conf/ directory -# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) -# Leave $src empty to ignore the asset -case $asset_url in - *".tar.gz") - src="app" - ;; -esac + # Assign the asset to a source file in conf/ directory + # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) + # Leave $src empty to ignore the asset + case $asset_url in + *".tar.gz"*) + src="app" + ;; + esac -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then + # If $src is not empty, let's process the asset + if [ ! -z "$src" ]; then -# Create the temporary directory -tempdir="$(mktemp -d)" + # Create the temporary directory + tempdir="$(mktemp -d)" -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + # Download sources and calculate checksum + filename=${asset_url##*/} + curl --silent -4 -L $asset_url -o "$tempdir/$filename" + checksum=$(sha256sum "$tempdir/$filename" | head -c 64) -# Delete temporary directory -rm -rf $tempdir + # Delete temporary directory + rm -rf $tempdir -# Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi + # Get extension + if [[ $filename == *.tar.gz ]]; then + extension=tar.gz + else + extension=${filename##*.} + fi -# Rewrite source file -cat < conf/$src.src + # Rewrite source file + cat < conf/$src.src SOURCE_URL=$asset_url SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=$extension SOURCE_IN_SUBDIR=true SOURCE_FILENAME= +SOURCE_EXTRACT=true EOT -echo "... conf/$src.src updated" + echo "... conf/$src.src updated" -else -echo "... asset ignored" -fi + else + echo "... asset ignored" + fi done From f72d017572de4671cdb7a31905e1efeba415c216 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 28 Sep 2022 02:17:42 +0000 Subject: [PATCH 5/5] Auto-update README --- README.md | 1 + README_fr.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f99ec8e..43fc05f 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Etherpad is a real-time collaborative editor scalable to thousands of simultaneo **Shipped version:** 1.8.18~ynh2 + **Demo:** https://video.etherpad.com ## Screenshots diff --git a/README_fr.md b/README_fr.md index 5ac1b51..4a3c1d3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,8 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Etherpad est un éditeur collaboratif en temps réel évolutif pour des milliers d'utilisateurs simultanés en temps réel. Il fournit des capacités complètes d'exportation de données et s'exécute sur votre serveur, sous votre contrôle. -**Version incluse :** 1.8.18~ynh2 +**Version incluse :** 1.8.18~ynh2 + **Démo :** https://video.etherpad.com