Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion as to where reverse proxy headers go in app.ini #33769

Open
yatesco opened this issue Mar 2, 2025 · 2 comments
Open

Confusion as to where reverse proxy headers go in app.ini #33769

yatesco opened this issue Mar 2, 2025 · 2 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@yatesco
Copy link

yatesco commented Mar 2, 2025

Description

Hi, in https://docs.gitea.com/usage/authentication#reverse-proxy it states that various settings can be overridden, for example REVERSE_PROXY_AUTHENTICATION_USER. It doesn't, however, explicitly state where they should go in app.ini. Given that the only section that is referenced is [service] I naively put them in there.

Moving

REVERSE_PROXY_AUTHENTICATION_USER = Remote-User
REVERSE_PROXY_AUTHENTICATION_EMAIL = Remote-Email

to the [security] section worked.

My question is, how am I supposed to know, as a reader, that those headers shouldn't be in the [service] section? Happy to do a PR to clarify the wording if that helps?

(This is in the context of trying to configure this for Authelia forward auth via Caddy. With the header overrides set in the [service] section, Gitea failed to "notice" the authenticated user and so required additional logging in. Moving them to the [security] section and suddenly the user could login successfully.)

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Image

Git Version

No response

Operating System

No response

How are you running Gitea?

natively in proxmox debian LXC

Database

None

@lunny
Copy link
Member

lunny commented Mar 2, 2025

It should be under section service but security. I believe why it works because now they are using default values after your moving.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Mar 2, 2025
@wxiaoguang
Copy link
Contributor

See https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini

[service]
ENABLE_REVERSE_PROXY_AUTHENTICATION

[security]
REVERSE_PROXY_AUTHENTICATION_EMAIL
REVERSE_PROXY_AUTHENTICATION_USER

A lot of Gitea's code is crowd-contributed (open source), so some designs are very casual. Just get used to it ......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

No branches or pull requests

3 participants