Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5c8c687
chore: add .venv to .gitignore
NathanTesseyre May 21, 2026
3810649
fix: correct flask package name in requirements.txt
NathanTesseyre May 21, 2026
1909c5c
fix: add missing colon in app.py
NathanTesseyre May 21, 2026
6a34c9a
fix: add missing colon in app.py
NathanTesseyre May 21, 2026
b7b1277
fix: use english variable name errors instead of erreurs in app.py
NathanTesseyre May 21, 2026
635c05f
fix: use english variable name errors instead of erreurs in app.py
NathanTesseyre May 21, 2026
a50d7b8
fix: update API port in config.json
NathanTesseyre May 21, 2026
894bdf4
fix: update API port in config.json
NathanTesseyre May 21, 2026
1fb6a0a
fix: hardcode log filename instead of uninitialized variable in app.py
NathanTesseyre May 21, 2026
3aa2dff
chore: remove outdated comments in app.py
NathanTesseyre May 21, 2026
7cc5942
fix: correct axios import typo
NathanTesseyre May 21, 2026
59570c4
chore: use axios conventional response.data instead of response.body
NathanTesseyre May 21, 2026
3cade2e
fix: correct axios dependency name in package.json
NathanTesseyre May 21, 2026
1e707ee
chore: add node_modules dir in .gitignore
NathanTesseyre May 21, 2026
b5ced07
chore: add package-lock.json
NathanTesseyre May 21, 2026
56e820a
docs: add debug report email
NathanTesseyre May 21, 2026
377c83d
feat: add Dockerfile for node-client
NathanTesseyre May 21, 2026
928b5cc
feat: add Dockerfile for python-api
NathanTesseyre May 21, 2026
d5606dd
feat: add docker-compose and docker-specific json config
NathanTesseyre May 21, 2026
9515110
chore: add PR url in email template
NathanTesseyre May 21, 2026
61d601f
chore: use config.json to load log_file in app.py instead of hardcode…
NathanTesseyre May 21, 2026
f6d615e
chore: add .venv to .gitignore
NathanTesseyre May 21, 2026
e26f4a4
feat: add Dockerfile for node-client
NathanTesseyre May 21, 2026
75856e5
feat: add Dockerfile for python-api
NathanTesseyre May 21, 2026
70bedf2
feat: add docker-compose and docker-specific json config
NathanTesseyre May 21, 2026
2d14fb7
Merge branch 'feat/nathan-docker' of github.com:DevSecOps-Simplon-Tra…
NathanTesseyre May 22, 2026
8046ef0
Revert "chore: add .venv to .gitignore"
NathanTesseyre May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ logs

email-template.md

venv
venv
19 changes: 19 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
python-api:
build: ./python-api
ports:
- "5000:5000"
container_name: log-analyser-api
volumes:
- ./config.docker.json:/config.json
environment:
- FLASK_RUN_HOST=0.0.0.0
command: flask run --host=0.0.0.0

node-client:
build: ./node-client
container_name: log-analyser-client
depends_on:
- python-api
volumes:
- ./config.docker.json:/config.json
11 changes: 11 additions & 0 deletions config.docker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"projet": "TP-Git-Collaboratif",
"promotion": "DevSecOps Azure — Simplon",
"apprenants": [],
"api": {
"port": 5000,
"host": "log-analyser-api",
"route": "/api/logs",
"log_file": "server.log"
}
}
80 changes: 80 additions & 0 deletions email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Template — Rapport de débogage par email

**À :** responsable.technique@azuretech.fr
**De :** nathan.tesseyre@azuretech.fr
**Objet :** Rapport de correction — scripts Python API et Node client
**Date :** 21/05/2026

---

Bonjour [Prénom du responsable],

## 1. Contexte

Dans le cadre du TP collaboratif Git, j'ai travaillé sur la branche `fix/nathan-debug-python-node`. J'ai identifié et corrigé plusieurs bugs dans les projets `python-api/` et `node-client/`. Les corrections ont été commitées et pushées sur GitHub.

---

## 2. Bugs identifiés

**Projet Python — `python-api/` :**

| # | Fichier | Ligne | Type d'erreur | Description du problème |
|---|---------|-------|---------------|--------------------------|
| 1 | `requirements.txt` | [1] | Typo | Nom du package `flaskk` au lieu de `flask` |
| 2 | `app.py` | [18] | SyntaxError | Deux-points manquant dans un bloc |
| 3 | `app.py` | [18] | Nommage | Variable `erreurs` en français au lieu de `errors` |
| 4 | `app.py` | [45] | Bug | Variable de nom de fichier log non instanciée |
| 5 | `config.json` | [6] | Config | Mauvais port pour l'API |

**Projet Node.js — `node-client/` :**

| # | Fichier | Ligne | Type d'erreur | Description du problème |
|---|---------|-------|---------------|--------------------------|
| 1 | `package.json` | [10] | Typo | Nom de la dépendance axios mal orthographié |
| 2 | `app.js` | [16] | Typo | Import axios mal orthographié |
| 3 | `app.js` | [10] | Convention | Utilisation de `response.body` au lieu de `response.data` |

---

## 3. Corrections apportées

- **Bug 1 :** Corrigé `flaskk` en `flask` dans `requirements.txt` — le nom du package doit correspondre exactement à celui publié sur PyPI.
- **Bug 2 :** Ajouté le deux-points manquant dans `app.py` — Python requiert `:` pour définir les blocs `if`, `def`, `for`, etc.
- **Bug 3 :** Renommé la variable `erreurs` en `errors` dans `app.py` — convention de nommage en anglais pour la cohérence du code.
- **Bug 4 :** Remplacé la variable non instanciée par le nom du fichier log en dur dans `app.py` — évite un `NameError` à l'exécution.
- **Bug 5 :** Mis à jour le port de l'API dans `config.json` — le port configuré ne correspondait pas à celui utilisé par l'application.
- **Bug 6 :** Corrigé le nom de la dépendance axios dans `package.json` — le mauvais nom empêchait l'installation via `npm install`.
- **Bug 7 :** Corrigé la typo dans l'import axios dans `app.js` — un import mal orthographié provoque un `Cannot find module` à l'exécution.
- **Bug 8 :** Remplacé `response.body` par `response.data` dans `app.js` — axios expose la réponse sous `data`, pas `body` (convention de la librairie).

---

## 4. Tests de validation

| Commande testée | Résultat obtenu | Résultat attendu | Validation |
|----------------|-----------------|------------------|------------|
| `pip install -r requirements.txt` | Installation réussie sans erreur | Installation réussie sans erreur | ✅ |
| `npm install` | Installation des dépendances sans erreur | Installation des dépendances sans erreur | ✅ |
| `node app.js` | Rapport d'analyse reçu | Rapport d'analyse reçu | ✅ |

---

## 5. Lien vers la Pull Request

https://github.com/DevSecOps-Simplon-Training/tp-collaboratif-git-dev-starter/pull/1

---

## 6. Recommandations

- Utiliser un `.gitignore` préconfiguré dès l'initialisation du projet (via [gitignore.io](https://www.toptal.com/developers/gitignore) ou `gh repo create`) pour ne pas oublier `node_modules/`, `.venv/`, etc.
- Utiliser un linter (`flake8` pour Python, `eslint` pour Node.js) pour détecter les typos et erreurs de syntaxe avant le commit.

---

Cordialement,

**Nathan Tesseyre**
Développeur DevSecOps — Promotion Azure, Simplon
nathan.tesseyre@azuretech.fr
10 changes: 10 additions & 0 deletions node-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18-alpine

WORKDIR /app

COPY package.json .
RUN npm install

COPY . .

CMD ["node", "app.js"]
12 changes: 12 additions & 0 deletions python-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 5000

CMD ["python", "app.py"]
Loading