Update Git SSH URL After IP Change #13791

Closed
opened 2025-11-02 10:53:22 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @muellert on GitHub (Dec 5, 2024).

Description

I am running gitea on a VM where I recently changed the IP of that machine. If l look into a repo for the clone URLs, the HTTP URL gets updated with the new IP of the machine. The SSH URL however retains the old URL, and there does not appear to be any way to change the IP for that, short of going to the server and manually fiddling with the settings in the repos.

My expectation is that both URLs should be in sync, and automatically update to the new IP address.

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian Bookworm

How are you running Gitea?

I run gitea as a service under systemd.

Database

PostgreSQL

Originally created by @muellert on GitHub (Dec 5, 2024). ### Description I am running gitea on a VM where I recently changed the IP of that machine. If l look into a repo for the clone URLs, the HTTP URL gets updated with the new IP of the machine. The SSH URL however retains the old URL, and there does not appear to be any way to change the IP for that, short of going to the server and manually fiddling with the settings in the repos. My expectation is that both URLs should be in sync, and automatically update to the new IP address. ### Gitea Version 1.22.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Debian Bookworm ### How are you running Gitea? I run gitea as a service under systemd. ### Database PostgreSQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 10:53:22 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Dec 5, 2024):

Have a look in your configuration file. There should be an entry with your old IP.

@KN4CK3R commented on GitHub (Dec 5, 2024): Have a look in your configuration file. There should be an entry with your old IP.
Author
Owner

@muellert commented on GitHub (Dec 5, 2024):

Very good catch, but it still doesn't explain why the HTTP URL was correct without that change, while the git URL wasn't. Also, all the configuration items didn't mention git, only HTTP.

For the specific problem at hand, I made the change, and the URL was correct after that. I should look into the manual to see where this requirement is being mentioned.

@muellert commented on GitHub (Dec 5, 2024): Very good catch, but it still doesn't explain why the HTTP URL was correct without that change, while the git URL wasn't. Also, all the configuration items didn't mention git, only HTTP. For the specific problem at hand, I made the change, and the URL was correct after that. I should look into the manual to see where this requirement is being mentioned.
Author
Owner

@KN4CK3R commented on GitHub (Dec 5, 2024):

If you put only the

[server]
DOMAIN = ...

setting into your app.ini and drop your

[server]
SSH_DOMAIN = ...

it should use the server.DOMAIN setting to generate both links with the same domain.

@KN4CK3R commented on GitHub (Dec 5, 2024): If you put only the ``` [server] DOMAIN = ... ``` setting into your app.ini and drop your ``` [server] SSH_DOMAIN = ... ``` it should use the `server.DOMAIN` setting to generate both links with the same domain.
Author
Owner

@muellert commented on GitHub (Dec 5, 2024):

Thank you, that worked! My bad. :(

@muellert commented on GitHub (Dec 5, 2024): Thank you, that worked! My bad. :(
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13791