Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pain with setting base url when needed access from outside by public ip and inside network by internal ip #21007

Closed
NikolayUvarov opened this issue Aug 31, 2022 · 6 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@NikolayUvarov
Copy link

Description

  1. when starting configuration server listens localhost and not 0.0.0.0 as stating in its log, so
    2022/08/31 10:29:54 cmd/web.go:217:listen() [I] [630f0df2] Listen: http://0.0.0.0:3000
    2022/08/31 10:29:54 cmd/web.go:221:listen() [I] [630f0df2] AppURL(ROOT_URL): http://localhost:3000/
    is just confusing. User cannot connect to server from outside to initial configuration

  2. when setting addres from local net as AppURL e.g. 192.168.2.12:3000 server actually does not listen to that address, but continues response on localhost:3000.

  3. user cannot connect to both external and internal addresses of a server

Gitea Version

1.17.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

initial run via command line, next was planned to run via systemd

Database

No response

@lunny
Copy link
Member

lunny commented Aug 31, 2022

set ROOT_URL as your expected outside address

@lunny lunny added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Aug 31, 2022
@NikolayUvarov
Copy link
Author

then it does not work from inside. And I cannot set that url from outside via web console because I cannot access to console from remote. | can see that server works via wget localhost:3000 but not from 192.168.2.12:3000

@lunny
Copy link
Member

lunny commented Aug 31, 2022

That's another issue which has been reported in #19345

@NikolayUvarov
Copy link
Author

please help: what should i do when internal access URL is http://192.168.2.12:3000/
and external is http://11.22.33.44:8000/ ?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 31, 2022

I will try to answer some questions, and at the same time, you could understand more about your system and environment.

1. when starting configuration server listens localhost and not 0.0.0.0 as stating in its log, so
   2022/08/31 10:29:54 cmd/web.go:217:listen() [I] [630f0df2] Listen: http://0.0.0.0:3000
   2022/08/31 10:29:54 cmd/web.go:221:listen() [I] [630f0df2] AppURL(ROOT_URL): http://localhost:3000/
   is just confusing. User cannot connect to server from outside to initial configuration

Since Gitea shows Listen: http://0.0.0.0:3000, then it's already listening on all IP addresses.

AppURL is just for UI display and URL construction, it does nothing to the Listen address.

If user can not access it, please check your firewall (nat, etc) or other rules.

2. when setting addres from local net as AppURL e.g. 192.168.2.12:3000 server actually does not listen to that address, but continues response on localhost:3000.

Which address?

3. user cannot connect to both external and internal addresses of a server

If Gitea is listening on "0.0.0.0:3000", it should work. Check your firewall and environment. Plenty of users use the same setting and do not have such problem, and there doesn't seem to be a problem indeed.

@NikolayUvarov
Copy link
Author

Yep, you was rigth about firewall, despite iptables-save was empty, some rules still persisted.
Thank you for clue.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

3 participants