Skip to content

Commit 5771cf5

Browse files
committed
fix: bugs to the CI pipeline
1 parent d8da056 commit 5771cf5

3 files changed

Lines changed: 48 additions & 133 deletions

File tree

.github/workflows/build-and-push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
build-and-push:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
1215

1316
steps:
1417
- name: Checkout repository

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ RUN apk add --no-cache su-exec
2424

2525
ENTRYPOINT ["/entrypoint.sh"]
2626
CMD ["python", "src/main.py"]
27-
LABEL org.opencontainers.image.source="https://github.com/PingoLeon/NotifyNotes"
27+
LABEL org.opencontainers.image.source="https://github.com/leonpwd/NotifyNotes"

README.md

Lines changed: 44 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,86 @@
11
# 📢 NotifyNotes
22

3-
**NotifyNotes** est un script Python simple à auto-héberger (notamment via Docker) qui vérifie régulièrement si de nouvelles notes sont disponibles sur votre espace étudiant, puis vous envoie une notification via [ntfy](https://ntfy.sh/).
3+
Script Python auto-hébergé qui surveille vos notes du groupe OMNES et envoie des notifications instantanées via [ntfy](https://ntfy.sh/).
44

5-
---
5+
## 🚀 Fonctionnalités
66

7-
## 🚀 Fonctionnalités principales
8-
9-
- **Surveillance automatique** de vos notes en ligne du groupe OMNES
10-
- **Notifications instantanées** sur votre téléphone ou navigateur via ntfy
11-
- **Configuration simple** via variables d'environnement ou fichier `.env`
12-
- **Compatible Docker** pour un déploiement facile partout
13-
14-
---
15-
16-
## 🗂️ Structure du projet
17-
18-
```
19-
NotifyNotes
20-
├── src/
21-
│ ├── main.py # Script principal
22-
│ ├── parse.py # Parsing HTML → JSON
23-
│ ├── compare_json.py # Détection des changements
24-
│ └── env.py # Gestion des variables d'environnement
25-
├── requirements.txt # Dépendances Python
26-
├── Dockerfile # Image Docker
27-
├── entrypoint.sh # Script d'entrée Docker
28-
├── .env # (optionnel) Variables d'environnement
29-
└── README.md # Ce fichier !
30-
```
31-
32-
---
7+
- Surveillance automatique des notes
8+
- Notifications push sur téléphone/navigateur
9+
- Configuration simple via variables d'environnement
10+
- Déploiement Docker facile
3311

3412
## 🛠️ Prérequis
3513

36-
- **Docker** installé sur votre machine (ou Python 3.9+ si usage sans Docker)
37-
- **Un accès à votre page de notes** via une URL spécifique (`ex : campusonline.inseec.net/note/note_ajax.php?AccountName=[ID]`)
38-
- Comment l'obtenir :
39-
- Aller sur `https://VOTREECOLE.campusonline.me/fr-fr/scolarité/`, naviguez dans le relevé de notes, puis allez dans l'onglet `Network` de Devtools (Chrome), la dernière requête est celle qui fetch le fichier de notes avec un id qui vous appartient.
40-
- L'URL à obtenir est dans l'onglet `Headers`, à la ligne `request_url` de la requete qui charge vos notes
41-
- **L'application ntfy** installée sur votre smartphone (Android/iOS) ou accès à une instance ntfy
42-
43-
---
14+
- Docker (ou Python 3.9+)
15+
- URL de votre page de notes : Ouvrez Devtools (F12) → Onglet Network → Relevé de notes → Copiez l'URL de la requête `note_ajax.php`
16+
- Application ntfy (Android/iOS)
4417

45-
## ⚡ Installation rapide
18+
## ⚡ Installation
4619

47-
### 1. Lancez le conteneur
48-
49-
#### Avec Docker Compose (recommandé)
20+
### Docker Compose
5021

5122
```yaml
5223
services:
5324
notifynotes:
5425
image: ghcr.io/pingoleon/notifynotes:latest
5526
container_name: notifynotes
5627
environment:
57-
- URL=https://campusonline.inseec.net/note/note_ajax.php?AccountName=VOTRE_ID #REQUIS
58-
- NTFY_URL=https://ntfy.votre-instance.org/notifs # Facultatif
59-
- NTFY_URL_LOCAL_FALLBACK=http://iplocalentfy:portntfy/notifs #Facultatif
60-
- NTFY_AUTH=true # Facultatif
61-
- NTFY_USER=monuser # Facultatif
62-
- NTFY_PASS=monmotdepasse # Facultatif
28+
- URL=https://campusonline.inseec.net/note/note_ajax.php?AccountName=VOTRE_ID
29+
- NTFY_URL=https://ntfy.sh/mon-topic # Optionnel
6330
volumes:
6431
- /config/notifynotes:/config
6532
restart: unless-stopped
6633
network_mode: host
6734
```
6835
69-
Lancez avec :
70-
7136
```bash
7237
docker compose up -d
7338
```
7439

75-
#### Ou en ligne de commande
40+
### Docker CLI
7641

7742
```bash
78-
docker run -d \
79-
--name notifynotes \
80-
--env URL="https://campusonline.inseec.net/note/note_ajax.php?AccountName=VOTRE_ID" \
81-
--env NTFY_URL=https://ntfy.votre-instance.org/notifs \
82-
--env NTFY_URL_LOCAL_FALLBACK=http://iplocalentfy:portntfy/notifs \
83-
--env NTFY_AUTH=true \
84-
--env NTFY_USER=monuser \
85-
--env NTFY_PASS=monmotdepasse \
86-
--volume /config/notifynotes:/config \
87-
--restart unless-stopped \
88-
--network host \
43+
docker run -d --name notifynotes \
44+
-e URL="https://campusonline.inseec.net/note/note_ajax.php?AccountName=VOTRE_ID" \
45+
-v /config/notifynotes:/config \
46+
--restart unless-stopped --network host \
8947
ghcr.io/pingoleon/notifynotes:latest
9048
```
9149

92-
---
93-
94-
## 📲 Recevoir les notifications
95-
96-
1. Installez l'application ntfy sur votre smartphone :
50+
## 📲 Configuration ntfy
9751

98-
<a href="https://play.google.com/store/apps/details?id=io.heckel.ntfy">
99-
<img src="https://play.google.com/intl/en_us/badges/static/images/badges/fr_badge_web_generic.png" alt="Disponible sur Google Play" height="30" style="margin-right:8px;"/>
100-
</a>
101-
<a href="https://apps.apple.com/us/app/ntfy/id1625396347">
102-
<img src="https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg" alt="Télécharger sur l'App Store" height="30"/>
103-
</a>
104-
2. Ajoutez le topic (ex: `notes-xxxxxxx`) affiché dans les logs Docker ou celui que vous avez défini dans `NTFY_URL`.
105-
3. Recevez vos notifications dès qu'une nouvelle note est détectée ! 🎉
106-
107-
---
52+
1. Installez l'app ntfy ([Android](https://play.google.com/store/apps/details?id=io.heckel.ntfy) / [iOS](https://apps.apple.com/us/app/ntfy/id1625396347))
53+
2. Abonnez-vous au topic affiché dans les logs (ex: `notes-xxxxxxx`)
54+
3. Recevez vos notifications ! 🎉
10855

10956
## ⚙️ Variables d'environnement
11057

111-
| Variable | Description | Exemple / Valeur par défaut | Obligatoire |
112-
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------- |
113-
| `URL` | **URL de la page de notes à surveiller** | https://campusonline.inseec.net/note/note_ajax.php?AccountName=... | ✅ Oui |
114-
| `NTFY_URL` | URL de votre serveur ntfy (notifications) | https://ntfy.sh/mon-topic | Non |
115-
| `NTFY_AUTH` | Active l'authentification ntfy (`true`/`false`) | false | Non |
116-
| `NTFY_USER` | Identifiant ntfy (si auth activée) | monuser | Non |
117-
| `NTFY_PASS` | Mot de passe ntfy (si auth activée) | monmotdepasse | Non |
118-
| `CHECK_INTERVAL` | Intervalle de vérification entre Minuit et 7H (en secondes) | 1800 (30 minutes) | Non |
119-
| `STORAGE_NOTES_JSON` | Chemin du fichier de stockage des notes précédentes | /config/old_notes.json | Non |
120-
| `STORAGE_NOTES_JSON_2` | Chemin du fichier temporaire pour les nouvelles notes | /config/new_notes.json | Non |
121-
| `STORAGE_FILE_URL` | Chemin du fichier où stocker l'URL ntfy générée si besoin | /config/ntfy_url.txt | Non |
122-
| `LOG_LEVEL` | Niveau de log (`INFO` ou `DEBUG`) | INFO | Non |
123-
| `TZ` | Fuseau horaire | Europe/Paris | Non |
124-
| `NTFY_URL_LOCAL_FALLBACK` | Url de fallback (utile si la première est en https et peut fail par moment), si l'instance ntfy custom est sur le même réseau | http://192.168.0.1:3456/notifs | Non |
125-
126-
> **Astuce :** Si vous ne renseignez pas `NTFY_URL`, une URL ntfy aléatoire sera générée et affichée dans les logs. elle sera en plus enregistrée dans un fichier txt persistant pour ne pas changer d'adresse dans votre app à chaque fois.
127-
128-
### 2. Hors Docker : Configurez les variables d'environnement
129-
130-
- **Méthode recommandée :** cloner et créer un fichier `.env` à la racine du projet (voir exemple plus bas)
131-
132-
### 3. Construisez l'image Docker
133-
134-
```bash
135-
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/pingoleon/notifynotes:latest .
136-
```
137-
138-
## 📝 Exemple de fichier `.env`
139-
140-
```
141-
URL=https://campusonline.inseec.net/note/note_ajax.php?AccountName=[VOTRE_ID]
142-
NTFY_URL=https://ntfy.xxxx.com/notifs
143-
NTFY_URL_LOCAL_FALLBACK=http://[ip_fallback_sur_réseau_local]/notifs
144-
NTFY_AUTH=true # BESOIN SEULEMENT SI INSTANCE NTFY PRIVEE
145-
NTFY_USER=[USERNAME]
146-
NTFY_PASS=[CHOUETTE_MDP]
147-
STORAGE_NOTES_JSON=old_notes.json
148-
STORAGE_NOTES_JSON_2=new_notes.json
149-
STORAGE_FILE_URL=ntfy_url.txt
58+
| Variable | Description | Défaut | Requis |
59+
|----------|-------------|--------|--------|
60+
| `URL` | URL de la page de notes | - ||
61+
| `NTFY_URL` | URL du serveur ntfy | Auto-généré ||
62+
| `NTFY_AUTH` | Authentification ntfy | `false` ||
63+
| `NTFY_USER` | User ntfy | - ||
64+
| `NTFY_PASS` | Mot de passe ntfy | - ||
65+
| `NTFY_URL_LOCAL_FALLBACK` | URL de secours (réseau local) | - ||
66+
| `CHECK_INTERVAL` | Intervalle de vérification (s) | `1800` ||
67+
| `TZ` | Fuseau horaire | `Europe/Paris` ||
68+
| `LOG_LEVEL` | Niveau de log (`INFO`/`DEBUG`) | `INFO` ||
69+
70+
> Si `NTFY_URL` n'est pas défini, une URL aléatoire sera générée et sauvegardée dans `/config/ntfy_url.txt`.
71+
72+
## 📝 Exemple `.env` (hors Docker)
73+
74+
```env
75+
URL=https://campusonline.inseec.net/note/note_ajax.php?AccountName=VOTRE_ID
76+
NTFY_URL=https://ntfy.sh/mon-topic
77+
LOG_LEVEL=DEBUG
15078
```
15179

152-
---
153-
154-
## ❓ FAQ
155-
156-
- **Q : Est-ce que je peux utiliser ce script sans ntfy ?**
157-
158-
- Non, ntfy, via l'app officielle disponible sur IOS et Android est nécessaire pour recevoir les notifications.
159-
- **Q : Est-ce que mes identifiants sont stockés ?**
160-
161-
- Non, seules les notes sont stockées localement pour comparaison.
162-
163-
---
164-
16580
## 🤝 Contribuer
16681

167-
Les contributions sont **bienvenues** !
168-
N'hésitez pas à ouvrir une *issue* ou une *pull request* pour toute suggestion, bug ou amélioration.
169-
170-
---
82+
Contributions bienvenues ! Ouvrez une issue ou une pull request.
17183

17284
## 📝 Licence
17385

174-
Ce projet est sous licence Unlicense, parce que le partage c'est cool
86+
Unlicense – Partage libre

0 commit comments

Comments
 (0)