Page 14 sur 17

Re: Domoticz et Google Home via le plugin DZGA

Publié : 06 déc. 2020, 16:26
par micky1183
Salut Samourai,
je ne retrouve plus la manip pour installer le certif letsencrypt dans le répertoire domoticz? je l'avais fait mais je trouve plus la manip apres réinstallation de DZGA

Re: Domoticz et Google Home via le plugin DZGA

Publié : 06 déc. 2020, 17:50
par samourai47

Code : Tout sélectionner

Letsencrypt

https://www.domoticz.com/wiki/Native_secure_access_with_Lets_Encrypt


sudo /etc/letsencrypt/letsencrypt-auto certonly --webroot --email philippe@toto.fr -d monsite.duckdns.org -w /home/pi/domoticz/www/

sudo mv ~/domoticz/server_cert.pem ~/domoticz/server_cert.pem.org  # see below about DH params why not just delete it
sudo cat /etc/letsencrypt/live/monsite.duckdns.org/privkey.pem >> ~/domoticz/server_cert.pem
sudo cat /etc/letsencrypt/live/monsite.duckdns.org/fullchain.pem >> ~/domoticz/server_cert.pem
sudo cp ~/domoticz/server_cert.pem ~/domoticz/letsencrypt_server_cert.pem
sudo /etc/init.d/domoticz.sh restart

Après redemarrage si erreur domoticz
Error: [web:443] missing SSL DH parameters from file 
Add the DHparam : 
sudo cat /etc/ssl/certs/dhparam.pem >> ~/domoticz/server_cert.pem 
and if you get also an error like : /etc/ssl/certs/dhparam.pem: No such file or directory 
cd /etc/ssl/certs
sudo openssl dhparam -out dhparam.pem 2048
sudo cat /etc/ssl/certs/dhparam.pem >> ~/domoticz/server_cert.pem
sudo /etc/init.d/domoticz.sh restart
Ca c'est pour installer letencrypt

Pour le renouvellement auto j'ai cree un fichier que j'ai appelé deploy-cert.sh. Pense a lui donner les droits d'excution

Code : Tout sélectionner

#!/bin/bash
sudo mv /home/pi/domoticz/server_cert.pem /home/pi/domoticz/server_cert.pem.org
sudo cat /etc/letsencrypt/live/monsite.duckdns.org/privkey.pem >> /home/pi/domoticz/server_cert.pem
sudo cat /etc/letsencrypt/live/monsite.duckdns.org/fullchain.pem >> /home/pi/domoticz/server_cert.pem
sudo cp /home/pi/domoticz/server_cert.pem /home/pi/domoticz/letsencrypt_server_cert.pem
sudo cat /etc/ssl/certs/dhparam.pem >> /home/pi/domoticz/server_cert.pem
sudo /etc/init.d/domoticz.sh restart
Que je relance automatiquement dans un crontab

Code : Tout sélectionner

0 23 1 * * sudo /etc/letsencrypt/certbot-auto renew --webroot -w ~/domoticz/www/ --deploy-hook ~/domoticz/scripts/deploy-cert.sh >/dev/null

Re: Domoticz et Google Home via le plugin DZGA

Publié : 06 déc. 2020, 23:14
par micky1183
Merci samourai,
tu m'as mis sur la bonne piste, j'ai réussi

Bonne soirée

Re: Domoticz et Google Home via le plugin DZGA

Publié : 07 déc. 2020, 07:27
par SpaWnOL
Est cr que quelqu'un a déjà eu ce type de problème d affichage ?

Décidément...

Re: Domoticz et Google Home via le plugin DZGA

Publié : 07 déc. 2020, 09:30
par samourai47
non pas encore....
Bizarre

Re: Domoticz et Google Home via le plugin DZGA

Publié : 07 déc. 2020, 09:33
par micky1183
Ca me dit rien non plus

Re: Domoticz et Google Home via le plugin DZGA

Publié : 13 déc. 2020, 17:31
par SpaWnOL
Bon je suis desesperé...
je ne comprends absolument pas pourquoi il m'est impossible de faire fonctionner DZGA avec nginx..(et j'ai pas reussi à refaire fonctionner ngrok aussi au passage...)

J'ai reinstallé sur mon raspberry pi debian10 au moins 5 fois et toujours le meme resultat.. impossible de faire fonctionner nginx et dzga....

Voilà mes derniers messages d'erreur.;

Edit

pi@raspberrypi:~ $ python3 Domoticz-Google-Assistant/
Loading configuration...
Connecting to Domoticz on http://XXXXXXX:XXXX
Service account key is not found. Report state will be unavailable
Using SSL connection
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "Domoticz-Google-Assistant/__main__.py", line 109, in <module>
startServer()
File "Domoticz-Google-Assistant/__main__.py", line 52, in startServer
secure(server)
File "Domoticz-Google-Assistant/__main__.py", line 26, in secure
server.socket = ssl.wrap_socket (server.socket, keyfile=key, certfile=cert, server_side=True, ssl_version=ssl.PROTOCOL_TLSv1_2)
File "/usr/lib/python3.7/ssl.py", line 1216, in wrap_socket
context.load_cert_chain(certfile, keyfile)
PermissionError: [Errno 13] Permission denied



:( :? :o :oops:

Re: Domoticz et Google Home via le plugin DZGA

Publié : 13 déc. 2020, 18:28
par samourai47
Hello
Peut etre une piste?
Loading configuration...
Connecting to Domoticz on http://XXXXXXX:XXXX
Service account key is not found. Report state will be unavailable
Si tu te connecte avec nginx ca doit etre https//XXXXXXX:XXXX
Ensuite il parle de account key
Tu as bien recupere et colle la cle json de ton compte google?

Re: Domoticz et Google Home via le plugin DZGA

Publié : 13 déc. 2020, 19:11
par SpaWnOL
samourai47 a écrit : 13 déc. 2020, 18:28 Hello
Peut etre une piste?
Loading configuration...
Connecting to Domoticz on http://XXXXXXX:XXXX
Service account key is not found. Report state will be unavailable
Si tu te connecte avec nginx ca doit etre https//XXXXXXX:XXXX
Ensuite il parle de account key
Tu as bien recupere et colle la cle json de ton compte google?
Oui, j'avais fait l'étape avec la cle json.. mais ca ne changeait rien.
Je suis sur Debian 10.. Avec une adresse duckdns suis je le seul ?

Franchement incompréhensible..

Re: Domoticz et Google Home via le plugin DZGA

Publié : 14 déc. 2020, 09:36
par samourai47
la je suis pas assez fort...
Chez moi je me suis refait une install a zero et tout a fonctionne du premier coup
Courage.... Lol