go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.21k stars 5.5k forks source link

Repo links on dashboard wrong when using a proxy frontend #20450

Closed doodyd closed 2 years ago

doodyd commented 2 years ago

Description

The repository links on the dashboard repository widget are incorrect when gitea is behind a proxy (HAProxy in my case). All other links so far encountered are correct.

Example:

Repository link on dashboard (repo widget, pictured below):

http://gitea.example.com:3000/org/repo-name

All other repo links (all other links so far):

https://proxy-name.example.com/org/repo-name

Gitea Version

1.16.7

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

n/a

Screenshots

image

Git Version

2.35.2

Operating System

TrueNAS-13.0-U1 Core (jail)

How are you running Gitea?

Installed in jail from default package manager

Database

MySQL

silverwind commented 2 years ago

Generally this can be solved via configuration by setting ROOT_URL accordingly, but I'll take this up as a bug as we should not render absolute URLs in HTML where relative ones (without origin) are sufficient.

wxiaoguang commented 2 years ago

This one #19345

silverwind commented 2 years ago

Okay, it's a duplicate then.

doodyd commented 2 years ago

Thanks for the feedback and the tip. I searched the issues for a similar problem but it can be difficult to know what terms to use. Changing the ROOT_URL has resolved the issue.

LaserLV52 commented 2 years ago

Hi, i have installed the gitea in Truenas Scale (not core). Now, i have the ROOT_URL error too. But, when i modify the ROOT_URL in app.ini and reboot the gitea, the ROOT_URL didn't work, it still convert back into the default ROOT_URL in app.ini. Do you have any idea? thanks!