RIGHT NOW GITEA KEEPS LOGGED IN AS FIRST USER SO IT’S NOT PERFECT, THERE’S A KNOWN ISSUE

  1. We need to update the logout button to the authentik logout URL: wget -O /var/lib/gitea/custom/templates/base/head_navbar.tmpl https://raw.githubusercontent.com/go-gitea/gitea/main/templates/base/head_navbar.tmpl

  2. Replace the old logout URL with the new: sed -i 's#/user/logout#/akprox/sign_out#g' /var/lib/gitea/custom/templates/base/head_navbar.tmpl

I did notice when replacing the URL to logout it doesn’t directly log you out, but will be logged out next time you try to do anything

Now it’s time to config gitea; nano /etc/gitea/app.ini

[security]
REVERSE_PROXY_AUTHENTICATION_USER    = X-authentik-username
REVERSE_PROXY_AUTHENTICATION_EMAIL   = X-authentik-email
REVERSE_PROXY_LIMIT                  = 1
REVERSE_PROXY_TRUSTED_PROXIES        = 127.0.0.1

[service]
ENABLE_REVERSE_PROXY_AUTHENTICATION     = true
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION  = false
ENABLE_REVERSE_PROXY_EMAIL              = true