1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mosquitto_ynh.git synced 2024-09-03 19:45:54 +02:00

Merge pull request #8 from YunoHost-Apps/bullseye

Bullseye and linter
This commit is contained in:
grenagit 2023-04-22 11:08:34 +02:00 committed by GitHub
commit c3cf709400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 29 additions and 44 deletions

View file

@ -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). [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 **Demo:** https://test.mosquitto.org
## Disclaimers / important information
## TODO
- [ ] Add MQTTS (MQTT with TLS)
## Documentation and resources ## Documentation and resources
* Official app website: <https://mosquitto.org> * Official app website: <https://mosquitto.org>
* Official user documentation: <https://yunohost.org/apps>
* Official admin documentation: <https://mosquitto.org/documentation/> * Official admin documentation: <https://mosquitto.org/documentation/>
* Upstream app code repository: <https://github.com/eclipse/mosquitto> * Upstream app code repository: <https://github.com/eclipse/mosquitto>
* YunoHost documentation for this app: <https://yunohost.org/app_mosquitto> * YunoHost documentation for this app: <https://yunohost.org/app_mosquitto>

View file

@ -19,19 +19,12 @@ Si vous navez 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). [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 **Démo :** https://test.mosquitto.org
## Avertissements / informations importantes
## A faire
- [ ] Ajouter MQTTS (MQTT avec TLS)
## Documentations et ressources ## Documentations et ressources
* Site officiel de lapp : <https://mosquitto.org> * Site officiel de lapp : <https://mosquitto.org>
* Documentation officielle utilisateur : <https://yunohost.org/apps>
* Documentation officielle de ladmin : <https://mosquitto.org/documentation/> * Documentation officielle de ladmin : <https://mosquitto.org/documentation/>
* Dépôt de code officiel de lapp : <https://github.com/eclipse/mosquitto> * Dépôt de code officiel de lapp : <https://github.com/eclipse/mosquitto>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_mosquitto> * Documentation YunoHost pour cette app : <https://yunohost.org/app_mosquitto>

View file

@ -1,16 +1,14 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
username="mosquitto" username="mosquitto"
password="pass" userpass="mosquitto"
port="1883" port="1883"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_nourl=1 setup_nourl=1
upgrade=1 upgrade=1
# 1.5.7~ynh1 # 2.0.12~ynh1
upgrade=1 from_commit=3423395180264623342ee41946d10f30cd38e471 upgrade=1 from_commit=eb74d6d63a8bc8561d124429c9fa3bdb8f6af7a0
# 2.0.8~ynh1
upgrade=1 from_commit=74185f9e1fb58a91271cfc24630029da662b6111
backup_restore=1 backup_restore=1
port_already_use=1 (1883) port_already_use=1 (1883)
;;; Options ;;; Options

View file

@ -1 +1 @@
__USERNAME__:__PASSWORD__ __USERNAME__:__USERPASS__

View file

@ -1,3 +0,0 @@
## TODO
- [ ] Add MQTTS (MQTT with TLS)

View file

@ -1,3 +0,0 @@
## A faire
- [ ] Ajouter MQTTS (MQTT avec TLS)

View file

@ -6,14 +6,13 @@
"en": "Interconnect your objects and applications with an open source MQTT broker", "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" "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/", "url": "https://mosquitto.org/",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",
"website": "https://mosquitto.org", "website": "https://mosquitto.org",
"demo": "https://test.mosquitto.org", "demo": "https://test.mosquitto.org",
"admindoc": "https://mosquitto.org/documentation/", "admindoc": "https://mosquitto.org/documentation/",
"userdoc": "https://yunohost.org/apps",
"code": "https://github.com/eclipse/mosquitto", "code": "https://github.com/eclipse/mosquitto",
"cpe": "cpe:2.3:a:eclipse:mosquitto" "cpe": "cpe:2.3:a:eclipse:mosquitto"
}, },
@ -23,7 +22,7 @@
"email": "grena+mosquitto@grenabox.fr" "email": "grena+mosquitto@grenabox.fr"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.3.0" "yunohost": ">= 11.0.0"
}, },
"multi_instance": false, "multi_instance": false,
"services": [], "services": [],
@ -32,7 +31,7 @@
{ {
"name": "username", "name": "username",
"type": "string", "type": "string",
"ask": { "ask": {
"en": "Set the username for client authentication", "en": "Set the username for client authentication",
"fr": "Définissez le nom d'utilisateur pour l'authentification du client" "fr": "Définissez le nom d'utilisateur pour l'authentification du client"
}, },
@ -40,14 +39,13 @@
"default": "mosquitto" "default": "mosquitto"
}, },
{ {
"name": "password", "name": "userpass",
"type": "password", "type": "password",
"ask": { "ask": {
"en": "Set the password for client authentication", "en": "Set the password for client authentication",
"fr": "Définissez le mot de passe pour l'authentification du client" "fr": "Définissez le mot de passe pour l'authentification du client"
}, }
"example": "Choose a password"
} }
] ]
} }
} }

View file

@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
username=$(ynh_app_setting_get --app=$app --key=username) 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 # DECLARE DATA AND CONF FILES TO BACKUP

View file

@ -21,7 +21,7 @@ ynh_abort_if_errors
#================================================= #=================================================
username=$YNH_APP_ARG_USERNAME username=$YNH_APP_ARG_USERNAME
password=$YNH_APP_ARG_PASSWORD userpass=$YNH_APP_ARG_USERPASS
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -31,7 +31,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Storing installation settings..." --weight=1 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=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 # 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_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 # 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" ynh_add_config --template="../conf/passwd" --destination="/etc/mosquitto/passwd"
mosquitto_passwd -U "/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" ynh_add_config --template="../conf/mosquitto.conf" --destination="/etc/mosquitto/conf.d/default.conf"

View file

@ -26,7 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
username=$(ynh_app_setting_get --app=$app --key=username) 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 # SPECIFIC RESTORATION
@ -35,7 +35,7 @@ password=$(ynh_app_setting_get --app=$app --key=password)
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=20 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 # RESTORE VARIOUS FILES

View file

@ -18,7 +18,14 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
username=$(ynh_app_setting_get --app=$app --key=username) 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 # CHECK VERSION
@ -60,7 +67,7 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=10 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 # 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" ynh_add_config --template="../conf/passwd" --destination="/etc/mosquitto/passwd"
mosquitto_passwd -U "/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" ynh_add_config --template="../conf/mosquitto.conf" --destination="/etc/mosquitto/conf.d/default.conf"