Prova aggiunta pipeline CI/CD

This commit is contained in:
La Programmatrice Verde
2025-12-29 23:46:06 +01:00
parent 30832e6cce
commit 6ac8a7d096
4 changed files with 38 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
name: Compila e pubblica sul registro integrato
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
Build-Docker-Image:
runs-on: ubuntu-latest
container: catthehacker/ubuntu-act:latest
steps:
- name: Login to Docker Registry
run: echo "${{ secrets.REGISTRYTOKEN }}" | docker login "${{ vars.REGISTRY_URL }}" -u "${{ github.repository_owner }}" --password-stdin
- name: Checkout Code
uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t ${{ github.repository }}:latest .
- name: Push Docker image
run: |
docker push "${{ github.repository }}:latest"

View File

@@ -31,6 +31,6 @@ Il programma restituisce come codice di errore:
## Docker
Docker run:
`docker run -p 3000:3000 -e BASE_TOKEN=<token> -e HOSTNAMES="<hostname1>;<hostname2>" -v /var/log/NetBird-UptimeKuma:/app/log test`
`docker run -p 3000:3000 -e BASE_TOKEN=<token> -e HOSTNAMES="<hostname1>;<hostname2>" -v /var/log/NetBird-UptimeKuma:/app/log gitea.laprogrammatriceverde.crabdance.com/Verde/NetBird-UptimeKuma:latest`
Per il Docker compose, vedere il file relativo.

View File

@@ -1,7 +1,7 @@
---
services:
netbird-uptimekuma:
build: .
image: gitea.laprogrammatriceverde.crabdance.com/Verde/NetBird-UptimeKuma:latest
ports:
- 3000:3000
environment:

View File

@@ -36,3 +36,14 @@ if ("BASE_TOKEN" in process.env) {
app.get("/", (_, res) => {
res.json(shared.getHosts());
});
/*
TODO:
- Fare in modo che la durata del timer di rinnovo sia dinamica e dipenda dalla durata rimasta del token inserito
- Fare in modo che con CTRL+C il programma effettivamente esca
- Aggiungere un timer modificato dall'esterno (opzionale, default 1 giorno) che decida per quanto tenere un log prima di cancellarlo
- Quando un log viene cancellato copiare il token corrente nel log
- All'uscita del programma far stampare l'ultimo token in uso
- Usare i log con docker logs
- Aggiornare Node e il metodo di build
*/