Gitea: Link goes to localhost

Created on 12 Jan 2018  路  25Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): Gitea version 1.3.2 built with: bindata, sqlite
  • Git version: 2.15.1
  • Operating system: CentOS 7
  • Database (use [x]):

    • [ ] PostgreSQL

    • [x] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [x] No

    • [ ] Not relevant

  • Log gist:

https://gist.github.com/ShalokShalom/2abd30f454660d0d7fb64fca797b11af

Description

This repository here exist, while the link to it directs to localhost:
https://sml.uber.space/explore/repos

The very same counts for this link, which goes to the exact same repo:
https://sml.uber.space/ShalokShalom/

The actual repo is here: https://sml.uber.space/ShalokShalom/SML

kinquestion stale

Most helpful comment

Solved by one friend.

This is the correct implementation, for the record:

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = sml
RUN_MODE = prod

[security]
INTERNAL_TOKEN = 
INSTALL_LOCK   = true
SECRET_KEY     = XXXXXXXX

[server]
LOCAL_ROOT_URL   = http://localhost:64223/
SSH_DOMAIN       = sml.uber.space
DOMAIN           = sml.uber.space
HTTP_PORT        = 64223
ROOT_URL         = https://sml.uber.space/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /home/sml/giteax/data/lfs
LFS_JWT_SECRET   = XXXXXXXX
OFFLINE_MODE     = false

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = sml
USER     = sml
PASSWD   = 
SSL_MODE = disable
PATH     = data/gitea.db

[repository]
ROOT = /home/sml/repositories

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.example.org

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = Info
ROOT_PATH = /home/sml/log

Fill in your internal token and the database password of course.

All 25 comments

Can you show these three lines of your config?

I dont have these lines in my app.ini

In fact, there are 2 items: Security token and the LOCAL ROOT URL, which shows http://localhost:myport/

@ShalokShalom: I suggest you change the INTERNAL_TOKEN nonetheless, despite of the edit it has been sent to watchers on GitHub.

Can you try changing the LOCAL_ROOT_URL to be https://sml.uber.space/ ? And also, add DOMAIN = sml.uber.space

Local URL should changed rarely. You can try setting ROOT_URL = https://sml.uber.space/

[server]
DOMAIN = sml.uber.space
ROOT_URL = https://sml.uber.space/

Still the same.

@thehowl

Yes, thanks

What do you see in gitea.log file when accessing home page?

Directly after I opened the home page, in the actual binary running:
[Macaron] 2018-01-12 21:06:40: Completed /index.html 404 Not Found in 11.555517ms

And in the gitea.log: Nothing
(No entry at all)

You have problem in nginx config. You have try_files index.html or similar directive that asks for index.html file to gitea that does not exist instead of requesting /

I have Apache.

@ShalokShalom that's strange as when accessing your site one of returned headers are "server: nginx" :)

Anyway somehow looks like web proxy configuration issue as gitea should not be asked for "index.html" as such files/routes wont exist in gitea

Thanks a lot, I forwarded this to Uberspace, the host. :)

Anyway somehow looks like web proxy configuration issue as gitea should not be asked for "index.html" as such files/routes wont exist in gitea

This is solved:
https://github.com/go-gitea/gitea/issues/3362

@lafriks 脛hm, no. This is solved.
This here is still open.

So the issue with the index.html is not responsible for the issue here. There is also no such error message anymore as before with 404. Can you say me, which steps are next to take from my side?

Thanks a lot

Hi, please try this settings in your app.ini:

[server]
DOMAIN         = sml.uber.space
ROOT_URL       = https://sml.uber.space/
HTTP_PORT      = 64223
LOCAL_ROOT_URL = http://localhost:64223/

I tested them on a different uberspace host.

Nope, it still calls http://localhost:64223/ShalokShalom/SML

EDIT: Even when I change LOCAL_ROOT_URL to https://sml.uber.space/.

Did you restart gitea after changing app.ini?

Here is a full sample config:
https://gist.github.com/SuperVirus/6deb832d683143042f8f27800b7eff42

This is the result (every link is ok):
https://htk.uber.space/explore/repos

Can you post your app.ini (without the secret keys, of cause)?

@lafriks Yes

@SuperVirus

[server]
DOMAIN = sml.uber.space
ROOT_URL = https://sml.uber.space/
HTTP_PORT = 64223
LOCAL_ROOT_URL = http://localhost:64223/

I did the same with https://sml.uber.space/ as LOCAL_ROOT_URL.

I tried now with this:

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = sml
RUN_MODE = prod

[security]
INTERNAL_TOKEN = 
INSTALL_LOCK   = true
SECRET_KEY     = XXXXXXXX

[server]
LOCAL_ROOT_URL   = http://localhost:64223/
SSH_DOMAIN       = sml.uber.space
DOMAIN           = sml.uber.space
HTTP_PORT        = 64223
ROOT_URL         = https://sml.uber.space/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /home/sml/giteax/data/lfs
LFS_JWT_SECRET   = XXXXXXXX
OFFLINE_MODE     = false

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = sml
USER     = sml
PASSWD   = 
SSL_MODE = disable
PATH     = data/gitea.db

[repository]
ROOT = /home/sml/repositories

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.example.org

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = Info
ROOT_PATH = /home/sml/log

Anyway what I do, it always assumes http://localhost:64223/ as the correct URL.

Solved by one friend.

This is the correct implementation, for the record:

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = sml
RUN_MODE = prod

[security]
INTERNAL_TOKEN = 
INSTALL_LOCK   = true
SECRET_KEY     = XXXXXXXX

[server]
LOCAL_ROOT_URL   = http://localhost:64223/
SSH_DOMAIN       = sml.uber.space
DOMAIN           = sml.uber.space
HTTP_PORT        = 64223
ROOT_URL         = https://sml.uber.space/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /home/sml/giteax/data/lfs
LFS_JWT_SECRET   = XXXXXXXX
OFFLINE_MODE     = false

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = sml
USER     = sml
PASSWD   = 
SSL_MODE = disable
PATH     = data/gitea.db

[repository]
ROOT = /home/sml/repositories

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.example.org

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE      = file
LEVEL     = Info
ROOT_PATH = /home/sml/log

Fill in your internal token and the database password of course.

I believe my problem might be similar to yours. I am running gitea 1.6.0 on windows server locally on http://127.0.0.113:3000. Inside an issue http://127.0.0.113:3000/firstUser/RepoHelloGitea/issues/1 i clicked on "Time Tracker Start". After clicking the URL loaded "http://localhost:3000/firstUser/RepoHelloGitea/issues/1" which is not working on my machine.

After changing "C:DevGoGiteacustomconfapp.ini" it worked:

[server]
; The protocol the server listens on. One of 'http', 'https', 'unix' or 'fcgi'.
PROTOCOL         = http
DOMAIN           = localhost
; new value below
ROOT_URL         = http://127.0.0.113:3000 
; ROOT_URL         = http://localhost:3000/  <-- old value

This fixed it for me.

This is so long since then, I have no access anymore. Reopen this

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

This issue has been automatically closed because of inactivity. You can re-open it if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thehowl picture thehowl  路  3Comments

thehowl picture thehowl  路  3Comments

jorise7 picture jorise7  路  3Comments

kifirkin picture kifirkin  路  3Comments

jakimfett picture jakimfett  路  3Comments