Better sh hl
This commit is contained in:
@ -41,7 +41,7 @@ Les deux modes son configurables application par application.
|
||||
## Installation
|
||||
---
|
||||
Structure des dossiers :
|
||||
```console
|
||||
```sh
|
||||
root
|
||||
└── docker
|
||||
└── authentik
|
||||
@ -55,13 +55,13 @@ root
|
||||
|
||||
Créez les dossiers :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo mkdir -p /docker/authentik/media /docker/authentik/certs /docker/authentik/custom-template /docker/authentik/ssh
|
||||
```
|
||||
|
||||
Positionnez vous dans le dossier `authentik` et générez un mot de passe et une clé secrete que l'on va intégrer dans le .env :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo echo "PG_PASS=$(openssl rand 36 | base64)" >> .env
|
||||
sudo echo "AUTHENTIK_SECRET_KEY=$(openssl rand 60 | base64)" >> .env
|
||||
```
|
||||
@ -69,7 +69,7 @@ sudo echo "AUTHENTIK_SECRET_KEY=$(openssl rand 60 | base64)" >> .env
|
||||
:::list{type="info"}
|
||||
- Afin de générer la clé, nous avons créé les dossiers en amont du déploiement via Dockge. Dockge vous empechera de créer une stack du meme nom dans ces dossiers s'il n'existe pas de `compose.yml`. Il faut donc créer un `compose.yml` vide afin que ce dernier la reconnaisse comme existante dans les stacks inactives :
|
||||
:::
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/authentik/compose.yml
|
||||
::
|
||||
|
||||
@ -205,7 +205,7 @@ Ouvrez le fichier `authentik-server.conf`.
|
||||
vous pouvez utiliser [File Browser](/serveex/files/file-browser) pour naviguer dans vos fichier et éditer vos documents au lieu d'utiliser les commandes du terminal.
|
||||
::
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/swag/config/nginx/authentik-server.conf
|
||||
```
|
||||
|
||||
@ -220,7 +220,7 @@ Si ce n'est pas le cas, passez en mode modification en tapant `i` et éditez les
|
||||
|
||||
Créez le fichier `auth.subdomain.conf`
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/swag/config/nginx/proxy-confs/auth.subdomain.conf
|
||||
|
||||
```
|
||||
@ -339,7 +339,7 @@ Pourquoi le faire alors que Dockge a déjà une page d'authentification ? Tout s
|
||||
|
||||
Ensuite rendez-vous dans le fichier `dockge.mondomaine.fr`.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/swag/config/nginx/proxy-confs/dockge.subdomain.conf
|
||||
```
|
||||
|
||||
@ -422,7 +422,7 @@ Sur votre machine distante, à l'aide de [Dockge](/serveex/coeur/docker/#install
|
||||
|
||||
Si vous n'avez pas installé [Dockge](/serveex/coeur/docker/#installer-dockge-pour-gérer-et-déployer-les-conteneurs), créez un dossier `/docker/authentik-outpost`, ou directement en ligne de commande :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo mkdir -P /docker/authentik-outpost
|
||||
```
|
||||
|
||||
@ -435,7 +435,7 @@ Créez le fichier `compose.yaml` ou copiez la configuration directement dans le
|
||||
|
||||
En ligne de commande :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/authentik-outpost/compose.yaml
|
||||
```
|
||||
Entrez en mode modification avec `i` et collez la configuration suivante, en changeant les chiffres de `{AUTHENTIK_TAG:proxy:2024.2.3}`{lang=properties} par la meme version que celle de votre serveur Authentik.
|
||||
@ -467,7 +467,7 @@ services:
|
||||
Rendez-vous sur la stack de SWAG de la machine distante (ou remplissez directement si vous avez [Dockge](/serveex/coeur/docker/#installer-dockge-pour-gérer-et-déployer-les-conteneurs)) et ajoutez le réseau de authentik-outpost dans le fichier de conf sur ce modele (les champs `networks`) :
|
||||
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/swag/compose.yaml
|
||||
```
|
||||
|
||||
@ -498,7 +498,7 @@ Si vous avez [Dockge](/serveex/coeur/docker/#installer-dockge-pour-g"rer-et-d"pl
|
||||
|
||||
Sinon, via le terminal :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
cd /docker/swag/
|
||||
sudo docker compose up -d
|
||||
```
|
||||
@ -507,7 +507,7 @@ Creez (ou remplissez directement si vous avez [Dockge](/serveex/coeur/docker/#in
|
||||
|
||||
En ligne de commande :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/authentik-outpost/.env
|
||||
```
|
||||
|
||||
@ -530,7 +530,7 @@ Si vous avez [Dockge](/serveex/coeur/docker/#installer-dockge-pour-g"rer-et-d"pl
|
||||
|
||||
Sinon, via le terminal :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
cd /docker/authentik-outpost/
|
||||
sudo docker compose up -d
|
||||
```
|
||||
@ -542,7 +542,7 @@ Nous allons a présent configurer SWAG.
|
||||
|
||||
Ouvrez le fichier `authentik-server.conf`.
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo vi /docker/swag/config/nginx/authentik-server.conf
|
||||
```
|
||||
|
||||
@ -561,19 +561,19 @@ Ensuite, configurez les applications à protéger selon si elles sont [natives](
|
||||
---
|
||||
Sur la machine d'origine, dumper la bdd :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo docker exec authentik-postgres pg_dump -U authentik -F t authentik > /path/to/mydb.tar
|
||||
```
|
||||
|
||||
Puis l'envoyer sur la machine cible. Sur la machine cible, copier le fichier dans le container docker
|
||||
|
||||
```shell
|
||||
```sh
|
||||
cp /path/to/mydb.tar authentik-postgres:/path/to/wherever
|
||||
```
|
||||
|
||||
(Optionnel) Purgez les tables existantes :
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo docker exec -i authentik-postgres psql -U authentik -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'authentik' AND pid <> pg_backend_pid();" && \
|
||||
sudo docker exec -i authentik-postgres psql -U authentik -d postgres -c "DROP DATABASE IF EXISTS authentik;" && \
|
||||
sudo docker exec -i authentik-postgres psql -U authentik -d postgres -c "CREATE DATABASE authentik;" && \
|
||||
@ -581,6 +581,6 @@ sudo docker exec -i authentik-postgres psql -U authentik -d postgres -c "CREATE
|
||||
|
||||
Restaurez la bdd
|
||||
|
||||
```shell
|
||||
```sh
|
||||
sudo docker exec authentik-postgresql pg_restore -U authentik -d authentik /path/to/wherever/mydb.tar
|
||||
```
|
Reference in New Issue
Block a user