diff --git a/README.md b/README.md index b778c6b..b85280e 100644 --- a/README.md +++ b/README.md @@ -19,19 +19,12 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in [Mosquitto](https://mosquitto.org/) gives you interconnect your objects and applications with an open source MQTT broker. Client can publish or subscribe after authentication (username, password). -**Shipped version:** 2.0.12~ynh1 +**Shipped version:** 2.0.14~ynh1 **Demo:** https://test.mosquitto.org -## Disclaimers / important information - -## TODO - -- [ ] Add MQTTS (MQTT with TLS) - ## Documentation and resources * Official app website: -* Official user documentation: * Official admin documentation: * Upstream app code repository: * YunoHost documentation for this app: diff --git a/README_fr.md b/README_fr.md index e82f670..eff294b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,19 +19,12 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po [Mosquitto](https://mosquitto.org/) vous permet d'interconnecter vos objets et applications avec un broker MQTT open source. Le client peut publier ou s'abonner après authentification (nom d'utilisateur, mot de passe). -**Version incluse :** 2.0.12~ynh1 +**Version incluse :** 2.0.14~ynh1 **Démo :** https://test.mosquitto.org -## Avertissements / informations importantes - -## A faire - -- [ ] Ajouter MQTTS (MQTT avec TLS) - ## Documentations et ressources * Site officiel de l’app : -* Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : diff --git a/check_process b/check_process index 3d91424..47b83d8 100644 --- a/check_process +++ b/check_process @@ -1,16 +1,14 @@ ;; Test complet ; Manifest username="mosquitto" - password="pass" + userpass="mosquitto" port="1883" ; Checks pkg_linter=1 setup_nourl=1 upgrade=1 - # 1.5.7~ynh1 - upgrade=1 from_commit=3423395180264623342ee41946d10f30cd38e471 - # 2.0.8~ynh1 - upgrade=1 from_commit=74185f9e1fb58a91271cfc24630029da662b6111 + # 2.0.12~ynh1 + upgrade=1 from_commit=eb74d6d63a8bc8561d124429c9fa3bdb8f6af7a0 backup_restore=1 port_already_use=1 (1883) ;;; Options diff --git a/conf/passwd b/conf/passwd index 8728ca2..e8bc0de 100644 --- a/conf/passwd +++ b/conf/passwd @@ -1 +1 @@ -__USERNAME__:__PASSWORD__ +__USERNAME__:__USERPASS__ diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index 2a8b9dd..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,3 +0,0 @@ -## TODO - -- [ ] Add MQTTS (MQTT with TLS) diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md deleted file mode 100644 index 2a4c3bf..0000000 --- a/doc/DISCLAIMER_fr.md +++ /dev/null @@ -1,3 +0,0 @@ -## A faire - -- [ ] Ajouter MQTTS (MQTT avec TLS) diff --git a/manifest.json b/manifest.json index a4a0a48..c4b8e52 100644 --- a/manifest.json +++ b/manifest.json @@ -6,14 +6,13 @@ "en": "Interconnect your objects and applications with an open source MQTT broker", "fr": "Interconnecter vos objets et vos applications grâce à un serveur MQTT open source" }, - "version": "2.0.12~ynh1", + "version": "2.0.14~ynh1", "url": "https://mosquitto.org/", "upstream": { "license": "MIT", "website": "https://mosquitto.org", "demo": "https://test.mosquitto.org", "admindoc": "https://mosquitto.org/documentation/", - "userdoc": "https://yunohost.org/apps", "code": "https://github.com/eclipse/mosquitto", "cpe": "cpe:2.3:a:eclipse:mosquitto" }, @@ -23,7 +22,7 @@ "email": "grena+mosquitto@grenabox.fr" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.0" }, "multi_instance": false, "services": [], @@ -32,7 +31,7 @@ { "name": "username", "type": "string", - "ask": { + "ask": { "en": "Set the username for client authentication", "fr": "Définissez le nom d'utilisateur pour l'authentification du client" }, @@ -40,14 +39,13 @@ "default": "mosquitto" }, { - "name": "password", + "name": "userpass", "type": "password", "ask": { "en": "Set the password for client authentication", "fr": "Définissez le mot de passe pour l'authentification du client" - }, - "example": "Choose a password" + } } ] } -} \ No newline at end of file +} diff --git a/scripts/backup b/scripts/backup index eee2ccf..10637f0 100755 --- a/scripts/backup +++ b/scripts/backup @@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME port=$(ynh_app_setting_get --app=$app --key=port) username=$(ynh_app_setting_get --app=$app --key=username) -password=$(ynh_app_setting_get --app=$app --key=password) +userpass=$(ynh_app_setting_get --app=$app --key=userpass) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/install b/scripts/install index 9af97f0..b9f40a8 100644 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= username=$YNH_APP_ARG_USERNAME -password=$YNH_APP_ARG_PASSWORD +userpass=$YNH_APP_ARG_USERPASS app=$YNH_APP_INSTANCE_NAME @@ -31,7 +31,7 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=username --value=$username -ynh_app_setting_set --app=$app --key=password --value=$password +ynh_app_setting_set --app=$app --key=userpass --value=$userpass #================================================= # STANDARD MODIFICATIONS @@ -53,7 +53,7 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port #================================================= ynh_script_progression --message="Installing dependencies..." --weight=20 -ynh_install_extra_app_dependencies --repo="deb https://repo.mosquitto.org/debian buster main" --package="$extra_pkg_dependencies" --key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key" --name="$app" +ynh_install_extra_app_dependencies --repo="deb https://repo.mosquitto.org/debian bullseye main" --package="$extra_pkg_dependencies" --key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key" --name="$app" #================================================= # SPECIFIC SETUP @@ -64,6 +64,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/passwd" --destination="/etc/mosquitto/passwd" mosquitto_passwd -U "/etc/mosquitto/passwd" +ynh_store_file_checksum --file="/etc/mosquitto/passwd" ynh_add_config --template="../conf/mosquitto.conf" --destination="/etc/mosquitto/conf.d/default.conf" diff --git a/scripts/restore b/scripts/restore index f261028..bbb2a48 100755 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME port=$(ynh_app_setting_get --app=$app --key=port) username=$(ynh_app_setting_get --app=$app --key=username) -password=$(ynh_app_setting_get --app=$app --key=password) +userpass=$(ynh_app_setting_get --app=$app --key=userpass) #================================================= # SPECIFIC RESTORATION @@ -35,7 +35,7 @@ password=$(ynh_app_setting_get --app=$app --key=password) #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=20 -ynh_install_extra_app_dependencies --repo="deb https://repo.mosquitto.org/debian buster main" --package="$extra_pkg_dependencies" --key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key" --name="$app" +ynh_install_extra_app_dependencies --repo="deb https://repo.mosquitto.org/debian bullseye main" --package="$extra_pkg_dependencies" --key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key" --name="$app" #================================================= # RESTORE VARIOUS FILES diff --git a/scripts/upgrade b/scripts/upgrade index fb44682..bb6c716 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,14 @@ app=$YNH_APP_INSTANCE_NAME port=$(ynh_app_setting_get --app=$app --key=port) username=$(ynh_app_setting_get --app=$app --key=username) -password=$(ynh_app_setting_get --app=$app --key=password) +userpass=$(ynh_app_setting_get --app=$app --key=userpass) + +# Transfer and delete the old "password" key +if [ -z "$userpass" ]; then + ynh_app_setting_set --app=$app --key=userpass --value=$(ynh_app_setting_get --app=$app --key=password) + ynh_app_setting_delete --app=$app --key=password + userpass=$(ynh_app_setting_get --app=$app --key=userpass) +fi #================================================= # CHECK VERSION @@ -60,7 +67,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=10 -ynh_install_extra_app_dependencies --repo="deb https://repo.mosquitto.org/debian buster main" --package="$extra_pkg_dependencies" --key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key" --name="$app" +ynh_install_extra_app_dependencies --repo="deb https://repo.mosquitto.org/debian bullseye main" --package="$extra_pkg_dependencies" --key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key" --name="$app" #================================================= # SPECIFIC UPGRADE @@ -71,6 +78,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_add_config --template="../conf/passwd" --destination="/etc/mosquitto/passwd" mosquitto_passwd -U "/etc/mosquitto/passwd" +ynh_store_file_checksum --file="/etc/mosquitto/passwd" ynh_add_config --template="../conf/mosquitto.conf" --destination="/etc/mosquitto/conf.d/default.conf"