From 36fd80bb7acebd38ee9075fede5988e71f43bfe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Feb 2023 18:39:40 +0100 Subject: [PATCH 01/44] v2 --- conf/systemd.service | 4 ++-- manifest.toml | 36 ++++++++++++++++++++++++++++++++++++ scripts/backup | 12 ++++++------ scripts/install | 36 ++++++++++++++++++------------------ scripts/remove | 12 ++++++------ scripts/restore | 30 +++++++++++++++--------------- scripts/upgrade | 30 +++++++++++++++--------------- 7 files changed, 98 insertions(+), 62 deletions(-) create mode 100644 manifest.toml diff --git a/conf/systemd.service b/conf/systemd.service index 0b31170..b4e494f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,8 +6,8 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/smp-server start +WorkingDirectory=__INSTALL_DIR__/ +ExecStart=__INSTALL_DIR__/smp-server start Restart=always RestartSec=3 KillSignal=SIGINT diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..08d5d3e --- /dev/null +++ b/manifest.toml @@ -0,0 +1,36 @@ +packaging_format = 2 + +id = "simplex" +name = "SimpleX" +description.en = "Messaging platform operating without user identifiers" +description.fr = "Plate-forme de messagerie fonctionnant sans identifiants d'utilisateurs" + +version = "4.1.0~ynh1" + +maintainers = ["eric_G"] + +[upstream] +license = "AGPL-3.0" +website = "https://simplex.chat/" +code = "https://github.com/simplex-chat/simplex-chat" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] diff --git a/scripts/backup b/scripts/backup index 2f0fd0e..74af6ee 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -39,7 +39,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP SYSTEMD diff --git a/scripts/install b/scripts/install index f1be40c..65402b8 100755 --- a/scripts/install +++ b/scripts/install @@ -13,37 +13,37 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { ### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/usr/local/bin/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/usr/local/bin/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port=$(ynh_find_port --port=5223) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=5223) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port # Open the port ynh_script_progression --message="Configuring firewall..." --weight=1 @@ -52,30 +52,30 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" -chmod +x $final_path/smp-server +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" +chmod +x $install_dir/smp-server #================================================= # SPECIFIC SETUP #================================================= -pushd "$final_path" +pushd "$install_dir" public_ip4="$(curl -s ip.yunohost.org)" || true ./smp-server init --no-password --ip $public_ip4 -y popd diff --git a/scripts/remove b/scripts/remove index f70a931..50c6ffa 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,11 +12,11 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # STANDARD REMOVE @@ -42,7 +42,7 @@ ynh_remove_systemd_config #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="/usr/local/bin/simplex" @@ -64,10 +64,10 @@ fi #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 4ddfdeb..f4efbdc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,51 +14,51 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index a5cb373..f190cf9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,12 +12,12 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION @@ -28,16 +28,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -51,10 +51,10 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? 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" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -65,12 +65,12 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # SETUP SYSTEMD From 6d90835629b0e55f928581a277c2e436be30265d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 25 Feb 2023 17:39:44 +0000 Subject: [PATCH 02/44] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 04e4120..a2dab4e 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # SimpleX for YunoHost [![Integration level](https://dash.yunohost.org/integration/simplex.svg)](https://dash.yunohost.org/appci/app/simplex) ![Working status](https://ci-apps.yunohost.org/ci/badges/simplex.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/simplex.maintain.svg) + [![Install SimpleX with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=simplex) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index 631b304..abbcbbe 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # SimpleX pour YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/simplex.svg)](https://dash.yunohost.org/appci/app/simplex) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/simplex.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/simplex.maintain.svg) + [![Installer SimpleX avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=simplex) *[Read this readme in english.](./README.md)* From 1aa5988dc1e9c77476319aa0aa23b6de9d046c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Feb 2023 18:52:24 +0100 Subject: [PATCH 03/44] fix --- check_process | 28 --------- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 manifest.json | 29 --------- manifest.toml | 21 ++++--- scripts/backup | 20 ------ scripts/change_url | 91 +-------------------------- scripts/install | 49 --------------- scripts/remove | 29 --------- scripts/restore | 40 ------------ scripts/upgrade | 33 ---------- 11 files changed, 13 insertions(+), 327 deletions(-) delete mode 100644 check_process rename doc/{DISCLAIMER.md => ADMIN.md} (100%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) delete mode 100644 manifest.json diff --git a/check_process b/check_process deleted file mode 100644 index d813274..0000000 --- a/check_process +++ /dev/null @@ -1,28 +0,0 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - -# Move this file from check_process.default to check_process when you have filled it. - -;; Test complet - ; Manifest - domain="domain.tld" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=0 - setup_nourl=1 - setup_private=0 - setup_public=0 - upgrade=1 - #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=0 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 69d0894..0000000 --- a/manifest.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "SimpleX", - "id": "simplex", - "packaging_format": 1, - "description": { - "en": "Messaging platform operating without user identifiers", - "fr": "Plate-forme de messagerie fonctionnant sans identifiants d'utilisateurs" - }, - "version": "4.1.0~ynh1", - "url": "https://simplex.chat/", - "upstream": { - "license": "AGPL-3.0", - "website": "https://simplex.chat/", - "code": "https://github.com/simplex-chat/simplex-chat" - }, - "license": "AGPL-3.0", - "maintainer": { - "name": "eric_G", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": false, - "services": [], - "arguments": { - "install": [] - } -} diff --git a/manifest.toml b/manifest.toml index 08d5d3e..ea9c298 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,24 +13,27 @@ maintainers = ["eric_G"] license = "AGPL-3.0" website = "https://simplex.chat/" code = "https://github.com/simplex-chat/simplex-chat" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.11" +architectures = ["amd64"] multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [resources] + [resources.ports] + main.default = 5223 + main.exposed = "TCP" + [resources.system_user] [resources.install_dir] + dir = "/usr/local/bin/__APP__" [resources.permissions] diff --git a/scripts/backup b/scripts/backup index 74af6ee..ac5b947 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,26 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/change_url b/scripts/change_url index cfea773..328a5b9 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -6,62 +6,8 @@ # 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) - -#================================================= -# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # 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" - - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# 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 #================================================= @@ -76,35 +22,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 -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 - -#================================================= -# SPECIFIC MODIFICATIONS -#================================================= -# ... -#================================================= +ynh_change_url_nginx_config #================================================= # GENERIC FINALISATION @@ -115,13 +33,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 65402b8..1c5f5e3 100755 --- a/scripts/install +++ b/scripts/install @@ -9,60 +9,11 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/usr/local/bin/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=5223) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -# Open the port -ynh_script_progression --message="Configuring firewall..." --weight=1 -ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" diff --git a/scripts/remove b/scripts/remove index 50c6ffa..5c641e2 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,15 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # STANDARD REMOVE #================================================= @@ -49,26 +40,6 @@ ynh_secure_remove --file="/usr/local/bin/simplex" ynh_secure_remove --file="/etc/opt/simplex" -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index f4efbdc..6d34450 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,45 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -56,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index f190cf9..256d212 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,36 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) - #================================================= # CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -48,14 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -68,7 +36,6 @@ then ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From c231d483d7c72ebe2b23fae398325af9c5cc8141 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 25 Feb 2023 17:52:33 +0000 Subject: [PATCH 04/44] Auto-update README --- README.md | 21 --------------------- README_fr.md | 21 --------------------- 2 files changed, 42 deletions(-) diff --git a/README.md b/README.md index a2dab4e..7925851 100644 --- a/README.md +++ b/README.md @@ -24,27 +24,6 @@ SimpleX - the first messaging platform operating without user identifiers of any ![Screenshot of SimpleX](./doc/screenshots/conversation.png) -## Disclaimers / important information - -### SMP server address - -You can find the fingerprint in the SimpleX Chat service in the webadmin - -Your SMP server address should look like this: - -``` -smp://YOUR_FINGERPRINT=@YOUR_IPV4_ADDRESS:5223 -``` - -For mobile clients, open Settings, find an option "SMP servers", toggle "Configure SMP Servers" to on, then enter the SMP Servers Address for all servers you want the client to use. - -[iOS app](https://apps.apple.com/us/app/simplex-chat/id1605771084) -  -[![Android app](https://github.com/simplex-chat/.github/blob/master/profile/images/google_play.svg)](https://play.google.com/store/apps/details?id=chat.simplex.app) -  -[F-Droid](https://app.simplex.chat) -  - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index abbcbbe..2e369a1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,27 +24,6 @@ SimpleX - la première plate-forme de messagerie qui n'a aucun identifiant d'uti ![Capture d’écran de SimpleX](./doc/screenshots/conversation.png) -## Avertissements / informations importantes - -### Adresse du serveur SMP - -Vous pouvez trouver l'empreinte digitale dans le service SimpleX Chat dans la webadmin. - -L'adresse de votre serveur SMP devrait ressembler à ceci : - -``` -smp://YOUR_FINGERPRINT=@YOUR_IPV4_ADDRESS:5223 -``` - -Pour les clients mobiles, ouvrez Paramètres, recherchez une option "Serveurs SMP", activez "Configurer les serveurs SMP", puis entrez l'adresse des serveurs SMP pour tous les serveurs que vous souhaitez que le client utilise. - -[iOS app](https://apps.apple.com/us/app/simplex-chat/id1605771084) -  -[![Android app](https://github.com/simplex-chat/.github/blob/master/profile/images/google_play.svg)](https://play.google.com/store/apps/details?id=chat.simplex.app) -  -[F-Droid](https://app.simplex.chat) -  - ## Documentations et ressources * Site officiel de l’app : From 22e7c554b0672138321664d31b67ad4d16e4f632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Feb 2023 18:53:49 +0100 Subject: [PATCH 05/44] Create tests.toml --- tests.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests.toml diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..cbbeef1 --- /dev/null +++ b/tests.toml @@ -0,0 +1,3 @@ +test_format = 1.0 + +[default] From f7883547573ca0100712cd6d925f2843b3b56ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 18:45:21 +0100 Subject: [PATCH 06/44] fix --- doc/POST_INSTALLATION.md | 0 manifest.toml | 2 +- scripts/install | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 doc/POST_INSTALLATION.md diff --git a/doc/POST_INSTALLATION.md b/doc/POST_INSTALLATION.md new file mode 100644 index 0000000..e69de29 diff --git a/manifest.toml b/manifest.toml index ea9c298..aed0933 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,7 @@ website = "https://simplex.chat/" code = "https://github.com/simplex-chat/simplex-chat" [integration] -yunohost = ">= 11.1.11" +yunohost = ">= 11.1.12" architectures = ["amd64"] multi_instance = false ldap = "not_relevant" diff --git a/scripts/install b/scripts/install index 1c5f5e3..e9fb989 100755 --- a/scripts/install +++ b/scripts/install @@ -17,7 +17,6 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" chmod +x $install_dir/smp-server From 5000d0a2ab495515027a101fd7624dc547047ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:43:51 +0100 Subject: [PATCH 07/44] Update POST_INSTALLATION.md --- doc/POST_INSTALLATION.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/POST_INSTALLATION.md b/doc/POST_INSTALLATION.md index e69de29..1daa348 100644 --- a/doc/POST_INSTALLATION.md +++ b/doc/POST_INSTALLATION.md @@ -0,0 +1,13 @@ +option 1: + + after installing, you need to find your fingerprint of your server: + `sudo cat /etc/opt/simplex/fingerprint` + + now make your server address: + +`smp://[:]@[,]` + + add it to your simplex app under Settings > Network & Servers > SMP Servers > + Add server + +options 2: +maybe during the CLI install, it could spit out the fingerprint address to the terminal. then we can copy & paste it. \ No newline at end of file From aec33348a0bf818b189faaa14ec3c33fa9408db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:48:17 +0100 Subject: [PATCH 08/44] 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 b4e494f..0db7783 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=SimpleX: messaging Protocol Server +Description=SimpleX: Messaging Protocol Server After=network.target [Service] From e70553615312afb64b864f550ea55a08cc6a2ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 19:56:54 +0100 Subject: [PATCH 09/44] Fix --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- scripts/install | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 79f58fd..4ad6e41 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -5,7 +5,7 @@ You can find the fingerprint in the SimpleX Chat service in the webadmin Your SMP server address should look like this: ``` -smp://YOUR_FINGERPRINT=@YOUR_IPV4_ADDRESS:5223 +smp://__FINGERPRINT__=@YOUR_IPV4_ADDRESS:5223 ``` For mobile clients, open Settings, find an option "SMP servers", toggle "Configure SMP Servers" to on, then enter the SMP Servers Address for all servers you want the client to use. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index ab52f39..3b08a3f 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -5,7 +5,7 @@ Vous pouvez trouver l'empreinte digitale dans le service SimpleX Chat dans la we L'adresse de votre serveur SMP devrait ressembler à ceci : ``` -smp://YOUR_FINGERPRINT=@YOUR_IPV4_ADDRESS:5223 +smp://__FINGERPRINT__=@YOUR_IPV4_ADDRESS:5223 ``` Pour les clients mobiles, ouvrez Paramètres, recherchez une option "Serveurs SMP", activez "Configurer les serveurs SMP", puis entrez l'adresse des serveurs SMP pour tous les serveurs que vous souhaitez que le client utilise. diff --git a/scripts/install b/scripts/install index e9fb989..5ed5a28 100755 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ pushd "$install_dir" public_ip4="$(curl -s ip.yunohost.org)" || true ./smp-server init --no-password --ip $public_ip4 -y popd +fingerprint=$( cat /etc/opt/simplex/fingerprint ) chown -R $app:$app "/etc/opt/simplex" From 209a703a0f7836e2761ec56159f1e20882bb766e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 20:02:02 +0100 Subject: [PATCH 10/44] fix --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- scripts/install | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 4ad6e41..5e05755 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -5,7 +5,7 @@ You can find the fingerprint in the SimpleX Chat service in the webadmin Your SMP server address should look like this: ``` -smp://__FINGERPRINT__=@YOUR_IPV4_ADDRESS:5223 +smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ ``` For mobile clients, open Settings, find an option "SMP servers", toggle "Configure SMP Servers" to on, then enter the SMP Servers Address for all servers you want the client to use. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 3b08a3f..532b2fb 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -5,7 +5,7 @@ Vous pouvez trouver l'empreinte digitale dans le service SimpleX Chat dans la we L'adresse de votre serveur SMP devrait ressembler à ceci : ``` -smp://__FINGERPRINT__=@YOUR_IPV4_ADDRESS:5223 +smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ ``` Pour les clients mobiles, ouvrez Paramètres, recherchez une option "Serveurs SMP", activez "Configurer les serveurs SMP", puis entrez l'adresse des serveurs SMP pour tous les serveurs que vous souhaitez que le client utilise. diff --git a/scripts/install b/scripts/install index 5ed5a28..4b4436a 100755 --- a/scripts/install +++ b/scripts/install @@ -29,7 +29,8 @@ pushd "$install_dir" public_ip4="$(curl -s ip.yunohost.org)" || true ./smp-server init --no-password --ip $public_ip4 -y popd -fingerprint=$( cat /etc/opt/simplex/fingerprint ) + +fingerprint=$(cat /etc/opt/simplex/fingerprint) chown -R $app:$app "/etc/opt/simplex" From 91471b64bd9cce40d7a53d30cd534bc33162870e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 20:14:49 +0100 Subject: [PATCH 11/44] Update POST_INSTALLATION.md --- doc/POST_INSTALLATION.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/doc/POST_INSTALLATION.md b/doc/POST_INSTALLATION.md index 1daa348..31432cc 100644 --- a/doc/POST_INSTALLATION.md +++ b/doc/POST_INSTALLATION.md @@ -1,13 +1,5 @@ -option 1: +Your SMP server address: - after installing, you need to find your fingerprint of your server: - `sudo cat /etc/opt/simplex/fingerprint` - - now make your server address: - -`smp://[:]@[,]` - - add it to your simplex app under Settings > Network & Servers > SMP Servers > + Add server - -options 2: -maybe during the CLI install, it could spit out the fingerprint address to the terminal. then we can copy & paste it. \ No newline at end of file +``` +smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ +``` From 6eb99a79c66232e460138348d77f4935ee7d78d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 20:16:10 +0100 Subject: [PATCH 12/44] fix --- doc/{POST_INSTALLATION.md => POST_INSTALL.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{POST_INSTALLATION.md => POST_INSTALL.md} (100%) diff --git a/doc/POST_INSTALLATION.md b/doc/POST_INSTALL.md similarity index 100% rename from doc/POST_INSTALLATION.md rename to doc/POST_INSTALL.md From a9e34fc0275e1437eabe4626ef8ec3e9f3729726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 22:45:39 +0100 Subject: [PATCH 13/44] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 4b4436a..ed36a75 100755 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ pushd "$install_dir" popd fingerprint=$(cat /etc/opt/simplex/fingerprint) +ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint chown -R $app:$app "/etc/opt/simplex" From 8dd9ad10c9d57d8280c92010d66efe81b9d5c509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:05:12 +0100 Subject: [PATCH 14/44] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index ed36a75..19a621a 100755 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ pushd "$install_dir" popd fingerprint=$(cat /etc/opt/simplex/fingerprint) +ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint chown -R $app:$app "/etc/opt/simplex" From 8e95035e3900b1d248ac2d2319bbcd07f1d83f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:14:15 +0100 Subject: [PATCH 15/44] fix --- doc/ADMIN.md | 4 +--- doc/ADMIN_fr.md | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 5e05755..5461e50 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1,8 +1,6 @@ ### SMP server address -You can find the fingerprint in the SimpleX Chat service in the webadmin - -Your SMP server address should look like this: +Your SMP server address: ``` smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 532b2fb..6c4b5de 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1,8 +1,6 @@ ### Adresse du serveur SMP -Vous pouvez trouver l'empreinte digitale dans le service SimpleX Chat dans la webadmin. - -L'adresse de votre serveur SMP devrait ressembler à ceci : +L'adresse de votre serveur SMP est : ``` smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ From 7a5ca83c2cf99a38aff2fc844540933e3723bea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:56:06 +0100 Subject: [PATCH 16/44] Fix --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 5461e50..2cef887 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -3,7 +3,7 @@ Your SMP server address: ``` -smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ ``` For mobile clients, open Settings, find an option "SMP servers", toggle "Configure SMP Servers" to on, then enter the SMP Servers Address for all servers you want the client to use. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 6c4b5de..47b2eb2 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -3,7 +3,7 @@ L'adresse de votre serveur SMP est : ``` -smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ ``` Pour les clients mobiles, ouvrez Paramètres, recherchez une option "Serveurs SMP", activez "Configurer les serveurs SMP", puis entrez l'adresse des serveurs SMP pour tous les serveurs que vous souhaitez que le client utilise. From 01ec8965e0be1a302c5d7eb21ba0ed4ce203bc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:56:23 +0100 Subject: [PATCH 17/44] Update POST_INSTALL.md --- doc/POST_INSTALL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 31432cc..972dca1 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,5 +1,4 @@ Your SMP server address: -``` -smp://__FINGERPRINT__=@__PUBLIC_IP4__:__PORT__ -``` +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ + From 8c9a65ca2e72db6e162cb27215d1824c0e5b0572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:57:39 +0100 Subject: [PATCH 18/44] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index aed0933..ac32450 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,7 @@ website = "https://simplex.chat/" code = "https://github.com/simplex-chat/simplex-chat" [integration] -yunohost = ">= 11.1.12" +yunohost = ">= 11.1.13" architectures = ["amd64"] multi_instance = false ldap = "not_relevant" From 15b0cd678498a1fd817bdd9da11d42db2cfe84d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 00:08:20 +0100 Subject: [PATCH 19/44] Create POST_INSTALL_fr.md --- doc/POST_INSTALL_fr.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/POST_INSTALL_fr.md diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md new file mode 100644 index 0000000..132e29d --- /dev/null +++ b/doc/POST_INSTALL_fr.md @@ -0,0 +1,4 @@ +Adresse de votre serveur SMP : + +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ + From 23049abf2590e0573eddab6414cbdd9976a35ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 11:30:27 +0100 Subject: [PATCH 20/44] Update manifest.toml --- manifest.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifest.toml b/manifest.toml index ac32450..d251437 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,6 +13,8 @@ maintainers = ["eric_G"] license = "AGPL-3.0" website = "https://simplex.chat/" code = "https://github.com/simplex-chat/simplex-chat" +cpe = "cpe:2.3:a:simplex:simplex_chat" +fund = "https://opencollective.com/simplex-chat" [integration] yunohost = ">= 11.1.13" From 170e5fc5995e7ab0dee091f10818ce30dd425863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 11:31:48 +0100 Subject: [PATCH 21/44] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 19a621a..bd759cf 100755 --- a/scripts/install +++ b/scripts/install @@ -27,11 +27,11 @@ chmod +x $install_dir/smp-server pushd "$install_dir" public_ip4="$(curl -s ip.yunohost.org)" || true + ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 ./smp-server init --no-password --ip $public_ip4 -y popd fingerprint=$(cat /etc/opt/simplex/fingerprint) -ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint chown -R $app:$app "/etc/opt/simplex" From 28da48c36573598e9fbf80fb153d11eed174f6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 11:47:14 +0100 Subject: [PATCH 22/44] Fix --- doc/ADMIN.md | 2 -- doc/ADMIN_fr.md | 2 -- manifest.toml | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 2cef887..40a65a8 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -1,5 +1,3 @@ -### SMP server address - Your SMP server address: ``` diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 47b2eb2..c725c68 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -1,5 +1,3 @@ -### Adresse du serveur SMP - L'adresse de votre serveur SMP est : ``` diff --git a/manifest.toml b/manifest.toml index d251437..d06e529 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,7 @@ multi_instance = false ldap = "not_relevant" sso = "not_relevant" disk = "50M" -ram.build = "50M" +ram.build = "150M" ram.runtime = "50M" [install] From 4efaf954e83e034d3b39bdf7ae357d38c2bd306f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 12:37:40 +0100 Subject: [PATCH 23/44] 4.4.1 --- conf/app.src | 4 ++-- manifest.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 14b589a..da3d5c9 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/simplex_ynh/releases/download/v4.1.0/smp-server -SOURCE_SUM=83bb242283e08cc37eb3870d2c0ef1b4d96725ee56e021c7bdaad919dc2bb336 +SOURCE_URL=https://github.com/YunoHost-Apps/simplex_ynh/releases/download/v4.4.1/smp-server +SOURCE_SUM=057b773520d87d0f71958665ff3c099ec7214165fa82551b0c2251ae9165ce03 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=smp-server diff --git a/manifest.toml b/manifest.toml index d06e529..784eccb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "SimpleX" description.en = "Messaging platform operating without user identifiers" description.fr = "Plate-forme de messagerie fonctionnant sans identifiants d'utilisateurs" -version = "4.1.0~ynh1" +version = "4.4.1~ynh1" maintainers = ["eric_G"] From a73107de1933b59069ee27328a241b349032caf9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 4 Mar 2023 11:37:44 +0000 Subject: [PATCH 24/44] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7925851..3cdf01f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in SimpleX - the first messaging platform operating without user identifiers of any kind - 100% private by design! iOS and Android apps are released. -**Shipped version:** 4.1.0~ynh1 +**Shipped version:** 4.4.1~ynh1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 2e369a1..c3b68b6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po SimpleX - la première plate-forme de messagerie qui n'a aucun identifiant d'utilisateur d'aucune sorte - 100 % privée de par sa conception ! -**Version incluse :** 4.1.0~ynh1 +**Version incluse :** 4.4.1~ynh1 ## Captures d’écran From 649149d95364f3e8e3a76b5498e2178a8a38dfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:36:29 +0100 Subject: [PATCH 25/44] Update remove --- scripts/remove | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/remove b/scripts/remove index 5c641e2..13f4668 100755 --- a/scripts/remove +++ b/scripts/remove @@ -33,11 +33,8 @@ ynh_remove_systemd_config #================================================= # REMOVE APP MAIN DIR #================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="/usr/local/bin/simplex" - ynh_secure_remove --file="/etc/opt/simplex" #================================================= From 52c685bc842bc5fc14c2634b99022c560f0a3ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:48:00 +0100 Subject: [PATCH 26/44] fix --- doc/POST_UPGRADE.md | 3 +++ scripts/upgrade | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 doc/POST_UPGRADE.md diff --git a/doc/POST_UPGRADE.md b/doc/POST_UPGRADE.md new file mode 100644 index 0000000..06a3064 --- /dev/null +++ b/doc/POST_UPGRADE.md @@ -0,0 +1,3 @@ +Your SMP server address: + +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 256d212..4e4a699 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,23 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# If public_ip4 doesn't exist, create it +if [ -z "$public_ip4" ]; then + public_ip4="$(curl -s ip.yunohost.org)" || true) + ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 +fi + +# If fingerprint doesn't exist, create it +if [ -z "$fingerprint" ]; then + fingerprint=$(cat /etc/opt/simplex/fingerprint) + ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= From 18d131313d9681a8147c54814a6f052d86448c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:52:16 +0100 Subject: [PATCH 27/44] Fix --- scripts/install | 9 ++------- scripts/remove | 10 ++++------ scripts/upgrade | 9 ++------- tests.toml | 6 ++++++ 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/scripts/install b/scripts/install index bd759cf..2a6f144 100755 --- a/scripts/install +++ b/scripts/install @@ -37,18 +37,13 @@ ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint chown -R $app:$app "/etc/opt/simplex" #================================================= -# SETUP SYSTEMD +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Messaging platform" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port" #================================================= diff --git a/scripts/remove b/scripts/remove index 13f4668..33d032c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,17 +23,15 @@ then fi #================================================= -# STOP AND REMOVE SERVICE +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 +# REMOVE SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE APP MAIN DIR -#================================================= - # Remove the app directory securely ynh_secure_remove --file="/etc/opt/simplex" diff --git a/scripts/upgrade b/scripts/upgrade index 4e4a699..686667e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,18 +57,13 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# SETUP SYSTEMD +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Messaging platform" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port" #================================================= diff --git a/tests.toml b/tests.toml index cbbeef1..884ddd6 100644 --- a/tests.toml +++ b/tests.toml @@ -1,3 +1,9 @@ test_format = 1.0 [default] + + # ------------ + # Tests to run + # ------------ + + exclude = ["install.change_url"] From d8f233ac42aebadbbb638243ad72c0354c80f9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:52:31 +0100 Subject: [PATCH 28/44] Delete change_url --- scripts/change_url | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url deleted file mode 100644 index 328a5b9..0000000 --- a/scripts/change_url +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source /usr/share/yunohost/helpers - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - -#================================================= -# MODIFY URL IN NGINX CONF -#================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 - -ynh_change_url_nginx_config - -#================================================= -# GENERIC FINALISATION -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Change of URL completed for $app" --last From 0339561902800a8221e67809037683381612fb23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:59:06 +0100 Subject: [PATCH 29/44] Fix --- doc/POST_UPGRADE_fr.md | 3 +++ scripts/upgrade | 1 + 2 files changed, 4 insertions(+) create mode 100644 doc/POST_UPGRADE_fr.md diff --git a/doc/POST_UPGRADE_fr.md b/doc/POST_UPGRADE_fr.md new file mode 100644 index 0000000..2a742af --- /dev/null +++ b/doc/POST_UPGRADE_fr.md @@ -0,0 +1,3 @@ +Adresse de votre serveur SMP : + +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 686667e..651e70a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,7 @@ fi chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +chmod +x $install_dir/smp-server #================================================= # REAPPLY SYSTEM CONFIGURATIONS From 17e864da63cb61dee810f7c292fb7fe731ed4ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:03:16 +0100 Subject: [PATCH 30/44] Update manifest.toml --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index 784eccb..e81f619 100644 --- a/manifest.toml +++ b/manifest.toml @@ -12,6 +12,7 @@ maintainers = ["eric_G"] [upstream] license = "AGPL-3.0" website = "https://simplex.chat/" +admindoc = "https://github.com/simplex-chat/simplex-chat/blob/stable/docs/SERVER.md" code = "https://github.com/simplex-chat/simplex-chat" cpe = "cpe:2.3:a:simplex:simplex_chat" fund = "https://opencollective.com/simplex-chat" From a7aa60a746ac3e57923746689fe9f5d6017f5368 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 4 Mar 2023 18:03:20 +0000 Subject: [PATCH 31/44] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 3cdf01f..b2d5bfa 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ SimpleX - the first messaging platform operating without user identifiers of any ## Documentation and resources * Official app website: +* Official admin documentation: * Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index c3b68b6..9fd0a97 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,6 +27,7 @@ SimpleX - la première plate-forme de messagerie qui n'a aucun identifiant d'uti ## Documentations et ressources * Site officiel de l’app : +* Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : From 489f2b9dcc4340455af98aa68f7f6ee2f7c2aff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:34:29 +0100 Subject: [PATCH 32/44] Update tests.toml --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index 884ddd6..3b883e2 100644 --- a/tests.toml +++ b/tests.toml @@ -6,4 +6,4 @@ test_format = 1.0 # Tests to run # ------------ - exclude = ["install.change_url"] + exclude = ["change_url"] From 9ccc8bb019adb286e036ba7dcb16874390e97817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:39:41 +0100 Subject: [PATCH 33/44] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 651e70a..c2c3d10 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If public_ip4 doesn't exist, create it if [ -z "$public_ip4" ]; then - public_ip4="$(curl -s ip.yunohost.org)" || true) + public_ip4="$(curl -s ip.yunohost.org)") ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 fi From 95978be6cbabb0609ec5bc46cfda4470c5a6eedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:40:49 +0100 Subject: [PATCH 34/44] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index c2c3d10..3a38e9c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If public_ip4 doesn't exist, create it if [ -z "$public_ip4" ]; then - public_ip4="$(curl -s ip.yunohost.org)") + public_ip4="$(curl -s ip.yunohost.org)" ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 fi From d5cbf20e8041548623ea83a89279a508ee1f84df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:42:20 +0100 Subject: [PATCH 35/44] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3a38e9c..6abe73f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If public_ip4 doesn't exist, create it if [ -z "$public_ip4" ]; then - public_ip4="$(curl -s ip.yunohost.org)" + public_ip4="$(curl -s ip.yunohost.org)" || true ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 fi From eaf95acb43f874a14a0695d64ca0696090a0312f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:43:52 +0100 Subject: [PATCH 36/44] Update upgrade --- scripts/upgrade | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6abe73f..61620d8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,11 +20,8 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If public_ip4 doesn't exist, create it -if [ -z "$public_ip4" ]; then - public_ip4="$(curl -s ip.yunohost.org)" || true - ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 -fi +public_ip4="$(curl -s ip.yunohost.org)" || true +ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 # If fingerprint doesn't exist, create it if [ -z "$fingerprint" ]; then From 3fe727fb0f0d529457b11371084292c5cd1d3f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:44:23 +0100 Subject: [PATCH 37/44] Update upgrade --- scripts/upgrade | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 61620d8..49439ba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,11 +23,8 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 public_ip4="$(curl -s ip.yunohost.org)" || true ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 -# If fingerprint doesn't exist, create it -if [ -z "$fingerprint" ]; then - fingerprint=$(cat /etc/opt/simplex/fingerprint) - ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint -fi +fingerprint=$(cat /etc/opt/simplex/fingerprint) +ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint #================================================= # STANDARD UPGRADE STEPS From fc562329c68ef2c96a423e4b05c6919759e42196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:45:32 +0100 Subject: [PATCH 38/44] Update upgrade --- scripts/upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 49439ba..b25f4e8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,11 +20,11 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -public_ip4="$(curl -s ip.yunohost.org)" || true -ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 +#public_ip4="$(curl -s ip.yunohost.org)" || true +#ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 -fingerprint=$(cat /etc/opt/simplex/fingerprint) -ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint +#fingerprint=$(cat /etc/opt/simplex/fingerprint) +#ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint #================================================= # STANDARD UPGRADE STEPS From e243e56ad36b815b14d813a4964381613986975d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:47:11 +0100 Subject: [PATCH 39/44] Update upgrade --- scripts/upgrade | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b25f4e8..d6bfcea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,17 +15,6 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -#public_ip4="$(curl -s ip.yunohost.org)" || true -#ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 - -#fingerprint=$(cat /etc/opt/simplex/fingerprint) -#ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -51,6 +40,21 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x $install_dir/smp-server +#================================================= +# SPECIFIC SETUP +#================================================= + +pushd "$install_dir" + public_ip4="$(curl -s ip.yunohost.org)" || true + ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 + ./smp-server init --no-password --ip $public_ip4 -y +popd + +fingerprint=$(cat /etc/opt/simplex/fingerprint) +ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint + +chown -R $app:$app "/etc/opt/simplex" + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= From d1454e73890ee7012b16ed001063b691852276a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 20:29:27 +0100 Subject: [PATCH 40/44] Update upgrade --- scripts/upgrade | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d6bfcea..4259aba 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,21 +40,6 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" chmod +x $install_dir/smp-server -#================================================= -# SPECIFIC SETUP -#================================================= - -pushd "$install_dir" - public_ip4="$(curl -s ip.yunohost.org)" || true - ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 - ./smp-server init --no-password --ip $public_ip4 -y -popd - -fingerprint=$(cat /etc/opt/simplex/fingerprint) -ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint - -chown -R $app:$app "/etc/opt/simplex" - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= From 2a09c1406fa06af08ed638df175e9e031a7a9b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 20:32:10 +0100 Subject: [PATCH 41/44] fix --- doc/POST_UPGRADE.md | 3 --- doc/POST_UPGRADE_fr.md | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 doc/POST_UPGRADE.md delete mode 100644 doc/POST_UPGRADE_fr.md diff --git a/doc/POST_UPGRADE.md b/doc/POST_UPGRADE.md deleted file mode 100644 index 06a3064..0000000 --- a/doc/POST_UPGRADE.md +++ /dev/null @@ -1,3 +0,0 @@ -Your SMP server address: - -smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ \ No newline at end of file diff --git a/doc/POST_UPGRADE_fr.md b/doc/POST_UPGRADE_fr.md deleted file mode 100644 index 2a742af..0000000 --- a/doc/POST_UPGRADE_fr.md +++ /dev/null @@ -1,3 +0,0 @@ -Adresse de votre serveur SMP : - -smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ \ No newline at end of file From acfeee0f6cdf9999ff534d956362703d2d280428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 20:36:07 +0100 Subject: [PATCH 42/44] Update upgrade --- scripts/upgrade | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 4259aba..b2d3566 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,12 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) + +public_ip4="$(curl -s ip.yunohost.org)" || true +fingerprint=$(cat /etc/opt/simplex/fingerprint) +ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 +ynh_app_setting_set --app=$app --key=fingerprint --value=$fingerprint + #================================================= # STANDARD UPGRADE STEPS #================================================= From 796b41d2a454dfbca79ae7f58ee936177df6fa1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 4 Mar 2023 20:41:13 +0100 Subject: [PATCH 43/44] FIX --- doc/POST_UPGRADE.md | 4 ++++ doc/POST_UPGRADE_fr.md | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 doc/POST_UPGRADE.md create mode 100644 doc/POST_UPGRADE_fr.md diff --git a/doc/POST_UPGRADE.md b/doc/POST_UPGRADE.md new file mode 100644 index 0000000..972dca1 --- /dev/null +++ b/doc/POST_UPGRADE.md @@ -0,0 +1,4 @@ +Your SMP server address: + +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ + diff --git a/doc/POST_UPGRADE_fr.md b/doc/POST_UPGRADE_fr.md new file mode 100644 index 0000000..132e29d --- /dev/null +++ b/doc/POST_UPGRADE_fr.md @@ -0,0 +1,4 @@ +Adresse de votre serveur SMP : + +smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__ + From 62ff8b214dbbeaea28db55915331d355ecd551ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 5 Mar 2023 09:31:46 +0100 Subject: [PATCH 44/44] fix --- scripts/backup | 2 ++ scripts/install | 2 +- scripts/restore | 14 +++++++------- scripts/upgrade | 6 +++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/backup b/scripts/backup index ac5b947..3adb9d7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,8 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +ynh_backup --src_path="/etc/opt/simplex" + #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/install b/scripts/install index 2a6f144..dd20ded 100755 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,7 @@ chown -R $app:$app "/etc/opt/simplex" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app ..." --weight=6 # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/restore b/scripts/restore index 6d34450..6eb851b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -21,18 +21,18 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=4 + +ynh_restore_file --origin_path="/etc/opt/simplex" +chown -R $app:$app "/etc/opt/simplex" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Messaging platform" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b2d3566..effc4c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,6 +16,10 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# STORE SETTINGS +#================================================= + public_ip4="$(curl -s ip.yunohost.org)" || true fingerprint=$(cat /etc/opt/simplex/fingerprint) ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 @@ -49,7 +53,7 @@ chmod +x $install_dir/smp-server #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=4 # Create a dedicated systemd config ynh_add_systemd_config