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
44.51k stars 5.44k forks source link

git lfs doesn't use client selected server host name but instead return to client url with hardcoded host name #17586

Closed SebTardif closed 2 years ago

SebTardif commented 2 years ago

Gitea Version

1.15.0

Git Version

2.27.0

Operating System

centos 7

How are you running Gitea?

Bash terminal: [user@ip-34-223-14-199 hooks]$ git lfs --version git-lfs/3.0.2 (GitHub; linux amd64; go 1.17) [user@ip-34-223-14-199 hooks]$ git --version git version 1.8.3.1

Database

No response

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

.

Description

When configuring gitea we have the option of selecting the host name for http, and a different hostname for https. That hostname will shows up in the clone URL in the UI for the user that want to know the URL to clone from their client.

We left our gitea configuration to use 'localhost'. We didn't care because from the terminal we just use the right hostname like: git clone myGitea/myrepo.git

However, it seems to fail when using lfs. When we clone a repo with git lfs, and run in debug mode like: GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone myGitea/myrepo.git

We will see strange error message using 'localhost'.... like: Error downloading object: xxx/images/nifi/gccs-nifi-controllers-api-nar-0.1.nar (db73af5): Smudge error: Error downloading xxx/images/nifi/gccs-nifi-controllers-api-nar-0.1.nar (db73af502651ccd630cc9fd084b6127e18864501d30f88f62cb69f20af12b567): LFS: Get "http://localhost/myrepo.git/info/lfs/objects/db73af502651ccd630cc9fd084b6127e18864501d30f88f62cb69f20af12b567": dial tcp [::1]:3000: connect: connection refused

Screenshots

.

wxiaoguang commented 2 years ago

Your ROOT_URL in app.ini is wrong. Feel free to re-open.