2.7 KiB
Notes de deploiement - OpenSquared PWA
Date: 2026-04-26
Depot
https://gitea.open-squared.tech/admin/openbot.git
branche main
Commits importants:
fb8cc4d Initial PWA assistant proof of concept
94148e8 Rename installed PWA to OpenSquared
1f815fa Version PWA icon asset to refresh Android cache
1b9933d Fix voice button audio unlock hang
VPS
Serveur: 46.202.173.47
Dossier app: /root/openbot
Domaine: bot.open-squared.tech
URL: https://bot.open-squared.tech
L'app Flask a ete testee sur:
http://46.202.173.47:8080/health
https://bot.open-squared.tech/health
Python
Sur le VPS, python3 -m venv .venv a d'abord echoue car python3.12-venv manquait.
Correctif:
apt update
apt install -y python3.12-venv
cd /root/openbot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
HTTPS et Nginx Docker
Le VPS utilise deja un docker-compose.yml avec un conteneur nginx.
Montage nginx:
/root/tradon/nginx/conf -> /etc/nginx/conf.d
/etc/letsencrypt -> /etc/letsencrypt:ro
/root/tradon/nginx/certbot -> /var/www/certbot
Le bloc HTTP doit servir les challenges avant la redirection:
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
Certificat cree avec:
certbot certonly --webroot \
-w /root/tradon/nginx/certbot \
-d bot.open-squared.tech
Le bloc HTTPS bot.open-squared.tech doit utiliser:
ssl_certificate /etc/letsencrypt/live/bot.open-squared.tech/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bot.open-squared.tech/privkey.pem;
Proxy depuis nginx Docker vers Flask sur l'hote:
proxy_pass http://172.17.0.1:8080;
Verifier:
docker exec nginx nginx -t
docker exec nginx nginx -s reload
curl -I https://bot.open-squared.tech/health
PWA Android
Nom installe:
OpenSquared
Icone:
static/icons/icon-v2.svg
Pour forcer Android/Chrome a prendre la nouvelle icone:
git pullsur le VPS.- Ouvrir
https://bot.open-squared.tech/icons/icon-v2.svg. - Desinstaller l'ancienne PWA.
- Reinstaller depuis Chrome.
Cache et bouton micro
Le bouton Demarrer etait non reactif sur navigateur parce que unlockAudio() pouvait rester bloque sur audio.play() avec un audio vide.
Correctif applique:
unlockAudio()utilise maintenantAudioContext.index.htmlcharge/app.js?v=4.- Service worker:
opensquared-assistant-v4.
Si le bouton ne reagit pas apres un deploiement:
PC: Ctrl+F5
Android: fermer l'app, rouvrir Chrome, ou desinstaller/reinstaller la PWA
Si ca persiste, ouvrir F12 -> Console et lire l'erreur JS.