Label terminal commands and directory trees in code blocks

This commit is contained in:
Djeex
2026-08-31 19:57:52 +02:00
parent 61f4b0447b
commit baf3590186
53 changed files with 214 additions and 206 deletions
@@ -62,7 +62,7 @@ __Warning__: If your IP is not static, use a Dynamic DNS service ([DynDNS](https
### Folder Structure
```sh
```text [Directory tree]
root
└── docker
└── wg-easy
@@ -173,7 +173,7 @@ We assume the client server runs Linux with Docker installed.
### Folder Structure
```sh
```text [Directory tree]
root
└── docker
└── wireguard
@@ -184,7 +184,7 @@ root
Create the folder:
```sh
```bash [Terminal]
sudo mkdir -p /docker/wireguard/config/wg_confs
```
@@ -194,7 +194,7 @@ sudo mkdir -p /docker/wireguard/config/wg_confs
Create the `wg0.conf` file:
```sh
```bash [Terminal]
sudo nano /docker/wireguard/config/wg_confs/wg0.conf
```
@@ -202,7 +202,7 @@ Paste the downloaded configuration, then save with :kbd{value="Ctrl+O"}, :kbd{va
::tip
✨ **Alternative method:** Transfer the file via SFTP and move it:
```sh
```bash [Terminal]
sudo cp ~/wg0.conf /docker/wireguard/config/wg_confs
```
::
@@ -230,7 +230,7 @@ services:
```
Start the container:
```sh
```bash [Terminal]
cd /docker/wireguard
sudo docker compose up -d
```
+18 -18
View File
@@ -39,7 +39,7 @@ Both modes can be configured on a per-application basis.
## Installation
Folder structure:
```sh
```text [Directory tree]
root
└── docker
└── authentik
@@ -53,13 +53,13 @@ root
Create the folders:
```sh
```bash [Terminal]
sudo mkdir -p /docker/authentik/media /docker/authentik/certs /docker/authentik/custom-template /docker/authentik/ssh
```
Navigate to the `authentik` folder via `cd /docker/authentik` and generate a password and secret key to include in the `.env` file:
```sh
```bash [Terminal]
sudo echo "PG_PASS=$(openssl rand 36 | base64)" >> .env
sudo echo "AUTHENTIK_SECRET_KEY=$(openssl rand 60 | base64)" >> .env
```
@@ -67,7 +67,7 @@ sudo echo "AUTHENTIK_SECRET_KEY=$(openssl rand 60 | base64)" >> .env
::note
To generate the keys, we created the folders ahead of deployment using Dockge. Dockge will prevent you from creating a stack with the same name in these folders unless a `compose.yml` file exists. So, create an empty `compose.yml` so it appears as an inactive stack:
```sh
```bash [Terminal]
sudo nano /docker/authentik/compose.yml
```
::
@@ -215,7 +215,7 @@ Open the `authentik-server.conf` file:
You can use [File Browser](/serveex/files/file-browser) to navigate and edit files instead of using terminal commands.
::
```sh
```bash [Terminal]
sudo nano /docker/swag/config/nginx/authentik-server.conf
```
@@ -230,7 +230,7 @@ If not, make the necessary changes, then save with :kbd{value="Ctrl+O"}, :kbd{va
Create the `auth.subdomain.conf` file:
```sh
```bash [Terminal]
sudo nano /docker/swag/config/nginx/proxy-confs/auth.subdomain.conf
```
@@ -343,7 +343,7 @@ Why do this when Dockge already has authentication? Because Dockge uses weak HTT
Edit the file `dockge.mydomain.com`:
```sh
```bash [Terminal]
sudo nano /docker/swag/config/nginx/proxy-confs/dockge.subdomain.conf
```
@@ -423,7 +423,7 @@ On your remote machine, use [Dockge](/serveex/core/docker/#installer-dockge-pour
If you havent installed [Dockge](/serveex/core/docker/#installer-dockge-pour-gérer-et-déployer-les-conteneurs), create a folder `/docker/authentik-outpost`, or directly via command line:
```sh
```bash [Terminal]
sudo mkdir -P /docker/authentik-outpost
```
@@ -436,7 +436,7 @@ Create the `compose.yaml` file or paste the configuration directly into Dockge i
Via command line:
```sh
```bash [Terminal]
sudo nano /docker/authentik-outpost/compose.yaml
```
Paste the following configuration, updating the version in `{AUTHENTIK_TAG:proxy:2024.2.3}`{lang=properties} to match your Authentik server version.
@@ -465,7 +465,7 @@ services:
Go to the SWAG stack on the remote machine (or edit directly using Dockge) and add the authentik-outpost network in the configuration file like this (see `networks` section):
```sh
```bash [Terminal]
sudo nano /docker/swag/compose.yaml
```
@@ -496,7 +496,7 @@ If using [Dockge](/serveex/core/docker/#installer-dockge-pour-gérer-et-déploye
Otherwise, via terminal:
```sh
```bash [Terminal]
cd /docker/swag/
sudo docker compose up -d
```
@@ -505,7 +505,7 @@ Create (or fill using Dockge) the `.env` file in the `authentik-outpost` directo
Via command line:
```sh
```bash [Terminal]
sudo nano /docker/authentik-outpost/.env
```
@@ -529,7 +529,7 @@ If using Dockge, deploy the stack.
Otherwise, via terminal:
```sh
```bash [Terminal]
cd /docker/authentik-outpost/
sudo docker compose up -d
```
@@ -540,7 +540,7 @@ Now, lets configure SWAG.
Open the `authentik-server.conf` file:
```sh
```bash [Terminal]
sudo nano /docker/swag/config/nginx/authentik-server.conf
```
@@ -558,24 +558,24 @@ Then configure the applications to protect as you did on your main server, wheth
## Migrating an Authentik Database
On the source machine, dump the database:
```sh
```bash [Terminal]
sudo docker exec authentik-postgres pg_dump -U authentik -F t authentik > /path/to/mydb.tar
```
Then transfer it to the target machine. On the target machine, copy the file into the Docker container:
```sh
```bash [Terminal]
cp /path/to/mydb.tar authentik-postgres:/path/to/wherever
```
(Optional) Purge existing tables:
```sh
```bash [Terminal]
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;"
```
Restore the database:
```sh
```bash [Terminal]
sudo docker exec authentik-postgresql pg_restore -U authentik -d authentik /path/to/wherever/mydb.tar
```
@@ -93,7 +93,7 @@ Create a file `tunnelconfig.yml` to reference in your SWAG `compose.yaml`.
__Tip:__ Use [File Browser](/serveex/files/file-browser) to navigate and edit files instead of using the terminal.
::
```sh
```bash [Terminal]
sudo nano /docker/swag/config/tunnelconfig.yml
```
@@ -119,7 +119,7 @@ Now configure _Cloudflare Real IP_.
Open the `nginx.conf` file:
```sh
```bash [Terminal]
sudo nano /docker/swag/config/nginx/nginx.conf
```