leeand00
leeand00

Reputation: 26402

Binding gitea to the localhost address for tunneling?

I've found some configuration which appears to indicate the port the gitea binds to, see below:

hos

I changed the actual address of the machine to 127.0.0.1 (the loopback) thinking that I would be able to make gitea accessible only by tunneling into the device with SSH, but when I restart the service I can still access it via the device's ip on port 3000.

Shouldn't changing the ROOT_URL and HTTP_PORT cause it to be bound to the loopback address, requiring me to do port forwarding through my SSH client to reach port http://127.0.0.1:3000?

P.S. If you feel this question does not belong on Stack Exchange, go ahead and send it over to another site that is more well suited to it; but I would think that gitea isn't used too much by people other than programmers, which is why I posted it here.

Upvotes: 1

Views: 2100

Answers (2)

radiospiel
radiospiel

Reputation: 2489

Just repeating what @leeand00 says: gitea's config lists HTTP_ADDR as the relevant setting. https://docs.gitea.io/en-us/config-cheat-sheet/

Afterwards, netstat -tulpn | grep 3000 is certainly a good check to see if everything is right :)

Upvotes: 2

Michael Jarrett
Michael Jarrett

Reputation: 425

To double-check that Gitea is actually listening only on the loopback interface, check the output of

netstat -tulpn | grep 3000

which should appear as 127.0.0.1:3000 (in the 3rd column). Any other binding would indicate that your changes to the config haven't affected the service, and that it's still binding to other interfaces.

Upvotes: 2

Related Questions