Incorrect SSH Clone Address Displayed on Gitea Website #11546

Closed
opened 2025-11-02 09:40:43 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @fereydoon031 on GitHub (Aug 27, 2023).

Description

I have encountered an issue while using Gitea in a multi-system environment. When attempting to clone a repository from the Gitea website on a remote system, the SSH clone address displayed is incorrect. The displayed address is in the format of org@localhost:address/repo_name.git instead of the expected org@IP_OF_SERVER:address/repo_name.git.

Steps to Reproduce:

  1. Install and set up Gitea on a system.
  2. Create a repository within Gitea.
  3. Access the Gitea repository through the web interface from a remote system.
  4. Click on the "SSH" button to get the SSH clone address.

Expected Behavior:
The SSH clone address displayed should be in the format of org@IP_OF_SERVER:address/repo_name.git to allow successful cloning from a remote system.

Actual Behavior:
The SSH clone address displayed is in the format of org@localhost:address/repo_name.git, which is incorrect for remote system cloning.

Additional Information:

Gitea Version: 1.20.3
Operating System: Windows 11
Web Browser: Chrome

Workaround:
Currently, I'm manually editing the clone address to replace "localhost" with the IP address of the server before cloning. However, this is not an ideal solution!

Thank you for your attention to this matter.

Screenshots

Expected Behavior:
The SSH clone address displayed should be in the format of org@IP_OF_SERVER:address/repo_name.git to allow successful cloning from a remote system.

Actual Behavior:
The SSH clone address displayed is in the format of org@localhost:address/repo_name.git, which is incorrect for remote system cloning.

Gitea Version

1.20.3

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

Windows

Browser Version

Chrome - Version 116.0.5845.111 (Official Build) (64-bit)

Originally created by @fereydoon031 on GitHub (Aug 27, 2023). ### Description I have encountered an issue while using Gitea in a multi-system environment. When attempting to clone a repository from the Gitea website on a remote system, the SSH clone address displayed is incorrect. The displayed address is in the format of `org@localhost:address/repo_name.git` instead of the expected `org@IP_OF_SERVER:address/repo_name.git`. **Steps to Reproduce:** 1. Install and set up Gitea on a system. 2. Create a repository within Gitea. 3. Access the Gitea repository through the web interface from a remote system. 4. Click on the "SSH" button to get the SSH clone address. **Expected Behavior:** The SSH clone address displayed should be in the format of `org@IP_OF_SERVER:address/repo_name.git` to allow successful cloning from a remote system. **Actual Behavior:** The SSH clone address displayed is in the format of `org@localhost:address/repo_name.git`, which is incorrect for remote system cloning. **Additional Information:** Gitea Version: 1.20.3 Operating System: Windows 11 Web Browser: Chrome **Workaround:** Currently, I'm manually editing the clone address to replace "localhost" with the IP address of the server before cloning. However, this is not an ideal solution! Thank you for your attention to this matter. ### Screenshots **Expected Behavior:** The SSH clone address displayed should be in the format of `org@IP_OF_SERVER:address/repo_name.git` to allow successful cloning from a remote system. **Actual Behavior:** The SSH clone address displayed is in the format of `org@localhost:address/repo_name.git`, which is incorrect for remote system cloning. ### Gitea Version 1.20.3 ### Can you reproduce the bug on the Gitea demo site? Yes ### Operating System Windows ### Browser Version Chrome - Version 116.0.5845.111 (Official Build) (64-bit)
GiteaMirror added the type/questionissue/needs-feedback labels 2025-11-02 09:40:43 -06:00
Author
Owner

@KazzmanK commented on GitHub (Aug 27, 2023):

What is your SSH_DOMAIN configuration , according to
https://discourse.gitea.io/t/how-to-set-ssh-to-alow-users-with-gite-account-to-clone-via-ssh/2297

?

@KazzmanK commented on GitHub (Aug 27, 2023): What is your `SSH_DOMAIN` configuration , according to https://discourse.gitea.io/t/how-to-set-ssh-to-alow-users-with-gite-account-to-clone-via-ssh/2297 ?
Author
Owner

@fereydoon031 commented on GitHub (Sep 2, 2023):

Here is my configuration. However, when I try to clone it on the client PC, I can see the IP address of the server for HTTP, whereas, for SSH, I only see "localhost"

[server]
SSH_DOMAIN = localhost
DOMAIN = localhost
HTTP_PORT = 3000
ROOT_URL = http://localhost:3000/

I believe it would be better if SSH could automatically obtain the server's IP address, similar to how HTTP does.

@fereydoon031 commented on GitHub (Sep 2, 2023): Here is my configuration. However, when I try to clone it on the client PC, I can see the IP address of the server for HTTP, whereas, for SSH, I only see "localhost" `[server]` `SSH_DOMAIN = localhost` `DOMAIN = localhost` `HTTP_PORT = 3000` `ROOT_URL = http://localhost:3000/` I believe it would be better if SSH could automatically obtain the server's IP address, similar to how HTTP does.
Author
Owner

@lunny commented on GitHub (Sep 4, 2023):

Because many websites are behind a proxy, these domains should be the reverse proxy's domains, Gitea cannot retrieve it.

@lunny commented on GitHub (Sep 4, 2023): Because many websites are behind a proxy, these domains should be the reverse proxy's domains, Gitea cannot retrieve it.
Author
Owner

@techknowlogick commented on GitHub (Sep 6, 2023):

Yup, if you update SSH_DOMAIN to what you want it to show, then that part of the UI will update.

@techknowlogick commented on GitHub (Sep 6, 2023): Yup, if you update SSH_DOMAIN to what you want it to show, then that part of the UI will update.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11546