Protects dashboard
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
conf/acme.json
|
conf/acme.json
|
||||||
|
.env
|
||||||
|
16
README.md
16
README.md
@@ -9,8 +9,24 @@ chmod 600 conf/acme.json
|
|||||||
docker network create web
|
docker network create web
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Créer et remplir le fichier `.env` sur ce modèle :
|
||||||
|
|
||||||
|
```
|
||||||
|
HOSTNAME=host.domain.tld
|
||||||
|
DASHBOARDUSERS=username:mot_de_passe_chiffré_avec_htpasswd
|
||||||
|
```
|
||||||
|
|
||||||
|
Pour créer le mot de passe utiliser la commande
|
||||||
|
|
||||||
|
```bash
|
||||||
|
htpasswd -n [username]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Pour ajouter un service :
|
Pour ajouter un service :
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
Dans le fichier `docker-compose.yml` de ce service , ajouter le réseau `web` :
|
Dans le fichier `docker-compose.yml` de ce service , ajouter le réseau `web` :
|
||||||
```yaml
|
```yaml
|
||||||
networks:
|
networks:
|
||||||
|
@@ -8,7 +8,6 @@
|
|||||||
level = "WARNING"
|
level = "WARNING"
|
||||||
|
|
||||||
[api]
|
[api]
|
||||||
insecure = true
|
|
||||||
dashboard = true
|
dashboard = true
|
||||||
|
|
||||||
[entryPoints]
|
[entryPoints]
|
||||||
|
@@ -6,7 +6,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
- "8080:8080"
|
|
||||||
networks:
|
networks:
|
||||||
- web
|
- web
|
||||||
volumes:
|
volumes:
|
||||||
@@ -14,6 +13,13 @@ services:
|
|||||||
- ./conf/traefik.toml:/etc/traefik/traefik.toml:ro
|
- ./conf/traefik.toml:/etc/traefik/traefik.toml:ro
|
||||||
- ./conf/acme.json:/acme.json
|
- ./conf/acme.json:/acme.json
|
||||||
- ./conf/custom:/etc/traefik/custom:ro
|
- ./conf/custom:/etc/traefik/custom:ro
|
||||||
|
labels:
|
||||||
|
- "traefik.http.routers.dashboard.rule=Host(`${HOSTNAME}`)"
|
||||||
|
- "traefik.http.routers.dashboard.service=api@internal"
|
||||||
|
- "traefik.http.routers.dashboard.middlewares=auth"
|
||||||
|
- traefik.http.routers.dashboard.tls=true
|
||||||
|
- traefik.http.routers.dashboard.tls.certresolver=myresolver
|
||||||
|
- "traefik.http.middlewares.auth.basicauth.users=${DASHBOARDUSERS}"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
web:
|
web:
|
||||||
|
Reference in New Issue
Block a user