Authelia

Authelia

Initialisation de l'environnement

apt update apt install build-essential wget ca-certificates git npm -y npm install -g pnpm wget https://golang.org/dl/go1.17.2.linux-amd64.tar.gz -O /tmp/go1.17.2.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go1.17.2.linux-amd64.tar.gz useradd authelia -r -s /bin/false -m -d /usr/lib/authelia </code bash> Compilation <code> export PATH=$PATH:/usr/local/go/bin:/usr/local/bin/ git clone https://github.com/authelia/authelia.git /tmp/authelia cd /tmp/authelia go mod download go run cmd/authelia-scripts/*.go build cp -fr dist/* /usr/lib/authelia

Configuration initial

mkdir /etc/authelia cp config.template.yml /etc/authelia/configuration.yml sed ':a;N;$!ba;s/\[Service\]\nExecStart=\/usr\/bin/[Service\]\nUser=authelia\nGroup=authelia\nExecStart=\/usr\/lib\/authelia/' authelia.service > /etc/systemd/system/authelia.service systemctl enable authelia

Editer le fichier de configuration /etc/authelia/configuration.yml et testé :

/usr/lib/authelia/authelia --config /etc/authelia/configuration.yml

haproxy

source : https://github.com/TimWolla/haproxy-auth-request

apt install lua-json cd /usr/share/haproxy/ wget https://raw.githubusercontent.com/TimWolla/haproxy-auth-request/main/auth-request.lua mkdir haproxy-lua-http wget https://raw.githubusercontent.com/haproxytech/haproxy-lua-http/master/http.lua

dans la conf de haproxy

global # *snip* lua-prepend-path /usr/share/haproxy/?/http.lua # If haproxy-lua-http is saved as /usr/share/haproxy/haproxy-lua-http/http.lua lua-load /usr/share/haproxy/auth-request.lua