Nightscout-koppeling + CI/CD-fixes #2

Merged
willemjan merged 3 commits from dev into main 2026-07-25 07:30:10 +00:00
5 changed files with 22 additions and 12 deletions
Showing only changes of commit e805dc9194 - Show all commits
+8
View File
@@ -0,0 +1,8 @@
.env
.venv/
__pycache__/
*.pyc
.git/
.pytest_cache/
.ruff_cache/
tests/
+6 -6
View File
@@ -47,23 +47,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} .
run: docker build -t gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} .
- name: Trivy scan
uses: aquasecurity/trivy-action@master
with:
image-ref: gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }}
image-ref: gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }}
severity: CRITICAL,HIGH
exit-code: "1" # laat de pipeline falen bij kritieke kwetsbaarheden
- name: Login bij Gitea-registry
run: echo "${{ secrets.GLUCOSE_TOKEN }}" | docker login gitea.thuis.local -u willem --password-stdin
run: echo "${{ secrets.GLUCOSE_TOKEN }}" | docker login gitea.zb.local -u willem --password-stdin
- name: Tag en push
run: |
docker tag gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} gitea.thuis.local/willem/glucose-dashboard:latest
docker push gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }}
docker push gitea.thuis.local/willem/glucose-dashboard:latest
docker tag gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} gitea.zb.local/willem/glucose-dashboard:latest
docker push gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }}
docker push gitea.zb.local/willem/glucose-dashboard:latest
# ---------------------------------------------------------------------
# 4. Deploy — SSH naar de LXC en herstart met de nieuwe image
+1
View File
@@ -4,3 +4,4 @@ __pycache__/
.env
.pytest_cache/
.ruff_cache/
homelab-cicd-werkinstructie.md
+6 -5
View File
@@ -10,14 +10,15 @@ koolhydraten en pomp-/sensorwissels overlay, plus time-in-range-cijfers.
> Manage Tokens in Nightscout — geef het token minimaal `readable`-rechten)
of het klassieke API secret.
2. Kopieer `.env.example` naar `.env` en vul `NIGHTSCOUT_URL` en één van de
twee auth-opties in.
twee auth-opties in. `app.py` laadt `.env` zelf in (via `python-dotenv`),
dus dit werkt hetzelfde onder PowerShell, cmd of bash — je hoeft de
variabelen niet zelf in je shell te zetten.
3. Lokaal draaien:
```bash
```powershell
uv venv
uv pip install -r requirements.txt
set -a; source .env; set +a # of: laad de vars op je eigen manier
streamlit run app.py
uv pip install -r requirements.txt --python .venv
.venv\Scripts\streamlit run app.py
```
4. Met Docker Compose:
+1 -1
View File
@@ -1,6 +1,6 @@
services:
glucose-dashboard:
image: gitea.thuis.local/willem/glucose-dashboard:latest
image: gitea.zb.local/willem/glucose-dashboard:latest
container_name: glucose-dashboard
restart: unless-stopped
ports: