diff --git a/docs/administration/authentication.md b/docs/administration/authentication.md index 5febea12..bbfe0ea3 100644 --- a/docs/administration/authentication.md +++ b/docs/administration/authentication.md @@ -337,9 +337,13 @@ The default login user email is `X-WEBAUTH-EMAIL`, you can change it via changin If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`. -You can also limit the reverse proxy's IP address range with `REVERSE_PROXY_TRUSTED_PROXIES` which default value is `127.0.0.0/8,::1/128`. By `REVERSE_PROXY_LIMIT`, you can limit trusted proxies level. +It applies to the web interface, Git over HTTP, Git LFS and the package registry. -You can enable the this authentication method for the API with +:::warning +Gitea trusts these headers on every request it receives. Make sure Gitea is only reachable through your authenticating proxy, and that the proxy sets or removes these headers on every request, including on paths you exempt from authentication, for example for Git or package clients. `REVERSE_PROXY_TRUSTED_PROXIES` does not restrict them. +::: + +To also accept them on the REST API under `/api/v1`, enable: ```ini [service] diff --git a/docs/administration/config-cheat-sheet.md b/docs/administration/config-cheat-sheet.md index 166baf6f..cfc6cadb 100644 --- a/docs/administration/config-cheat-sheet.md +++ b/docs/administration/config-cheat-sheet.md @@ -740,8 +740,8 @@ And the following unique queues: If you set it to false, maybe it also needs to set `ENABLE_BASIC_AUTHENTICATION` to false to completely disable password-based authentication. - `ENABLE_PASSKEY_AUTHENTICATION`: **true**: Allow users to sign-in with a passkey -- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication for web requests -- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible. +- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable reverse proxy authentication for the web interface, Git over HTTP, Git LFS and the package registry. Gitea must only be reachable through the proxy, see [Reverse Proxy](authentication.md#reverse-proxy). +- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable reverse proxy authentication for the REST API under `/api/v1`. - `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication. - `ENABLE_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a diff --git a/versioned_docs/version-1.27/administration/authentication.md b/versioned_docs/version-1.27/administration/authentication.md index 2cbd44cc..42bd0633 100644 --- a/versioned_docs/version-1.27/administration/authentication.md +++ b/versioned_docs/version-1.27/administration/authentication.md @@ -337,9 +337,13 @@ The default login user email is `X-WEBAUTH-EMAIL`, you can change it via changin If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`. -You can also limit the reverse proxy's IP address range with `REVERSE_PROXY_TRUSTED_PROXIES` which default value is `127.0.0.0/8,::1/128`. By `REVERSE_PROXY_LIMIT`, you can limit trusted proxies level. +It applies to the web interface, Git over HTTP, Git LFS and the package registry. -You can enable the this authentication method for the API with +:::warning +Gitea trusts these headers on every request it receives. Make sure Gitea is only reachable through your authenticating proxy, and that the proxy sets or removes these headers on every request, including on paths you exempt from authentication, for example for Git or package clients. `REVERSE_PROXY_TRUSTED_PROXIES` does not restrict them. +::: + +To also accept them on the REST API under `/api/v1`, enable: ```ini [service] diff --git a/versioned_docs/version-1.27/administration/config-cheat-sheet.md b/versioned_docs/version-1.27/administration/config-cheat-sheet.md index b2938f54..32b5f695 100644 --- a/versioned_docs/version-1.27/administration/config-cheat-sheet.md +++ b/versioned_docs/version-1.27/administration/config-cheat-sheet.md @@ -746,8 +746,8 @@ And the following unique queues: If you set it to false, maybe it also needs to set `ENABLE_BASIC_AUTHENTICATION` to false to completely disable password-based authentication. - `ENABLE_PASSKEY_AUTHENTICATION`: **true**: Allow users to sign-in with a passkey -- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication for web requests -- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible. +- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable reverse proxy authentication for the web interface, Git over HTTP, Git LFS and the package registry. Gitea must only be reachable through the proxy, see [Reverse Proxy](authentication.md#reverse-proxy). +- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable reverse proxy authentication for the REST API under `/api/v1`. - `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication. - `ENABLE_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a diff --git a/versioned_docs/version-28/administration/authentication.md b/versioned_docs/version-28/administration/authentication.md index 5febea12..bbfe0ea3 100644 --- a/versioned_docs/version-28/administration/authentication.md +++ b/versioned_docs/version-28/administration/authentication.md @@ -337,9 +337,13 @@ The default login user email is `X-WEBAUTH-EMAIL`, you can change it via changin If set `ENABLE_REVERSE_PROXY_FULL_NAME=true`, a user full name expected in `X-WEBAUTH-FULLNAME` will be assigned to the user when auto creating the user. You can also change the header name with `REVERSE_PROXY_AUTHENTICATION_FULL_NAME`. -You can also limit the reverse proxy's IP address range with `REVERSE_PROXY_TRUSTED_PROXIES` which default value is `127.0.0.0/8,::1/128`. By `REVERSE_PROXY_LIMIT`, you can limit trusted proxies level. +It applies to the web interface, Git over HTTP, Git LFS and the package registry. -You can enable the this authentication method for the API with +:::warning +Gitea trusts these headers on every request it receives. Make sure Gitea is only reachable through your authenticating proxy, and that the proxy sets or removes these headers on every request, including on paths you exempt from authentication, for example for Git or package clients. `REVERSE_PROXY_TRUSTED_PROXIES` does not restrict them. +::: + +To also accept them on the REST API under `/api/v1`, enable: ```ini [service] diff --git a/versioned_docs/version-28/administration/config-cheat-sheet.md b/versioned_docs/version-28/administration/config-cheat-sheet.md index a75d7284..2ecadfb2 100644 --- a/versioned_docs/version-28/administration/config-cheat-sheet.md +++ b/versioned_docs/version-28/administration/config-cheat-sheet.md @@ -739,8 +739,8 @@ And the following unique queues: If you set it to false, maybe it also needs to set `ENABLE_BASIC_AUTHENTICATION` to false to completely disable password-based authentication. - `ENABLE_PASSKEY_AUTHENTICATION`: **true**: Allow users to sign-in with a passkey -- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication for web requests -- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible. +- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable reverse proxy authentication for the web interface, Git over HTTP, Git LFS and the package registry. Gitea must only be reachable through the proxy, see [Reverse Proxy](authentication.md#reverse-proxy). +- `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`: **false**: Enable reverse proxy authentication for the REST API under `/api/v1`. - `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication. - `ENABLE_REVERSE_PROXY_EMAIL`: **false**: Enable this to allow to auto-registration with a