From f7188e0891c70e3fe4c2a13f4e8b2a4e0063402e Mon Sep 17 00:00:00 2001 From: oufmilo <44617467+oufmilo@users.noreply.github.com> Date: Wed, 9 Jun 2021 22:36:46 +0200 Subject: [PATCH 1/5] Update check_process --- check_process | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index db3ddb8..916f0f1 100644 --- a/check_process +++ b/check_process @@ -10,7 +10,8 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=0 from_commit=CommitHash + # 12.82.0~ynh2 + #upgrade=1 from_commit=96332268263da1ddf330e2ce3925722c8408049a backup_restore=1 multi_instance=1 change_url=0 @@ -18,6 +19,6 @@ Email= Notification= ;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. + ; commit=96332268263da1ddf330e2ce3925722c8408049a + name=12.82.0~ynh2 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& From 8b80e6c7a8b7f22d4f60747c425873faf6812473 Mon Sep 17 00:00:00 2001 From: oufmilo <44617467+oufmilo@users.noreply.github.com> Date: Wed, 9 Jun 2021 22:41:21 +0200 Subject: [PATCH 2/5] Update check_process --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index 916f0f1..bfc6708 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,7 @@ #upgrade=1 from_commit=96332268263da1ddf330e2ce3925722c8408049a backup_restore=1 multi_instance=1 - change_url=0 + change_url=1 ;;; Options Email= Notification= From 5c7009a0e8bcdf1fc6ebcaef1b7a07b314d327db Mon Sep 17 00:00:00 2001 From: oufmilo <44617467+oufmilo@users.noreply.github.com> Date: Wed, 9 Jun 2021 22:47:53 +0200 Subject: [PATCH 3/5] Create change_url --- scripts/change_url | 113 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..570bcbf --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,113 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +old_domain=$YNH_APP_OLD_DOMAIN +old_path=$YNH_APP_OLD_PATH + +new_domain=$YNH_APP_NEW_DOMAIN +new_path=$YNH_APP_NEW_PATH + +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +#================================================= +# CHECK WHICH PARTS SHOULD BE CHANGED +#================================================= + +change_domain=0 +if [ "$old_domain" != "$new_domain" ] +then + change_domain=1 +fi + +change_path=0 +if [ "$old_path" != "$new_path" ] +then + change_path=1 +fi + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 + +nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf + +# Change the path in the NGINX config file +if [ $change_path -eq 1 ] +then + # Make a backup of the original NGINX config file if modified + ynh_backup_if_checksum_is_different --file="$nginx_conf_path" + # Set global variables for NGINX helper + domain="$old_domain" + path_url="$new_path" + # Create a dedicated NGINX config + ynh_add_nginx_config +fi + +# Change the domain for NGINX +if [ $change_domain -eq 1 ] +then + # Delete file checksum for the old conf file location + ynh_delete_file_checksum --file="$nginx_conf_path" + mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + # Store file checksum for the new config file location + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +fi + +#================================================= +# SETUP FAIL2BAN +#================================================= +ynh_script_progression --message="Configuring Fail2Ban..." --weight=10 + +# Remove the config file with $old_domain +ynh_remove_fail2ban_config + +# Add config file with $new_domain +ynh_add_fail2ban_config --logpath="/var/log/nginx/${new_domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 + +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +ynh_script_progression --message="Applying Misskey specific modifications..." --weight=2 + +if [ $change_domain -eq 1 ] +then + # Change domain in Misskey configuration + ynh_replace_string --match_string="'${old_domain}'" --replace_string="'${new_domain}'" --target_file="${final_path}/config.php" +fi +#================================================= +# GENERIC FINALISATION +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=2 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for Misskey" --last From c8517f3f2ac290a25eff6e4c20e829830cb0658f Mon Sep 17 00:00:00 2001 From: oufmilo Date: Fri, 11 Jun 2021 19:35:50 +0200 Subject: [PATCH 4/5] Update 12.83.0 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bf679b4..138dcfb 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Microblogging platform -**Shipped version:** 12.82.0~ynh2 +**Shipped version:** 12.83.0~ynh1 diff --git a/README_fr.md b/README_fr.md index cb04c7f..62c77c8 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Platforme de Microblogging -**Version incluse :** 12.82.0~ynh2 +**Version incluse :** 12.83.0~ynh1 diff --git a/conf/app.src b/conf/app.src index d5c1be9..4291133 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/misskey-dev/misskey/archive/refs/tags/12.82.0.tar.gz -SOURCE_SUM=16d9787a96ee4593c5ec97f38ad646cb348e8761781433f51897de683c063c72 +SOURCE_URL=https://github.com/misskey-dev/misskey/archive/refs/tags/12.83.0.tar.gz +SOURCE_SUM=681e0e0789adf8d4a6094a6676bcdf13584dbfadd359528634c6952ea5d9288f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index dcf2ab8..4cc738f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Microblogging platform", "fr": "Platforme de Microblogging" }, - "version": "12.82.0~ynh2", + "version": "12.83.0~ynh1", "url": "https://join.misskey.page/en/", "upstream": { "license": "AGPL-3.0", From f7b9a036f6ea518913ecd90c5466ec8eff065292 Mon Sep 17 00:00:00 2001 From: oufmilo Date: Fri, 11 Jun 2021 19:42:30 +0200 Subject: [PATCH 5/5] Update 12.83.0 --- check_process | 2 +- scripts/change_url | 113 --------------------------------------------- 2 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 scripts/change_url diff --git a/check_process b/check_process index bfc6708..916f0f1 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,7 @@ #upgrade=1 from_commit=96332268263da1ddf330e2ce3925722c8408049a backup_restore=1 multi_instance=1 - change_url=1 + change_url=0 ;;; Options Email= Notification= diff --git a/scripts/change_url b/scripts/change_url deleted file mode 100644 index 570bcbf..0000000 --- a/scripts/change_url +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# MODIFY URL IN NGINX CONF -#================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 - -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - -#================================================= -# SETUP FAIL2BAN -#================================================= -ynh_script_progression --message="Configuring Fail2Ban..." --weight=10 - -# Remove the config file with $old_domain -ynh_remove_fail2ban_config - -# Add config file with $new_domain -ynh_add_fail2ban_config --logpath="/var/log/nginx/${new_domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 - -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -ynh_script_progression --message="Applying Misskey specific modifications..." --weight=2 - -if [ $change_domain -eq 1 ] -then - # Change domain in Misskey configuration - ynh_replace_string --match_string="'${old_domain}'" --replace_string="'${new_domain}'" --target_file="${final_path}/config.php" -fi -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - -ynh_systemd_action --service_name=nginx --action=reload - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Change of URL completed for Misskey" --last