1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/domoticz_ynh.git synced 2024-09-03 18:26:17 +02:00

Merge pull request #30 from YunoHost-Apps/testing

Testing
This commit is contained in:
Alexandre Aubin 2024-04-06 17:27:11 +02:00 committed by GitHub
commit 37689e63b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 84 additions and 20 deletions

View file

@ -1,6 +1,6 @@
# All available README files by language # All available README files by language
- [Read the README in English](README.md) - [Read the README in English](README.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md) - [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md) - [Le o README en galego](README_gl.md)
- [Leggi il “README” in italiano](README_it.md)

View file

@ -9,7 +9,7 @@ It shall NOT be edited by hand.
[![Install Domoticz with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=domoticz) [![Install Domoticz with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=domoticz)
*[Read this README is other languages.](./ALL_README.md)* *[Read this README in other languages.](./ALL_README.md)*
> *This package allows you to install Domoticz quickly and simply on a YunoHost server.* > *This package allows you to install Domoticz quickly and simply on a YunoHost server.*
> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*

64
README_eu.md Normal file
View file

@ -0,0 +1,64 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# Domoticz YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/domoticz.svg)](https://dash.yunohost.org/appci/app/domoticz) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/domoticz.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/domoticz.maintain.svg)
[![Instalatu Domoticz YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=domoticz)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek Domoticz YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
Domoticz is a Home Automation system design to control various devices and receive input from various sensors.
For example this system can be used with:
* Light switches
* Door sensors
* Doorbells
* Security devices
* Weather sensors like: UV/Rain/Wind Meters
* Temperature Sensors
* Pulse Meters
* Voltage / AD Meters
* And more...
The MQTT broker Mosquitto is integrated into the package and requires its own domain or subdomain. It's an optional setting.
You may also install the [Mosquitto package](https://github.com/YunoHost-Apps/mosquitto_ynh) without using the one provided by domoticz_ynh.
**Paketatutako bertsioa:** 2024.4~ynh1
## Pantaila-argazkiak
![Domoticz(r)en pantaila-argazkia](./doc/screenshots/domoticz_Switches_screen.png)
![Domoticz(r)en pantaila-argazkia](./doc/screenshots/domoticz_floorplan_machineon.png)
## Dokumentazioa eta baliabideak
- Aplikazioaren webgune ofiziala: <https://domoticz.com/>
- Erabiltzaileen dokumentazio ofiziala: <https://www.domoticz.com/DomoticzManual.pdf>
- Administratzaileen dokumentazio ofiziala: <https://www.domoticz.com/wiki/Main_Page>
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/domoticz/domoticz>
- YunoHost Denda: <https://apps.yunohost.org/app/domoticz>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/domoticz_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/domoticz_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/domoticz_ynh/tree/testing --debug
edo
sudo yunohost app upgrade domoticz -u https://github.com/YunoHost-Apps/domoticz_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

View file

@ -26,8 +26,8 @@ ynh_backup --src_path="$install_dir"
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/api_"$app".conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/api_${app}.conf"
[[ "$domain" != "$mqtt_domain" ]] && ynh_backup --src_path="/etc/nginx/conf.d/$mqtt_domain.d/mqtt_$app.conf" --not_mandatory [[ "$domain" != "$mqtt_domain" ]] && ynh_backup --src_path="/etc/nginx/conf.d/$mqtt_domain.d/mqtt_${app}.conf" --not_mandatory
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP

View file

@ -74,14 +74,14 @@ if [ "$domain" != "$mqtt_domain" ]; then
ynh_script_progression --message="Setting up mosquitto..." --weight=5 ynh_script_progression --message="Setting up mosquitto..." --weight=5
#Setting up conf file for access #Setting up conf file for access
ynh_add_config --template="../conf/domoticz_mosquitto.conf" --destination="/etc/mosquitto/conf.d/"$app"_mosquitto.conf" ynh_add_config --template="../conf/domoticz_mosquitto.conf" --destination="/etc/mosquitto/conf.d/${app}_mosquitto.conf"
chmod 644 /etc/mosquitto/conf.d/"$app"_mosquitto.conf chmod 644 /etc/mosquitto/conf.d/"$app"_mosquitto.conf
#Setting up user&pwd for mqtt access #Setting up user&pwd for mqtt access
ynh_app_setting_set --app="$app" --key=mqtt_user --value=$(ynh_string_random --length=8) ynh_app_setting_set --app="$app" --key=mqtt_user --value=$(ynh_string_random --length=8)
ynh_app_setting_set --app="$app" --key=mqtt_pwd --value=$(ynh_string_random) ynh_app_setting_set --app="$app" --key=mqtt_pwd --value=$(ynh_string_random)
echo $(ynh_app_setting_get --app="$app" --key=mqtt_user):$(ynh_app_setting_get --app="$app" --key=mqtt_pwd) > "/etc/mosquitto/conf.d/"$app"_credentials" echo $(ynh_app_setting_get --app="$app" --key=mqtt_user):$(ynh_app_setting_get --app="$app" --key=mqtt_pwd) > "/etc/mosquitto/conf.d/${app}_credentials"
mosquitto_passwd -U "/etc/mosquitto/conf.d/"$app"_credentials" mosquitto_passwd -U "/etc/mosquitto/conf.d/${app}_credentials"
ynh_print_info --message="The credential to the mosquitto server has been saved in the settings of the app" ynh_print_info --message="The credential to the mosquitto server has been saved in the settings of the app"
else else
@ -95,13 +95,13 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2 ynh_script_progression --message="Configuring NGINX web server..." --weight=2
[[ "$domain" != "$mqtt_domain" ]] && ynh_add_config --template="../conf/mqtt_nginx.conf" --destination="/etc/nginx/conf.d/"$mqtt_domain".d/mqtt_"$app".conf" [[ "$domain" != "$mqtt_domain" ]] && ynh_add_config --template="../conf/mqtt_nginx.conf" --destination="/etc/nginx/conf.d/${mqtt_domain}.d/mqtt_${app}.conf"
#Set Hook for nginx domain #Set Hook for nginx domain
cp -R ../sources/hooks/conf_regen/95-nginx_domoticz /usr/share/yunohost/hooks/conf_regen/ cp -R ../sources/hooks/conf_regen/95-nginx_domoticz /usr/share/yunohost/hooks/conf_regen/
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_config --template="api_nginx.conf" --destination="/etc/nginx/conf.d/"$domain".d/api_"$app".conf" ynh_add_config --template="api_nginx.conf" --destination="/etc/nginx/conf.d/${domain}.d/api_${app}.conf"
ynh_add_nginx_config ynh_add_nginx_config

View file

@ -20,7 +20,7 @@ if [ "$domain" != "$mqtt_domain" ]; then
yunohost service remove mosquitto yunohost service remove mosquitto
ynh_secure_remove --file="/etc/mosquitto/conf.d" ynh_secure_remove --file="/etc/mosquitto/conf.d"
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/95-nginx_domoticz" ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/95-nginx_domoticz"
ynh_secure_remove --file="/etc/nginx/conf.d/"$mqtt_domain".d/mqtt_"$app".conf" ynh_secure_remove --file="/etc/nginx/conf.d/${mqtt_domain}.d/mqtt_${app}.conf"
yunohost tools regen-conf postfix yunohost tools regen-conf postfix
ynh_secure_remove --file="/var/log/mosquitto" ynh_secure_remove --file="/var/log/mosquitto"
fi fi
@ -35,7 +35,7 @@ fi
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config ynh_remove_systemd_config
ynh_secure_remove --file="/etc/nginx/conf.d/"$domain".d/api_"$app".conf" ynh_secure_remove --file="/etc/nginx/conf.d/${domain}.d/api_${app}.conf"
ynh_remove_nginx_config ynh_remove_nginx_config
ynh_remove_logrotate ynh_remove_logrotate

View file

@ -36,8 +36,8 @@ ynh_app_setting_set --app="$app" --key=mach --value="$current_mach"
ynh_script_progression --message="Restoring the NGINX web server configuration..." ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/"$domain".d/api_"$app".conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/${domain}.d/api_${app}.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$mqtt_domain.d/mqtt_$app.conf" --not_mandatory ynh_restore_file --origin_path="/etc/nginx/conf.d/$mqtt_domain.d/mqtt_${app}.conf" --not_mandatory
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER

View file

@ -109,16 +109,16 @@ if [ "$domain" != "$mqtt_domain" ]; then
ynh_script_progression --message="Setting up mosquitto..." --weight=5 ynh_script_progression --message="Setting up mosquitto..." --weight=5
#Setting up conf file for access #Setting up conf file for access
if [ ! -f "/etc/mosquitto/conf.d/"$app"_mosquitto.conf" ] if [ ! -f "/etc/mosquitto/conf.d/${app}_mosquitto.conf" ]
then then
ynh_add_config --template="../conf/domoticz_mosquitto.conf" --destination="/etc/mosquitto/conf.d/"$app"_mosquitto.conf" ynh_add_config --template="../conf/domoticz_mosquitto.conf" --destination="/etc/mosquitto/conf.d/${app}_mosquitto.conf"
chmod 644 /etc/mosquitto/conf.d/"$app"_mosquitto.conf chmod 644 /etc/mosquitto/conf.d/"$app"_mosquitto.conf
#Setting up user&pwd for mqtt access #Setting up user&pwd for mqtt access
ynh_app_setting_set --app="$app" --key=mqtt_user --value=$(ynh_string_random --length=8) ynh_app_setting_set --app="$app" --key=mqtt_user --value=$(ynh_string_random --length=8)
ynh_app_setting_set --app="$app" --key=mqtt_pwd --value=$(ynh_string_random) ynh_app_setting_set --app="$app" --key=mqtt_pwd --value=$(ynh_string_random)
echo $(ynh_app_setting_get --app="$app" --key=mqtt_user):$(ynh_app_setting_get --app="$app" --key=mqtt_pwd) > "/etc/mosquitto/conf.d/"$app"_credentials" echo $(ynh_app_setting_get --app="$app" --key=mqtt_user):$(ynh_app_setting_get --app="$app" --key=mqtt_pwd) > "/etc/mosquitto/conf.d/${app}_credentials"
mosquitto_passwd -U "/etc/mosquitto/conf.d/"$app"_credentials" mosquitto_passwd -U "/etc/mosquitto/conf.d/${app}_credentials"
ynh_print_info --message="The credential to the mosquitto server has been saved in the settings of the app" ynh_print_info --message="The credential to the mosquitto server has been saved in the settings of the app"
fi fi
@ -132,17 +132,17 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." ynh_script_progression --message="Upgrading NGINX web server configuration..."
[[ "$domain" != "$mqtt_domain" ]] && ynh_add_config --template="../conf/mqtt_nginx.conf" --destination="/etc/nginx/conf.d/"$mqtt_domain".d/mqtt_"$app".conf" [[ "$domain" != "$mqtt_domain" ]] && ynh_add_config --template="../conf/mqtt_nginx.conf" --destination="/etc/nginx/conf.d/${mqtt_domain}.d/mqtt_${app}.conf"
#Set Hook for nginx domain #Set Hook for nginx domain
cp -R ../sources/hooks/conf_regen/95-nginx_domoticz /usr/share/yunohost/hooks/conf_regen/ cp -R ../sources/hooks/conf_regen/95-nginx_domoticz /usr/share/yunohost/hooks/conf_regen/
# Create a dedicated NGINX config # Create a dedicated NGINX config
if [[ ! -f "/etc/nginx/conf.d/"$domain".d/api_"$app".conf" ]] if [[ ! -f "/etc/nginx/conf.d/${domain}.d/api_${app}.conf" ]]
then then
ynh_print_warn --message="The nginx conf file will now be splitted between standard and api related path" ynh_print_warn --message="The nginx conf file will now be splitted between standard and api related path"
ynh_print_warn --message="Report any manual changes on the new /etc/nginx/conf.d/$domain.d/api_$app.conf file for json command to keep working" ynh_print_warn --message="Report any manual changes on the new /etc/nginx/conf.d/$domain.d/api_$app.conf file for json command to keep working"
ynh_add_config --template="api_nginx.conf" --destination="/etc/nginx/conf.d/"$domain".d/api_"$app".conf" ynh_add_config --template="api_nginx.conf" --destination="/etc/nginx/conf.d/${domain}.d/api_${app}.conf"
fi fi
ynh_add_nginx_config ynh_add_nginx_config