mirror of
https://github.com/YunoHost-Apps/mosquitto_ynh.git
synced 2024-09-03 19:45:54 +02:00
Merge branch 'testing'
This commit is contained in:
commit
e140eb4c31
20 changed files with 154 additions and 238 deletions
|
@ -8,7 +8,7 @@ about: When creating a bug report, please use the following template to provide
|
||||||
1. *Read this whole template first.*
|
1. *Read this whole template first.*
|
||||||
2. *Determine if you are on the right place:*
|
2. *Determine if you are on the right place:*
|
||||||
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
||||||
- *Otherwise, the issue may be due to mosquitto itself. Refer to its documentation or repository for help.*
|
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
|
||||||
- *When in doubt, post here and we will figure it out together.*
|
- *When in doubt, post here and we will figure it out together.*
|
||||||
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||||
---
|
---
|
||||||
|
@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide
|
||||||
|
|
||||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||||
```sh
|
```sh
|
||||||
sudo yunohost app install mosquitto
|
sudo yunohost app install the_app
|
||||||
```
|
```
|
||||||
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
||||||
- *If the error occurs in your browser, explain what you did:*
|
- *If the error occurs in your browser, explain what you did:*
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
## Problem
|
||||||
|
|
||||||
|
- *Description of why you made this PR*
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
|
||||||
|
- *And how do you fix that problem*
|
||||||
|
|
||||||
|
## PR Status
|
||||||
|
|
||||||
|
- [ ] Code finished and ready to be reviewed/tested
|
||||||
|
- [ ] The fix/enhancement were manually tested (if applicable)
|
||||||
|
|
||||||
|
## Automatic tests
|
||||||
|
|
||||||
|
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
|
55
README.md
55
README.md
|
@ -1,9 +1,11 @@
|
||||||
# Mosquitto (MQTT Broker) for YunoHost
|
<!--
|
||||||
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||||
|
It shall NOT be edited by hand.
|
||||||
|
-->
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/mosquitto.svg)](https://dash.yunohost.org/appci/app/mosquitto)
|
# Mosquitto for YunoHost
|
||||||
![](https://ci-apps.yunohost.org/ci/badges/mosquitto.status.svg)
|
|
||||||
![](https://ci-apps.yunohost.org/ci/badges/mosquitto.maintain.svg)
|
|
||||||
|
|
||||||
|
[![Integration level](https://dash.yunohost.org/integration/mosquitto.svg)](https://dash.yunohost.org/appci/app/mosquitto) ![Working status](https://ci-apps.yunohost.org/ci/badges/mosquitto.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mosquitto.maintain.svg)
|
||||||
[![Install Mosquitto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mosquitto)
|
[![Install Mosquitto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mosquitto)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
@ -15,50 +17,35 @@ 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.8
|
|
||||||
|
|
||||||
## Configuration
|
**Shipped version:** 2.0.12~ynh1
|
||||||
|
|
||||||
How to configure this app: From an admin panel or a plain file with SSH.
|
**Demo:** https://test.mosquitto.org
|
||||||
|
## Disclaimers / important information
|
||||||
|
|
||||||
## Documentation
|
## TODO
|
||||||
|
|
||||||
* Official documentation: https://mosquitto.org/documentation/
|
- [ ] Add MQTTS (MQTT with TLS)
|
||||||
|
|
||||||
## YunoHost specific features
|
## Documentation and resources
|
||||||
|
|
||||||
#### Multi-user support
|
* Official app website: <https://mosquitto.org>
|
||||||
|
* Official user documentation: <https://yunohost.org/apps>
|
||||||
* Are LDAP and HTTP auth supported? **No**
|
* Official admin documentation: <https://mosquitto.org/documentation/>
|
||||||
* Can the app be used by multiple users? **No**
|
* Upstream app code repository: <https://github.com/eclipse/mosquitto>
|
||||||
|
* YunoHost documentation for this app: <https://yunohost.org/app_mosquitto>
|
||||||
#### Supported architectures
|
* Report a bug: <https://github.com/YunoHost-Apps/mosquitto_ynh/issues>
|
||||||
|
|
||||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mosquitto.svg)](https://ci-apps.yunohost.org/ci/apps/mosquitto/)
|
|
||||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mosquitto.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mosquitto/)
|
|
||||||
|
|
||||||
## Links
|
|
||||||
|
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/mosquitto_ynh/issues
|
|
||||||
* App website: https://mosquitto.org/
|
|
||||||
* Upstream app repository: https://github.com/eclipse/mosquitto
|
|
||||||
* YunoHost website: https://yunohost.org/
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Developer info
|
## Developer info
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing).
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade mosquitto -u https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
sudo yunohost app upgrade mosquitto -u https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||||
|
|
||||||
## Todo
|
|
||||||
|
|
||||||
- [ ] Add MQTTS (MQTT with TLS)
|
|
||||||
|
|
57
README_fr.md
57
README_fr.md
|
@ -1,64 +1,51 @@
|
||||||
# Mosquitto (broker MQTT) pour YunoHost
|
<!--
|
||||||
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||||
|
It shall NOT be edited by hand.
|
||||||
|
-->
|
||||||
|
|
||||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/mosquitto.svg)](https://dash.yunohost.org/appci/app/mosquitto)
|
# Mosquitto pour YunoHost
|
||||||
![](https://ci-apps.yunohost.org/ci/badges/mosquitto.status.svg)
|
|
||||||
![](https://ci-apps.yunohost.org/ci/badges/mosquitto.maintain.svg)
|
|
||||||
|
|
||||||
|
[![Niveau d'intégration](https://dash.yunohost.org/integration/mosquitto.svg)](https://dash.yunohost.org/appci/app/mosquitto) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mosquitto.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mosquitto.maintain.svg)
|
||||||
[![Installer Mosquitto avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mosquitto)
|
[![Installer Mosquitto avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mosquitto)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
|
|
||||||
> *Ce package vous permet d'installer Mosquitto rapidement et simplement sur un serveur YunoHost.
|
> *Ce package vous permet d'installer Mosquitto rapidement et simplement sur un serveur YunoHost.
|
||||||
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
|
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||||
|
|
||||||
## Vue d'ensemble
|
## Vue d'ensemble
|
||||||
|
|
||||||
[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.8
|
|
||||||
|
|
||||||
## Configuration
|
**Version incluse :** 2.0.12~ynh1
|
||||||
|
|
||||||
Comment configurer cette application : via le panneau d'administration ou un fichier brut en SSH.
|
**Démo :** https://test.mosquitto.org
|
||||||
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
## Documentation
|
## A faire
|
||||||
|
|
||||||
* Documentation officielle : https://mosquitto.org/documentation/
|
- [ ] Ajouter MQTTS (MQTT avec TLS)
|
||||||
|
|
||||||
## Caractéristiques spécifiques YunoHost
|
## Documentations et ressources
|
||||||
|
|
||||||
#### Support multi-utilisateur
|
* Site officiel de l'app : <https://mosquitto.org>
|
||||||
|
* Documentation officielle utilisateur : <https://yunohost.org/apps>
|
||||||
* L'authentification LDAP et HTTP est-elle prise en charge ? **Non**
|
* Documentation officielle de l'admin : <https://mosquitto.org/documentation/>
|
||||||
* L'application peut-elle être utilisée par plusieurs utilisateurs ? **Non**
|
* Dépôt de code officiel de l'app : <https://github.com/eclipse/mosquitto>
|
||||||
|
* Documentation YunoHost pour cette app : <https://yunohost.org/app_mosquitto>
|
||||||
#### Architectures supportées
|
* Signaler un bug : <https://github.com/YunoHost-Apps/mosquitto_ynh/issues>
|
||||||
|
|
||||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mosquitto.svg)](https://ci-apps.yunohost.org/ci/apps/mosquitto/)
|
|
||||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mosquitto.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mosquitto/)
|
|
||||||
|
|
||||||
## Liens
|
|
||||||
|
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/mosquitto_ynh/issues
|
|
||||||
* Site de l'application : https://mosquitto.org/
|
|
||||||
* Dépôt de l'application principale : https://github.com/eclipse/mosquitto
|
|
||||||
* Site web YunoHost : https://yunohost.org/
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing).
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing).
|
||||||
|
|
||||||
Pour essayer la branche testing, procédez comme suit.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
||||||
ou
|
ou
|
||||||
sudo yunohost app upgrade mosquitto -u https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
sudo yunohost app upgrade mosquitto -u https://github.com/YunoHost-Apps/mosquitto_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||||
|
|
||||||
## A faire
|
|
||||||
|
|
||||||
- [ ] Ajouter MQTTS (MQTT avec TLS)
|
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_nourl=1
|
setup_nourl=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
|
# 1.5.7~ynh1
|
||||||
upgrade=1 from_commit=3423395180264623342ee41946d10f30cd38e471
|
upgrade=1 from_commit=3423395180264623342ee41946d10f30cd38e471
|
||||||
|
# 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
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
listener __PORT__
|
listener __PORT__
|
||||||
|
|
||||||
allow_anonymous false
|
allow_anonymous false
|
||||||
password_file __PASSWORD_FILE__
|
password_file /etc/mosquitto/passwd
|
||||||
|
|
0
doc/.gitkeep
Normal file
0
doc/.gitkeep
Normal file
1
doc/DESCRIPTION.md
Normal file
1
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[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).
|
1
doc/DESCRIPTION_fr.md
Normal file
1
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[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).
|
3
doc/DISCLAIMER.md
Normal file
3
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
- [ ] Add MQTTS (MQTT with TLS)
|
3
doc/DISCLAIMER_fr.md
Normal file
3
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
## A faire
|
||||||
|
|
||||||
|
- [ ] Ajouter MQTTS (MQTT avec TLS)
|
0
doc/screenshots/.gitkeep
Normal file
0
doc/screenshots/.gitkeep
Normal file
|
@ -6,15 +6,23 @@
|
||||||
"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.8~ynh1",
|
"version": "2.0.12~ynh1",
|
||||||
"url": "https://mosquitto.org/",
|
"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"
|
||||||
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Grena",
|
"name": "Grena",
|
||||||
"email": "grena+mosquitto@grenabox.fr"
|
"email": "grena+mosquitto@grenabox.fr"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.1.0"
|
"yunohost": ">= 4.3.0"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [],
|
"services": [],
|
||||||
|
@ -42,4 +50,3 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
## Problem
|
|
||||||
- *Description of why you made this PR*
|
|
||||||
|
|
||||||
## Solution
|
|
||||||
- *And how do you fix that problem*
|
|
||||||
|
|
||||||
## PR Status
|
|
||||||
- [ ] Code finished.
|
|
||||||
- [ ] Tested with Package_check.
|
|
||||||
- [ ] Fix or enhancement tested.
|
|
||||||
- [ ] Upgrade from last version tested.
|
|
||||||
- [ ] Can be reviewed and tested.
|
|
||||||
|
|
||||||
## Package_check results
|
|
||||||
---
|
|
||||||
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
|
|
|
@ -4,16 +4,8 @@
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# files used by the app
|
|
||||||
password_file="/etc/mosquitto/passwd"
|
|
||||||
config_file="/etc/mosquitto/conf.d/default.conf"
|
|
||||||
|
|
||||||
# extra repository used by the app
|
|
||||||
extra_repo="deb https://repo.mosquitto.org/debian buster main"
|
|
||||||
extra_repo_key="http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key"
|
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="mosquitto"
|
extra_pkg_dependencies="mosquitto"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -33,13 +33,6 @@ password=$(ynh_app_setting_get --app=$app --key=password)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
|
||||||
#ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -53,14 +46,13 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Backup the passwd file
|
# Backup the passwd file
|
||||||
ynh_backup --src_path="$password_file"
|
ynh_backup --src_path="/etc/mosquitto/passwd"
|
||||||
|
|
||||||
# Backup the config file
|
# Backup the config file
|
||||||
ynh_backup --src_path="$config_file"
|
ynh_backup --src_path="/etc/mosquitto/conf.d/default.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@ ynh_abort_if_errors
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
|
||||||
|
|
||||||
username=$YNH_APP_ARG_USERNAME
|
username=$YNH_APP_ARG_USERNAME
|
||||||
password=$YNH_APP_ARG_PASSWORD
|
password=$YNH_APP_ARG_PASSWORD
|
||||||
|
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -53,38 +53,19 @@ 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="$extra_repo" --package="$pkg_dependencies" --key="$extra_repo_key" --name="$app"
|
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"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
# CONFIGURE MOSQUITTO
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring Mosquitto Password..." --weight=1
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
cp ../conf/passwd "$password_file"
|
ynh_add_config --template="../conf/passwd" --destination="/etc/mosquitto/passwd"
|
||||||
|
mosquitto_passwd -U "/etc/mosquitto/passwd"
|
||||||
|
|
||||||
ynh_replace_string --match_string="__USERNAME__" --replace_string="$username" --target_file="$password_file"
|
ynh_add_config --template="../conf/mosquitto.conf" --destination="/etc/mosquitto/conf.d/default.conf"
|
||||||
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$password_file"
|
|
||||||
mosquitto_passwd -U "$password_file"
|
|
||||||
|
|
||||||
ynh_store_file_checksum --file="$password_file"
|
|
||||||
|
|
||||||
ynh_script_progression --message="Configuring Mosquitto..." --weight=1
|
|
||||||
|
|
||||||
cp ../conf/mosquitto.conf "$config_file"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
|
|
||||||
ynh_replace_string --match_string="__PASSWORD_FILE__" --replace_string="$password_file" --target_file="$config_file"
|
|
||||||
|
|
||||||
ynh_store_file_checksum --file="$config_file"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTART SYSTEMD SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restarting systemd service..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action=restart
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -104,16 +85,15 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
yunohost service add $app --description="Allows MQTT clients to send/receive data" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port"
|
yunohost service add $app --description="Allows MQTT clients to send/receive data" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring Fail2Ban..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# Start a systemd service
|
||||||
#ynh_add_fail2ban_config --logpath="/var/log/$app/$app.log" --ports="$port" --failregex="Regex to match into the log for a failed login"
|
ynh_systemd_action --service_name=$app --action="restart"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation of $app completed" --last
|
ynh_script_progression --message="Installation of $app completed" --last
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=2
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
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)
|
|
||||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -41,14 +39,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing dependencies..." --weight=6
|
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
# REMOVE LOGROTATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -57,6 +47,14 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing dependencies..." --weight=6
|
||||||
|
|
||||||
|
# Remove metapackage and its dependencies
|
||||||
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CLOSE A PORT
|
# CLOSE A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -67,14 +65,6 @@ then
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing Fail2ban configuration..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated Fail2Ban config
|
|
||||||
#ynh_remove_fail2ban_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -86,14 +76,13 @@ ynh_script_progression --message="Removing various files..." --weight=1
|
||||||
ynh_secure_remove --file="/var/log/$app/$app.log"
|
ynh_secure_remove --file="/var/log/$app/$app.log"
|
||||||
|
|
||||||
# Remove the passwd file
|
# Remove the passwd file
|
||||||
ynh_secure_remove --file="$password_file"
|
ynh_secure_remove --file="/etc/mosquitto/passwd"
|
||||||
|
|
||||||
# Remove the config file
|
# Remove the config file
|
||||||
ynh_secure_remove --file="$config_file"
|
ynh_secure_remove --file="/etc/mosquitto/conf.d/default.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Removal of $app completed" --last
|
ynh_script_progression --message="Removal of $app completed" --last
|
||||||
|
|
||||||
|
|
|
@ -28,17 +28,6 @@ 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)
|
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD RESTORATION STEPS
|
|
||||||
#=================================================
|
|
||||||
# RESTORE FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=1
|
|
||||||
|
|
||||||
#ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
|
||||||
#ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
|
||||||
#ynh_systemd_action --action=restart --service_name=fail2ban
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -46,7 +35,25 @@ ynh_script_progression --message="Restoring the Fail2Ban configuration..." --wei
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=20
|
ynh_script_progression --message="Reinstalling dependencies..." --weight=20
|
||||||
|
|
||||||
ynh_install_extra_app_dependencies --repo="$extra_repo" --package="$pkg_dependencies" --key="$extra_repo_key" --name="$app"
|
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"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE VARIOUS FILES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring various files..." --weight=1
|
||||||
|
|
||||||
|
# Restore the passwd file
|
||||||
|
ynh_restore_file --origin_path="/etc/mosquitto/passwd"
|
||||||
|
|
||||||
|
# Restore the config file
|
||||||
|
ynh_restore_file --origin_path="/etc/mosquitto/conf.d/default.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE LOGROTATE CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
|
@ -56,33 +63,16 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
yunohost service add $app --description="Allows MQTT clients to send/receive data" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port"
|
yunohost service add $app --description="Allows MQTT clients to send/receive data" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the Mosquitto configuration..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Restore the passwd file
|
ynh_systemd_action --service_name=$app --action="restart"
|
||||||
ynh_restore_file --origin_path="$password_file"
|
|
||||||
|
|
||||||
# Restore the config file
|
|
||||||
ynh_restore_file --origin_path="$config_file"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTART SYSTEMD SERVICE
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restarting systemd service..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action=restart
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the log rotation..." --weight=1
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoration completed for $app" --last
|
ynh_script_progression --message="Restoration completed for $app" --last
|
||||||
|
|
||||||
|
|
|
@ -23,14 +23,10 @@ password=$(ynh_app_setting_get --app=$app --key=password)
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Checking version..."
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -47,51 +43,37 @@ ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
|
#=================================================
|
||||||
|
# STOP SYSTEMD SERVICE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Stopping a systemd service..."
|
||||||
|
|
||||||
|
ynh_systemd_action --service_name=$app --action="stop"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=10
|
ynh_script_progression --message="Upgrading dependencies..." --weight=10
|
||||||
|
|
||||||
ynh_install_extra_app_dependencies --repo="$extra_repo" --package="$pkg_dependencies" --key="$extra_repo_key" --name="$app"
|
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"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring Mosquitto Password..." --weight=1
|
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
||||||
|
|
||||||
# Verify the checksum and backup the file if it's different.
|
ynh_add_config --template="../conf/passwd" --destination="/etc/mosquitto/passwd"
|
||||||
ynh_backup_if_checksum_is_different --file="$password_file"
|
mosquitto_passwd -U "/etc/mosquitto/passwd"
|
||||||
|
|
||||||
cp ../conf/passwd "$password_file"
|
ynh_add_config --template="../conf/mosquitto.conf" --destination="/etc/mosquitto/conf.d/default.conf"
|
||||||
|
|
||||||
ynh_replace_string --match_string="__USERNAME__" --replace_string="$username" --target_file="$password_file"
|
|
||||||
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$password_file"
|
|
||||||
mosquitto_passwd -U "$password_file"
|
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
|
||||||
ynh_store_file_checksum --file="$password_file"
|
|
||||||
|
|
||||||
ynh_script_progression --message="Configuring Mosquitto..." --weight=1
|
|
||||||
|
|
||||||
# Verify the checksum and backup the file if it's different.
|
|
||||||
ynh_backup_if_checksum_is_different --file="$config_file"
|
|
||||||
|
|
||||||
cp ../conf/mosquitto.conf "$config_file"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
|
|
||||||
ynh_replace_string --match_string="__PASSWORD_FILE__" --replace_string="$password_file" --target_file="$config_file"
|
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
|
||||||
ynh_store_file_checksum --file="$config_file"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTART SYSTEMD SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restarting systemd service..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action=restart
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -111,12 +93,11 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
yunohost service add $app --description="Allows MQTT clients to send/receive data" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port"
|
yunohost service add $app --description="Allows MQTT clients to send/receive data" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE FAIL2BAN
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
ynh_systemd_action --service_name=$app --action="restart"
|
||||||
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Reference in a new issue