878982d01709aaec65e82513707228962718e475
Build and Push to Registry / build (push) Successful in 7s
878982d017
·
2026-04-13 01:17:24 +02:00
31 Commits
thePlug - plugger/proxy Barese
icona di una presa della spina idk
Architettura
FastAPI + MongoDB + Redis
Quick Setup (prod)
bash <(curl -s https://git.reloia.uk/reloia/thePlug/raw/branch/master/setup.sh)
Setup Dev
imposta le variabili d'ambiente
cp .env.example .env
# modifica le variabili
nano .env
variabili auth richieste in .env:
JWT_SECRET_KEY=change-this-secret
JWT_ALGORITHM=HS256
JWT_EXPIRE_MINUTES=30
AUTH_USERNAME=admin
AUTH_PASSWORD=change-this-password
avvia i servizi e il server locale
docker compose up -d mongodb redis
fastapi dev app/main.py
accedi a FastAPI su: FastAPI docs
Auth API
Gli endpoint auth disponibili sono solo:
POST /auth/loginPOST /auth/logout
Esempio login:
curl -X POST http://localhost:3671/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"change-this-password"}'
L'access token ottenuto va inviato come bearer token:
curl http://localhost:3671/proxy \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Esempio logout (revoca server-side del token):
curl -X POST http://localhost:3671/auth/logout \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Documentazione per Sviluppo
Languages
Python
89.5%
Shell
9.5%
Dockerfile
1%