From 7b4ff2313a4ce471d8ba896064e65fe947c0faad Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 02:21:41 +0200 Subject: [PATCH 01/15] =?UTF-8?q?Ajoute=20watchtower=20et=20am=C3=A9liore?= =?UTF-8?q?=20le=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 53 ++++++++++++++++++++++++--------------------- docker-compose.yml | 54 ++++++++++++++++++++++++++++++---------------- run-web.py | 2 +- 3 files changed, 65 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 3abe6b6..4b2c66b 100755 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - [Vue d'ensemble](#vue-densemble) - [Fonctionnalités](#fonctionnalités) - [Discord](#discord) - - [Twitch](#twitch-en-développement) + - [Twitch](#twitch) - [YouTube Live](#youtube-live-en-développement) - [Interface d'administration](#interface-dadministration) - [Surveillance](#surveillance) @@ -15,7 +15,6 @@ - [Prérequis](#prérequis) - [Création du bot Discord](#création-du-bot-discord) - [Démarrage rapide](#démarrage-rapide) - - [Configuration](#configuration) - [Commandes Docker utiles](#commandes-docker-utiles) - [Mise à jour](#mise-à-jour) - [Configuration avancée](#configuration-avancée) @@ -41,7 +40,7 @@ Mamie Henriette est un bot intelligent open-source développé spécifiquement p ### Caractéristiques principales - Interface web d'administration complète -- Gestion multi-plateformes (Discord, Twitch, YouTube Live) +- Gestion multi-plateformes (Discord opérationnel, Twitch intégré, YouTube Live en développement) - Système de notifications automatiques - Base de données intégrée pour la persistance - Surveillance optionnelle avec Zabbix *(non testée)* @@ -55,9 +54,8 @@ Mamie Henriette est un bot intelligent open-source développé spécifiquement p - **Recherche ProtonDB** : Commande `!protondb ` pour vérifier la compatibilité Linux/Steam Deck - **Modération** : Outils intégrés -### Twitch *(en développement)* -- **Chat bot** : Commandes et interactions -- **Événements live** : Notifications de stream +### Twitch +- **Chat bot** : Commandes et interactions automatiques ### YouTube Live *(en développement)* - **Chat bot** : Modération et commandes @@ -79,6 +77,7 @@ Mamie Henriette est un bot intelligent open-source développé spécifiquement p ### Prérequis - [Docker Engine](https://docs.docker.com/engine/install/) ou [Docker Desktop](https://docs.docker.com/desktop/) - Token Discord pour le bot +- Token Twitch (optionnel) pour les fonctionnalités Twitch ### Création du bot Discord @@ -94,7 +93,7 @@ Avant d'installer MamieHenriette, vous devez créer un bot Discord et obtenir so 3. **Configurer le bot** : - Dans le menu latéral, cliquez sur "Bot" - Ajoutez une photo de profil et un pseudo à votre bot - - **Important** : Activez les "Privileged Gateway Intents" : + - **Important activezez les intents** : - ☑️ Presence Intent - ☑️ Server Members Intent - ☑️ Message Content Intent @@ -126,15 +125,7 @@ cd MamieHenriette docker compose up --build -d ``` -### Configuration - -1. **Interface web** : Accédez à http://localhost -2. **Token Discord** : Section "Configurations" -3. **ProtonDB** : Configurer l'API Algolia dans "Configurations" pour activer `!protondb` -4. **Humeurs** : Définir les statuts du bot -5. **Canaux** : Configurer les notifications - -> ⚠️ **Important** : Après avoir configuré le token Discord, les humeurs et autres fonctionnalités via l'interface web, **redémarrez le conteneur** pour que les changements soient pris en compte : +> ⚠️ **Important** : Après configuration via l'interface web http://localhost:5000, **redémarrez le conteneur** pour que les changements soient pris en compte : > ```bash > docker compose restart MamieHenriette > ``` @@ -208,10 +199,11 @@ environment: | Section | Fonction | |---------|----------| -| **Configurations** | Tokens, paramètres généraux et configuration ProtonDB | +| **Configurations** | Tokens Discord/Twitch, paramètres généraux et configuration ProtonDB | | **Humeurs** | Gestion des statuts Discord | -| **Commandes** | Commandes personnalisées | -| **Modération** | Outils de gestion | +| **Commandes** | Commandes personnalisées multi-plateformes | +| **Messages** | Messages automatiques et notifications | +| **Modération** | Outils de gestion communautaire | ## Architecture du projet @@ -226,6 +218,9 @@ environment: ├── discordbot/ # Module Discord │ └── __init__.py # Bot et handlers │ +├── twitchbot/ # Module Twitch +│ └── __init__.py # Bot Twitch et handlers +│ ├── protondb/ # Module ProtonDB │ └── __init__.py # API Algolia et recherche compatibilité │ @@ -255,14 +250,18 @@ environment: ### Architecture multi-thread - **Thread 1** : Interface web Flask (port 5000) - **Thread 2** : Bot Discord et tâches automatisées +- **Thread 3** : Bot Twitch et gestion du chat ### Dépendances principales ``` -discord.py # API Discord -flask # Interface web -requests # Client HTTP -waitress # Serveur WSGI -algoliasearch # API ProtonDB/SteamDB +discord.py>=2.3.2 # API Discord +flask>=2.3.2 # Interface web +flask-sqlalchemy>=3.0.3 # ORM SQLAlchemy +requests>=2.32.4 # Client HTTP +waitress>=3.0.2 # Serveur WSGI +algoliasearch>=4 # API ProtonDB/SteamDB +twitchAPI>=4.5.0 # API Twitch +python-dotenv==1.0.0 # Variables d'environnement ``` ## Développement @@ -270,8 +269,14 @@ algoliasearch # API ProtonDB/SteamDB ### Installation locale ```bash python3 -m venv venv +``` +```bash source venv/bin/activate +``` +```bash pip install -r requirements.txt +``` +```bash python run-web.py ``` diff --git a/docker-compose.yml b/docker-compose.yml index 38bbf03..b7687f3 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,30 +1,46 @@ services: - mamiehenriette: - # Nom du conteneur - container_name: MamieHenriette + mamiehenriette: + container_name: MamieHenriette # Nom du conteneur + image: ghcr.io/skylanix/mamiehenriette:latest # Image hébergée sur GitHub Container Registry - # Image hébergée sur GitHub Container Registry - image: ghcr.io/skylanix/mamiehenriette:latest - # Build du conteneur à partir d'un Dockerfile local - # build: . - # image: mamiehenriette +# build: . # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) +# image: mamiehenriette # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) - # Redémarrage automatique sauf si arrêté manuellement - restart: unless-stopped + restart: unless-stopped # Redémarre automatiquement sauf si arrêté manuellement environment: - - TZ=Europe/Paris # Fuseau horaire - - ENABLE_ZABBIX=false # Surveillance désactivée - - ZABBIX_SERVER=zabbix-server.example.com - - ZABBIX_HOSTNAME=mamie-henriette-bot - + TZ: Europe/Paris # Fuseau horaire + ENABLE_ZABBIX: false # Surveillance désactivée + ZABBIX_SERVER: zabbix-server.example.com + ZABBIX_HOSTNAME: mamiehenriette volumes: - # Base de données et configuration persistante - - ./instance:/app/instance + - ./instance:/app/instance # Base de données et configuration persistante ports: # Interface web sur http://localhost:8000 - 5000:5000 - # Port Zabbix (décommentez si nécessaire) - # - "10050:10050" \ No newline at end of file +# - "10050:10050" # Port Zabbix (décommentez si nécessaire) + + + + watchtower: # Permet de mettre à jours automatiquement + image: containrrr/watchtower:latest + container_name: watchtower # Nom du conteneur + restart: unless-stopped # Redémarre automatiquement sauf si arrêté manuellement + environment: + TZ: Europe/Paris + # Liste des conteneurs à surveiller (séparés par des espaces) + WATCHTOWER_INCLUDE: "MamieHenriette" + WATCHTOWER_SCHEDULE: "0 */30 * * * *" # Vérification toutes les 30 minutes + WATCHTOWER_MONITOR_ONLY: "false" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas + WATCHTOWER_CLEANUP: "true" # Supprime automatiquement les anciennes images après mise à jour + WATCHTOWER_INCLUDE_RESTARTING: "true" # Inclut les conteneurs en cours de redémarrage dans la surveillance + # URL de notification Discord (webhook) pour recevoir les alertes + WATCHTOWER_NOTIFICATION_URL: "discord://token@id" + # Format personnalisé des messages de notification (date, niveau, message) + WATCHTOWER_NOTIFICATION_TEMPLATE: |- + {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} + WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé (Shoutrrr pour Discord) + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs diff --git a/run-web.py b/run-web.py index b865860..bcb00fc 100644 --- a/run-web.py +++ b/run-web.py @@ -23,7 +23,7 @@ def start_twitch_bot(): twitchBot.begin() if __name__ == '__main__': - locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') + locale.setlocale(locale.LC_TIME, 'fr_CH.UTF-8') jobs = [] jobs.append(threading.Thread(target=start_discord_bot)) From 7931f3abef81a76f40a573366e64bb8e0cc0d540 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 02:28:17 +0200 Subject: [PATCH 02/15] Remet fr_FR.UTF-8 --- run-web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-web.py b/run-web.py index bcb00fc..b865860 100644 --- a/run-web.py +++ b/run-web.py @@ -23,7 +23,7 @@ def start_twitch_bot(): twitchBot.begin() if __name__ == '__main__': - locale.setlocale(locale.LC_TIME, 'fr_CH.UTF-8') + locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') jobs = [] jobs.append(threading.Thread(target=start_discord_bot)) From eceade571e2bb295d551aae2cfbb935ad8bdc882 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 02:51:19 +0200 Subject: [PATCH 03/15] =?UTF-8?q?Am=C3=A9liore=20mise=20en=20page=20des=20?= =?UTF-8?q?commentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b7687f3..80e8e8b 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,11 @@ services: mamiehenriette: container_name: MamieHenriette # Nom du conteneur image: ghcr.io/skylanix/mamiehenriette:latest # Image hébergée sur GitHub Container Registry - - -# build: . # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) -# image: mamiehenriette # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) - restart: unless-stopped # Redémarre automatiquement sauf si arrêté manuellement +# build: . # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) +# image: mamiehenriette # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) + environment: TZ: Europe/Paris # Fuseau horaire ENABLE_ZABBIX: false # Surveillance désactivée @@ -18,29 +16,26 @@ services: - ./instance:/app/instance # Base de données et configuration persistante ports: - # Interface web sur http://localhost:8000 - - 5000:5000 -# - "10050:10050" # Port Zabbix (décommentez si nécessaire) - - + - 5000:5000 # Interface web sur http://localhost:5000 +# - "10050:10050" # Port Zabbix (décommentez si nécessaire) watchtower: # Permet de mettre à jours automatiquement image: containrrr/watchtower:latest container_name: watchtower # Nom du conteneur restart: unless-stopped # Redémarre automatiquement sauf si arrêté manuellement environment: - TZ: Europe/Paris + TZ: Europe/Paris # Fuseau horaire # Liste des conteneurs à surveiller (séparés par des espaces) - WATCHTOWER_INCLUDE: "MamieHenriette" - WATCHTOWER_SCHEDULE: "0 */30 * * * *" # Vérification toutes les 30 minutes - WATCHTOWER_MONITOR_ONLY: "false" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas - WATCHTOWER_CLEANUP: "true" # Supprime automatiquement les anciennes images après mise à jour - WATCHTOWER_INCLUDE_RESTARTING: "true" # Inclut les conteneurs en cours de redémarrage dans la surveillance + WATCHTOWER_INCLUDE: "MamieHenriette" + WATCHTOWER_SCHEDULE: "0 */30 * * * *" # Vérification toutes les 30 minutes + WATCHTOWER_MONITOR_ONLY: "false" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas + WATCHTOWER_CLEANUP: "true" # Supprime automatiquement les anciennes images après mise à jour + WATCHTOWER_INCLUDE_RESTARTING: "true" # Inclut les conteneurs en cours de redémarrage dans la surveillance # URL de notification Discord (webhook) pour recevoir les alertes - WATCHTOWER_NOTIFICATION_URL: "discord://token@id" + WATCHTOWER_NOTIFICATION_URL: "discord://token@id" # Format personnalisé des messages de notification (date, niveau, message) - WATCHTOWER_NOTIFICATION_TEMPLATE: |- - {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} - WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé (Shoutrrr pour Discord) + WATCHTOWER_NOTIFICATION_TEMPLATE: |- + {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} + WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé (Shoutrrr pour Discord) volumes: - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs From 91fcef703024200d7caf92357968c679d2cd39c0 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 03:33:55 +0200 Subject: [PATCH 04/15] =?UTF-8?q?Am=C3=A9liore=20les=20commentaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1a1c173..3271e08 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,21 +1,22 @@ +# Gestion des variables d'environnement python-dotenv==1.0.0 -# necessaire pour l'api discord +# Nécessaire pour l'API Discord discord.py==2.3.2 aiohttp>=3.7.4,<4 audioop-lts; python_version>='3.13' -# api twitch +# API Twitch twitchAPI>=4.5.0 -# necessaire pour l'hebergement du site web +# Nécessaire pour l'hébergement du site web flask>=2.3.2 flask-sqlalchemy>=3.0.3 waitress>=3.0.2 -# necessaire pour l'appel à l'api humble bundle +# Nécessaire pour l'appel à l'API Humble Bundle requests>=2.32.4 -# necessaire pour l'appel à protopn db +# Nécessaire pour l'appel à ProtonDB algoliasearch>=4,<5 From a1b93d1c050bbe28af05cb5278566ff451133ab6 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 03:52:36 +0200 Subject: [PATCH 05/15] Corrige faute de frappe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b2c66b..bb56114 100755 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Avant d'installer MamieHenriette, vous devez créer un bot Discord et obtenir so 3. **Configurer le bot** : - Dans le menu latéral, cliquez sur "Bot" - Ajoutez une photo de profil et un pseudo à votre bot - - **Important activezez les intents** : + - **Important activez les intents** : - ☑️ Presence Intent - ☑️ Server Members Intent - ☑️ Message Content Intent From eff0b3a402c45625c47ff831e398aef368a7a59b Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 03:55:46 +0200 Subject: [PATCH 06/15] =?UTF-8?q?TEST=20=C3=A9chec=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 26 +++++++++++++++++++++++++- run-web.py | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 7fdbae7..91b6619 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -54,4 +54,28 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + + - name: Test container startup + run: | + echo "Testing if the container starts successfully..." + docker run --rm -d --name test-container -p 5001:5000 \ + -e TZ=Europe/Paris \ + -e ENABLE_ZABBIX=false \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + + # Wait for container to be ready + sleep 10 + + # Check if container is still running + if docker ps | grep test-container; then + echo "✅ Container started successfully" + docker logs test-container + else + echo "❌ Container failed to start" + docker logs test-container + exit 1 + fi + + # Stop the test container + docker stop test-container \ No newline at end of file diff --git a/run-web.py b/run-web.py index b865860..bcb00fc 100644 --- a/run-web.py +++ b/run-web.py @@ -23,7 +23,7 @@ def start_twitch_bot(): twitchBot.begin() if __name__ == '__main__': - locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') + locale.setlocale(locale.LC_TIME, 'fr_CH.UTF-8') jobs = [] jobs.append(threading.Thread(target=start_discord_bot)) From 91a23a446fd450b1f13f03377157baff59d583f6 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 03:59:22 +0200 Subject: [PATCH 07/15] =?UTF-8?q?TEST=202=20=C3=A9chec=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 91b6619..d2e058c 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -65,7 +65,7 @@ jobs: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest # Wait for container to be ready - sleep 10 + sleep 60 # Check if container is still running if docker ps | grep test-container; then diff --git a/Dockerfile b/Dockerfile index e40c22d..8326cf0 100755 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ COPY ./database ./database COPY ./discordbot ./discordbot COPY ./protondb ./protondb COPY ./webapp ./webapp -COPY ./twitchbot ./twitchbot +#COPY ./twitchbot ./twitchbot COPY zabbix_agent2.conf /etc/zabbix/zabbix_agent2.conf COPY start.sh /start.sh From 405d53374d0ef8b04258888199eb27ced872723f Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 04:05:44 +0200 Subject: [PATCH 08/15] =?UTF-8?q?TEST=203=20=C3=A9chec=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 2 +- Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d2e058c..4a205e6 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -59,7 +59,7 @@ jobs: - name: Test container startup run: | echo "Testing if the container starts successfully..." - docker run --rm -d --name test-container -p 5001:5000 \ + docker run --rm -d --name test-container -p 5000:5000 \ -e TZ=Europe/Paris \ -e ENABLE_ZABBIX=false \ ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest diff --git a/Dockerfile b/Dockerfile index 8326cf0..029232b 100755 --- a/Dockerfile +++ b/Dockerfile @@ -23,12 +23,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && rm zabbix-release_latest_7.4+debian12_all.deb COPY requirements.txt . -COPY run-web.py . +#COPY run-web.py . COPY ./database ./database COPY ./discordbot ./discordbot COPY ./protondb ./protondb COPY ./webapp ./webapp -#COPY ./twitchbot ./twitchbot +COPY ./twitchbot ./twitchbot COPY zabbix_agent2.conf /etc/zabbix/zabbix_agent2.conf COPY start.sh /start.sh From 8f31bda68a1830961b340a26706bff9e5016854c Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 04:26:10 +0200 Subject: [PATCH 09/15] Retire CI test et fichier .env Docker et corrige docker-build.yml --- .env.example | 5 -- .github/workflows/docker-build.yml | 88 ++++++++---------------------- Dockerfile | 2 +- run-web.py | 2 +- 4 files changed, 26 insertions(+), 71 deletions(-) delete mode 100644 .env.example diff --git a/.env.example b/.env.example deleted file mode 100644 index 7f886eb..0000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -# Configuration Zabbix (optionnel) -ENABLE_ZABBIX=false -ZABBIX_SERVER=zabbix-server.example.com -ZABBIX_HOSTNAME=MamieHenriette -ZABBIX_PORT=10050 \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 4a205e6..361699b 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,81 +1,41 @@ -name: Build and Push Docker Image +name: Create and publish a Docker image on: push: - branches: [ main ] - tags: [ 'v*' ] - pull_request: - branches: [ main ] + branches: ['main'] env: REGISTRY: ghcr.io - IMAGE_NAME: skylanix/mamiehenriette + IMAGE_NAME: ${{ github.repository }} jobs: - build: + build-and-push-image: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=raw,value=latest,enable={{is_default_branch}} - labels: | - org.opencontainers.image.title=${{ github.repository }} - org.opencontainers.image.description=Bot multi-plateformes Discord/Twitch/YouTube pour la communauté STEvE - org.opencontainers.image.source=https://github.com/${{ github.repository }} - org.opencontainers.image.url=https://github.com/${{ github.repository }} - org.opencontainers.image.licenses=GPL-3.0 - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Test container startup - run: | - echo "Testing if the container starts successfully..." - docker run --rm -d --name test-container -p 5000:5000 \ - -e TZ=Europe/Paris \ - -e ENABLE_ZABBIX=false \ - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - - # Wait for container to be ready - sleep 60 - - # Check if container is still running - if docker ps | grep test-container; then - echo "✅ Container started successfully" - docker logs test-container - else - echo "❌ Container failed to start" - docker logs test-container - exit 1 - fi - - # Stop the test container - docker stop test-container \ No newline at end of file + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 029232b..e40c22d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && rm zabbix-release_latest_7.4+debian12_all.deb COPY requirements.txt . -#COPY run-web.py . +COPY run-web.py . COPY ./database ./database COPY ./discordbot ./discordbot COPY ./protondb ./protondb diff --git a/run-web.py b/run-web.py index bcb00fc..b865860 100644 --- a/run-web.py +++ b/run-web.py @@ -23,7 +23,7 @@ def start_twitch_bot(): twitchBot.begin() if __name__ == '__main__': - locale.setlocale(locale.LC_TIME, 'fr_CH.UTF-8') + locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') jobs = [] jobs.append(threading.Thread(target=start_discord_bot)) From 9957f9e49fd389246a72099912e52cc3e1d6b237 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 04:28:47 +0200 Subject: [PATCH 10/15] Fix GitHub Action triggers --- .github/workflows/docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 361699b..7314935 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -2,7 +2,7 @@ name: Create and publish a Docker image on: push: - branches: ['main'] + branches: ['main', 'watchtower_readme'] env: REGISTRY: ghcr.io From 5c4ad72e2303031310aacc060373a0945963ddd0 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 04:33:55 +0200 Subject: [PATCH 11/15] Github Action pour toutes les futurs branches --- .github/workflows/docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 7314935..814f1bc 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -2,7 +2,7 @@ name: Create and publish a Docker image on: push: - branches: ['main', 'watchtower_readme'] + branches: ['*'] env: REGISTRY: ghcr.io From d7690ca9eaeacb38174d6859518f5cf9607ab877 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 05:22:30 +0200 Subject: [PATCH 12/15] =?UTF-8?q?restart:=20no=20:=20pour=20=C3=A9viter=20?= =?UTF-8?q?les=20boucles=20de=20d=C3=A9marrage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 80e8e8b..013befa 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ services: mamiehenriette: container_name: MamieHenriette # Nom du conteneur image: ghcr.io/skylanix/mamiehenriette:latest # Image hébergée sur GitHub Container Registry - restart: unless-stopped # Redémarre automatiquement sauf si arrêté manuellement + restart: "no" # N'autorise pas le redémarrage automatique # build: . # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) # image: mamiehenriette # Build du conteneur à partir d'un Dockerfile local (décommentez si nécessaire) @@ -22,7 +22,7 @@ services: watchtower: # Permet de mettre à jours automatiquement image: containrrr/watchtower:latest container_name: watchtower # Nom du conteneur - restart: unless-stopped # Redémarre automatiquement sauf si arrêté manuellement + restart: "no" # N'autorise pas le redémarrage automatique environment: TZ: Europe/Paris # Fuseau horaire # Liste des conteneurs à surveiller (séparés par des espaces) @@ -38,4 +38,4 @@ services: {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé (Shoutrrr pour Discord) volumes: - - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs + - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs \ No newline at end of file From d8f5e80d8d7207989ce7f0fa3e51c58472b04773 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 05:25:49 +0200 Subject: [PATCH 13/15] =?UTF-8?q?restart:=20no=20:=20pour=20=C3=A9viter=20?= =?UTF-8?q?les=20boucles=20de=20d=C3=A9marrage=20et=20commente=20Discord?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 013befa..a3810fd 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,11 +31,11 @@ services: WATCHTOWER_MONITOR_ONLY: "false" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas WATCHTOWER_CLEANUP: "true" # Supprime automatiquement les anciennes images après mise à jour WATCHTOWER_INCLUDE_RESTARTING: "true" # Inclut les conteneurs en cours de redémarrage dans la surveillance - # URL de notification Discord (webhook) pour recevoir les alertes - WATCHTOWER_NOTIFICATION_URL: "discord://token@id" + # URL de notification Discord (webhook), (décommentez si nécessaire) +# WATCHTOWER_NOTIFICATION_URL: "discord://token@id" # Format personnalisé des messages de notification (date, niveau, message) WATCHTOWER_NOTIFICATION_TEMPLATE: |- {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé (Shoutrrr pour Discord) volumes: - - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs \ No newline at end of file + - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs From 82134b7657151ce0a8e0dfc44c37c7e950624d80 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 05:32:59 +0200 Subject: [PATCH 14/15] =?UTF-8?q?restart:=20no=20:=20pour=20=C3=A9viter=20?= =?UTF-8?q?les=20boucles=20de=20d=C3=A9marrage=20et=20commente=20Discord?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a3810fd..7f56078 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,14 +28,14 @@ services: # Liste des conteneurs à surveiller (séparés par des espaces) WATCHTOWER_INCLUDE: "MamieHenriette" WATCHTOWER_SCHEDULE: "0 */30 * * * *" # Vérification toutes les 30 minutes - WATCHTOWER_MONITOR_ONLY: "false" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas + WATCHTOWER_MONITOR_ONLY: "" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas WATCHTOWER_CLEANUP: "true" # Supprime automatiquement les anciennes images après mise à jour WATCHTOWER_INCLUDE_RESTARTING: "true" # Inclut les conteneurs en cours de redémarrage dans la surveillance # URL de notification Discord (webhook), (décommentez si nécessaire) # WATCHTOWER_NOTIFICATION_URL: "discord://token@id" - # Format personnalisé des messages de notification (date, niveau, message) - WATCHTOWER_NOTIFICATION_TEMPLATE: |- - {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} - WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé (Shoutrrr pour Discord) + # Format personnalisé des messages de notification (décommentez si nécessaire) +# WATCHTOWER_NOTIFICATION_TEMPLATE: |- +# {{range .}}{{.Time.Format "01-02-2006 15:04:05"}} ({{.Level}})':' {{.Message}}{{println}}{{end}} +# WATCHTOWER_NOTIFICATIONS: shoutrrr # Service de notification utilisé pour Discord (décommentez si nécessaire) volumes: - /var/run/docker.sock:/var/run/docker.sock # Monte le socket Docker pour permettre à Watchtower de surveiller les conteneurs From 614c18647c62fd0b3b57b0faf1eb27f675ea2a02 Mon Sep 17 00:00:00 2001 From: skylanix Date: Mon, 25 Aug 2025 05:38:55 +0200 Subject: [PATCH 15/15] Corrige false pour env. : WATCHTOWER_MONITOR_ONLY --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7f56078..5899594 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: # Liste des conteneurs à surveiller (séparés par des espaces) WATCHTOWER_INCLUDE: "MamieHenriette" WATCHTOWER_SCHEDULE: "0 */30 * * * *" # Vérification toutes les 30 minutes - WATCHTOWER_MONITOR_ONLY: "" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas + WATCHTOWER_MONITOR_ONLY: "false" # Mode surveillance uniquement : détecte les mises à jour mais ne les applique pas WATCHTOWER_CLEANUP: "true" # Supprime automatiquement les anciennes images après mise à jour WATCHTOWER_INCLUDE_RESTARTING: "true" # Inclut les conteneurs en cours de redémarrage dans la surveillance # URL de notification Discord (webhook), (décommentez si nécessaire)