168 lines
6.2 KiB
Markdown
168 lines
6.2 KiB
Markdown
---
|
|
title: Tinyauth
|
|
created: 2026-06-06
|
|
updated: 2026-06-06
|
|
type: app
|
|
tags: [catalogue, reverse-proxy, authentication, authentification, oauth, go, auto-hebergement]
|
|
confidence: medium
|
|
contested: false
|
|
sources: [https://selfh.st/apps/?tag=Reverse+Proxy, https://github.com/steveiliop52/tinyauth]
|
|
---
|
|
|
|
# 🚦 Tinyauth
|
|
|
|
> **Reverse proxy léger d'authentification écrit en Go**. Idéal pour ajouter une couche d'authentification (OAuth, credentials) devant des apps self-hosted qui n'en ont pas nativement.
|
|
|
|
## 📋 Informations Générales
|
|
|
|
| Champ | Valeur |
|
|
| :--- | :--- |
|
|
| **Site web** | [tinyauth.app](https://tinyauth.app/) |
|
|
| **GitHub** | [steveiliop52/tinyauth](https://github.com/steveiliop52/tinyauth) |
|
|
| **License** | MIT |
|
|
| **Langage** | Go (frontend TypeScript/React) |
|
|
| **Étoiles GitHub** | 7 455 ⭐ |
|
|
| **Dernière MAJ** | 2026-05-31 |
|
|
| **Catégorie** | [[cat-reverse-proxy\|Reverse Proxy]], Auth Proxy |
|
|
|
|
## 📝 Description
|
|
|
|
**Tinyauth** est un **reverse proxy d'authentification minimaliste** pensé pour protéger des applications self-hosted qui n'exposent pas de mécanisme d'auth robuste. Concrètement, on le place **devant** une app (Grafana, Uptime Kuma, Homer, etc.) et il intercepte les requêtes pour exiger une connexion.
|
|
|
|
Fonctionnalités clés :
|
|
|
|
- ✅ **Support OAuth2 / OIDC** : Google, GitHub, GitLab, Generic OIDC
|
|
- ✅ **Username/password** classique avec hash bcrypt
|
|
- ✅ **Multi-utilisateurs** avec gestion des groupes
|
|
- ✅ **Cookie de session** sécurisé (HttpOnly, SameSite, expiration)
|
|
- ✅ **Docker labels discovery** : détecte automatiquement les apps à protéger
|
|
- ✅ **Léger** : binaire Go unique, consommation RAM <50 Mo
|
|
- ✅ **Interface web** pour la configuration
|
|
- ✅ **2FA TOTP** (optionnel)
|
|
|
|
**Public cible** : utilisateurs qui exposent leur homelab via Traefik/NPM et veulent **protéger rapidement** plusieurs services sans configurer Authentik/Authelia à chaque fois. Tinyauth fait le strict minimum mais le fait bien.
|
|
|
|
**Différenciation** : face à [[app-authelia]] (plus complet mais plus lourd) ou [[app-authentik]] (Identity Provider complet), Tinyauth joue la carte du **simple reverse proxy auth** qui se branche en 5 minutes. Idéal pour les petites installations.
|
|
|
|
## 🚀 Installation
|
|
|
|
### Docker Compose (standalone)
|
|
|
|
```yaml
|
|
# docker-compose.yml
|
|
services:
|
|
tinyauth:
|
|
image: ghcr.io/steveiliop52/tinyauth:latest
|
|
container_name: tinyauth
|
|
restart: unless-stopped
|
|
environment:
|
|
- SECRET=change-me-long-random-string
|
|
- USERS_FILE=/app/users.json
|
|
- TINYAUTH_DOMAIN=https://auth.example.com
|
|
volumes:
|
|
- ./users.json:/app/users.json:ro
|
|
- tinyauth_data:/app/data
|
|
networks:
|
|
- proxy
|
|
|
|
app-to-protect:
|
|
image: my-app:latest
|
|
networks:
|
|
- proxy
|
|
labels:
|
|
- "tinyauth.enable=true"
|
|
- "tinyauth.users=admin,user1"
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
|
|
volumes:
|
|
tinyauth_data:
|
|
```
|
|
|
|
### Intégration avec Traefik
|
|
|
|
Tinyauth s'utilise typiquement comme **middleware Traefik** via les labels Docker :
|
|
|
|
```yaml
|
|
services:
|
|
grafana:
|
|
image: grafana/grafana
|
|
networks:
|
|
- proxy
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.grafana.rule=Host(`grafana.example.com`)"
|
|
- "traefik.http.routers.grafana.entrypoints=websecure"
|
|
- "traefik.http.routers.grafana.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
|
|
- "tinyauth.enable=true" # protégé par tinyauth
|
|
- "tinyauth.users=admin,user1" # qui peut y accéder
|
|
```
|
|
|
|
## ⚙️ Configuration Initiale
|
|
|
|
1. **Définir le secret** : `openssl rand -hex 32` → mettre dans `SECRET`
|
|
2. **Créer `users.json`** avec mots de passe bcrypt :
|
|
```json
|
|
{
|
|
"users": {
|
|
"admin": "$2a$10$...",
|
|
"user1": "$2a$10$..."
|
|
}
|
|
}
|
|
```
|
|
3. **Configurer l'OAuth** (optionnel) : variables `GOOGLE_OAUTH_CLIENT_ID`, `GITHUB_OAUTH_CLIENT_ID`, etc.
|
|
4. **Pointer DNS** `auth.example.com` vers le reverse proxy (Traefik/NPM)
|
|
5. **Ajouter les labels Docker** sur les services à protéger
|
|
6. **Premier login** : créer le compte admin, tester l'accès à une app protégée
|
|
|
|
## 🔀 Alternatives
|
|
|
|
### Open Source
|
|
|
|
| Alternative | Différence | Étoiles |
|
|
| :--- | :--- | :---: |
|
|
| [[app-authelia]] | Plus complet (2FA, WebAuthn, ACL fines), plus lourd | 25k |
|
|
| [[app-authentik]] | Identity Provider complet, SSO, providers multiples | 16k |
|
|
| [[app-oauth2-proxy]] | Spécifiquement proxy OAuth, pas d'UI native | 14k |
|
|
| [[app-cloudflared]] | Tunnel Cloudflare + Access pour auth | 14k |
|
|
|
|
### Propriétaires
|
|
|
|
| Service | Modèle | Différence |
|
|
| :--- | :--- | :--- |
|
|
| **Cloudflare Access** | SaaS (gratuit jusqu'à 50 users) | Tinyauth en local vs Cloudflare-managed |
|
|
| **Auth0** | Freemium | Identity Provider hébergé, pas reverse proxy |
|
|
| **Okta** | Payant | IdP enterprise, complexe pour homelab |
|
|
|
|
## 🔒 Sécurité
|
|
|
|
- ✅ **Secret fort obligatoire** (32+ bytes random)
|
|
- ✅ **Hash bcrypt** pour les passwords (jamais en clair)
|
|
- ✅ **Cookies HttpOnly + Secure + SameSite=Strict**
|
|
- ✅ **Rate limiting** sur les endpoints d'auth
|
|
- ⚠️ **Single point of failure** : si Tinyauth tombe, toutes les apps protégées sont inaccessibles
|
|
- ⚠️ **Pas d'audit log natif** : brancher sur [[app-loki]] ou [[app-glances]] pour le monitoring
|
|
- ⚠️ **OIDC discovery** : bien configurer `TINYAUTH_DOMAIN` pour les callbacks
|
|
|
|
## 📚 Ressources
|
|
|
|
- [GitHub steveiliop52/tinyauth](https://github.com/steveiliop52/tinyauth)
|
|
- [Site officiel tinyauth.app](https://tinyauth.app/)
|
|
- [Documentation](https://tinyauth.app/docs)
|
|
- [Docker Hub](https://hub.docker.com/r/steveiliop52/tinyauth)
|
|
- [selfh.st/apps Tinyauth](https://selfh.st/apps/?tag=Reverse+Proxy#tinyauth)
|
|
|
|
## 🔗 Pages Liées
|
|
|
|
- [[app-caddy]] — Alternative reverse proxy avec support auth via plugins
|
|
- [[app-traefik]] — Reverse proxy souvent utilisé conjointement
|
|
- [[app-nginx-proxy-manager]] — UI web pour Nginx (sans auth intégrée)
|
|
- [[app-pangolin]] — Tunneled reverse proxy avec auth intégrée
|
|
- [[app-authelia]] — Alternative plus complète (2FA, ACL)
|
|
- [[app-oauth2-proxy]] — Spécifiquement proxy OAuth (Sécant)
|
|
- [[cat-reverse-proxy]] — Hub catégorie
|
|
- [[comparatif-reverse-proxy]] — Comparaison détaillée
|