docs: add auth portal usage guide

This commit is contained in:
deadcxap
2025-08-27 13:41:10 +03:00
parent 1768a58344
commit bc29b92ae9
5 changed files with 76 additions and 41 deletions
+21 -11
View File
@@ -1,24 +1,34 @@
{
email dead@cxap.space
dns cloudflare {$CF_API_TOKEN}
order authorize before reverse_proxy
servers {
trusted_proxies static private_ranges
}
}
# общий сниппет авторизации
(tinyauth_forwarder) {
forward_auth tinyauth:3000 {
uri /api/auth/caddy
copy_headers Remote-User Remote-Name Remote-Email Remote-Groups
# Портал аутентификации
auth.realy.nothing.help {
route {
authp {
backends {
local_backend {
method local
path /data/users.json
}
}
ui {
links {
"Portainer" "https://port.realy.nothing.help"
}
}
}
}
}
# при желании — отдельный сниппет для API
(tinyauth_api_forwarder) {
forward_auth tinyauth:3000 {
uri /api/auth/caddy
header_up Authorization {http.request.header.X-Api-Key}
header_up Accept application/json
# Сниппет для защиты сервисов
(auth_portal_forwarder) {
authorize {
set auth url https://auth.realy.nothing.help
}
}