Admin interface: config summary shows unused option #13213

Open
opened 2025-11-02 10:35:10 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @balki on GitHub (Jun 26, 2024).

Description

On the configuration summary page - [gitea-instance]/admin/config , I see below setting

Reverse Authentication User    X-WEBAUTH-USER

This setting is not applicable unless ENABLE_REVERSE_PROXY_AUTHENTICATION is true. This is false by default.

Displaying this setting is confusing, useless and not applicable.


Possible solution is to guard this entry with a check (untested)

❯ git diff  
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 8c16429920..f7de7c1b74 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -44,8 +44,10 @@
                                <dd>{{.LogRootPath}}</dd>
                                <dt>{{ctx.Locale.Tr "admin.config.script_type"}}</dt>
                                <dd>{{.ScriptType}}</dd>
+                {{if .Service.EnableReverseProxyAuth}}
                                <dt>{{ctx.Locale.Tr "admin.config.reverse_auth_user"}}</dt>
                                <dd>{{.ReverseProxyAuthUser}}</dd>
+                {{end}}
                        </dl>
                </div>

Screenshots

image

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

N/A

Operating System

Linux

Browser Version

Firefox

Originally created by @balki on GitHub (Jun 26, 2024). ### Description On the configuration summary page - [gitea-instance]/admin/config , I see below setting ``` Reverse Authentication User X-WEBAUTH-USER ``` This setting is not applicable unless `ENABLE_REVERSE_PROXY_AUTHENTICATION` is true. This is false by default. Displaying this setting is confusing, useless and not applicable. --- Possible solution is to guard this entry with a check (untested) ``` ❯ git diff diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 8c16429920..f7de7c1b74 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -44,8 +44,10 @@ <dd>{{.LogRootPath}}</dd> <dt>{{ctx.Locale.Tr "admin.config.script_type"}}</dt> <dd>{{.ScriptType}}</dd> + {{if .Service.EnableReverseProxyAuth}} <dt>{{ctx.Locale.Tr "admin.config.reverse_auth_user"}}</dt> <dd>{{.ReverseProxyAuthUser}}</dd> + {{end}} </dl> </div> ``` ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/189196/1b606d79-8bc2-4bb2-9ebd-fc6a58480dcd) ### Gitea Version 1.22.0 ### Can you reproduce the bug on the Gitea demo site? N/A ### Operating System Linux ### Browser Version Firefox
GiteaMirror added the type/bugtopic/ui labels 2025-11-02 10:35:10 -06:00
Author
Owner

@yp05327 commented on GitHub (Jun 27, 2024):

Can you create a PR to fix it. 😄

@yp05327 commented on GitHub (Jun 27, 2024): Can you create a PR to fix it. 😄
Author
Owner

@balki commented on GitHub (Jun 27, 2024):

I can create with just the proposed change. But may be it needs a minor redesign. I see there is a similar another setting ENABLE_REVERSE_PROXY_AUTHENTICATION_API which also may need to be checked.. There are more similar settings that are not in the summary now.

REVERSE_PROXY_AUTHENTICATION_EMAIL
REVERSE_PROXY_AUTHENTICATION_FULL_NAME
@balki commented on GitHub (Jun 27, 2024): I can create with just the proposed change. But may be it needs a minor redesign. I see there is a similar another setting `ENABLE_REVERSE_PROXY_AUTHENTICATION_API` which also may need to be checked.. There are more similar settings that are not in the summary now. ``` REVERSE_PROXY_AUTHENTICATION_EMAIL REVERSE_PROXY_AUTHENTICATION_FULL_NAME ```
Author
Owner

@yp05327 commented on GitHub (Jun 28, 2024):

Maybe it is better to genereted /admin/config by code, but not hard coding it in templates.

@yp05327 commented on GitHub (Jun 28, 2024): Maybe it is better to genereted /admin/config by code, but not hard coding it in templates.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13213