diff --git a/README.md b/README.md
index 04e4120..7925851 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,7 @@ It shall NOT be edited by hand.
# SimpleX for YunoHost
[](https://dash.yunohost.org/appci/app/simplex)  
+
[](https://install-app.yunohost.org/?app=simplex)
*[Lire ce readme en français.](./README_fr.md)*
@@ -23,27 +24,6 @@ SimpleX - the first messaging platform operating without user identifiers of any

-## 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.
-
-[
](https://apps.apple.com/us/app/simplex-chat/id1605771084)
-
-[](https://play.google.com/store/apps/details?id=chat.simplex.app)
-
-[
](https://app.simplex.chat)
-
-
## Documentation and resources
* Official app website:
diff --git a/README_fr.md b/README_fr.md
index 631b304..2e369a1 100644
--- a/README_fr.md
+++ b/README_fr.md
@@ -6,6 +6,7 @@ It shall NOT be edited by hand.
# SimpleX pour YunoHost
[](https://dash.yunohost.org/appci/app/simplex)  
+
[](https://install-app.yunohost.org/?app=simplex)
*[Read this readme in english.](./README.md)*
@@ -23,27 +24,6 @@ SimpleX - la première plate-forme de messagerie qui n'a aucun identifiant d'uti

-## 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.
-
-[
](https://apps.apple.com/us/app/simplex-chat/id1605771084)
-
-[](https://play.google.com/store/apps/details?id=chat.simplex.app)
-
-[
](https://app.simplex.chat)
-
-
## Documentations et ressources
* Site officiel de l’app :
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/conf/systemd.service b/conf/systemd.service
index 0b31170..0db7783 100644
--- a/conf/systemd.service
+++ b/conf/systemd.service
@@ -1,13 +1,13 @@
[Unit]
-Description=SimpleX: messaging Protocol Server
+Description=SimpleX: Messaging Protocol Server
After=network.target
[Service]
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/doc/DISCLAIMER.md b/doc/ADMIN.md
similarity index 78%
rename from doc/DISCLAIMER.md
rename to doc/ADMIN.md
index 79f58fd..40a65a8 100644
--- a/doc/DISCLAIMER.md
+++ b/doc/ADMIN.md
@@ -1,11 +1,7 @@
-### 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://YOUR_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/DISCLAIMER_fr.md b/doc/ADMIN_fr.md
similarity index 76%
rename from doc/DISCLAIMER_fr.md
rename to doc/ADMIN_fr.md
index ab52f39..c725c68 100644
--- a/doc/DISCLAIMER_fr.md
+++ b/doc/ADMIN_fr.md
@@ -1,11 +1,7 @@
-### 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://YOUR_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/doc/POST_INSTALL.md b/doc/POST_INSTALL.md
new file mode 100644
index 0000000..972dca1
--- /dev/null
+++ b/doc/POST_INSTALL.md
@@ -0,0 +1,4 @@
+Your SMP server address:
+
+smp://__FINGERPRINT__@__PUBLIC_IP4__:__PORT__
+
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__
+
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
new file mode 100644
index 0000000..d06e529
--- /dev/null
+++ b/manifest.toml
@@ -0,0 +1,41 @@
+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 = "cpe:2.3:a:simplex:simplex_chat"
+fund = "https://opencollective.com/simplex-chat"
+
+[integration]
+yunohost = ">= 11.1.13"
+architectures = ["amd64"]
+multi_instance = false
+ldap = "not_relevant"
+sso = "not_relevant"
+disk = "50M"
+ram.build = "150M"
+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 2f0fd0e..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
-#=================================================
-
-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
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_print_info --message="Loading installation settings..."
-
-app=$YNH_APP_INSTANCE_NAME
-
-final_path=$(ynh_app_setting_get --app=$app --key=final_path)
-
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
@@ -39,7 +19,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/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 f1be40c..bd759cf 100755
--- a/scripts/install
+++ b/scripts/install
@@ -9,77 +9,31 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-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
-
-#=================================================
-# RETRIEVE ARGUMENTS FROM THE MANIFEST
-#=================================================
-
-app=$YNH_APP_INSTANCE_NAME
-
-#=================================================
-# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
-#=================================================
-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"
-
-#=================================================
-# STANDARD MODIFICATIONS
-#=================================================
-# FIND AND OPEN A PORT
-#=================================================
-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
-
-# 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
-#=================================================
-ynh_script_progression --message="Configuring system user..." --weight=1
-
-# Create a system user
-ynh_system_user_create --username=$app --home_dir="$final_path"
-
#=================================================
# 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
# 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 -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
+ 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"
#=================================================
diff --git a/scripts/remove b/scripts/remove
index f70a931..5c641e2 100755
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,15 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-app=$YNH_APP_INSTANCE_NAME
-
-port=$(ynh_app_setting_get --app=$app --key=port)
-
#=================================================
# STANDARD REMOVE
#=================================================
@@ -42,33 +33,13 @@ 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"
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
-#=================================================
-ynh_script_progression --message="Removing the dedicated system user..." --weight=1
-
-# Delete a system user
-ynh_system_user_delete --username=$app
-
#=================================================
# END OF SCRIPT
#=================================================
diff --git a/scripts/restore b/scripts/restore
index 4ddfdeb..6d34450 100755
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,55 +10,15 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# MANAGE SCRIPT FAILURE
-#=================================================
-
-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
-
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-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)
-
-#=================================================
-# CHECK IF THE APP CAN BE RESTORED
-#=================================================
-ynh_script_progression --message="Validating restoration parameters..." --weight=1
-
-test ! -d $final_path \
- || ynh_die --message="There is already a directory: $final_path "
-
-#=================================================
-# STANDARD RESTORATION STEPS
-#=================================================
-# RECREATE THE DEDICATED USER
-#=================================================
-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"
-
#=================================================
# 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 -R o-rwx "$install_dir"
+chown -R $app:www-data "$install_dir"
#=================================================
# RESTORE SYSTEMD
diff --git a/scripts/upgrade b/scripts/upgrade
index a5cb373..256d212 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,36 +9,12 @@
source _common.sh
source /usr/share/yunohost/helpers
-#=================================================
-# LOAD SETTINGS
-#=================================================
-ynh_script_progression --message="Loading installation settings..." --weight=1
-
-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)
-
#=================================================
# CHECK VERSION
#=================================================
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
-
-# Backup the current version of the app
-ynh_backup_before_upgrade
-ynh_clean_setup () {
- # Restore it if the upgrade fails
- ynh_restore_upgradebackup
-}
-# Exit if an error occurs during the execution of the script
-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
-#=================================================
-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"
-
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@@ -65,12 +33,11 @@ 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 -R o-rwx "$install_dir"
+chown -R $app:www-data "$install_dir"
#=================================================
# SETUP SYSTEMD
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]