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

Having a ROOT_URL with a subdirectory breaks all kinds of things #5425

Closed
2 of 7 tasks
zilti opened this issue Nov 28, 2018 · 12 comments
Closed
2 of 7 tasks

Having a ROOT_URL with a subdirectory breaks all kinds of things #5425

zilti opened this issue Nov 28, 2018 · 12 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@zilti
Copy link

zilti commented Nov 28, 2018

  • Gitea version (or commit ref): 1.6.0
  • Git version: 2.14.3
  • Operating system: NetBSD 8
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When the ROOT_URL has a subdirectory, all kinds of things get messed up, namely: registration and login; the captcha; everything that involves creating, editing or deleting organizations, repositories and files in repositories because of the csrf tokens; and previewing edits.

Screenshots

@lafriks
Copy link
Member

lafriks commented Nov 28, 2018

Strange, I'm running one instance in suburl and I don't seem to have problems. Could be reverse proxy configuration issue?

@lafriks lafriks added type/question Issue needs no code to be fixed, only a description on how to fix it yourself. issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Nov 28, 2018
@zilti
Copy link
Author

zilti commented Nov 29, 2018

I'm using lighttpd with the following proxy config:

$HTTP["url"] =~ "^/gitea+" {
  proxy.server = ( "" =>
    (( "host" => "0.0.0.0", "port" => "3000" ))
  )
  proxy.header = ("map-urlpath" => (
    "/gitea" => ""
    )
  )
}

Everything else in gitea gets loaded fine. Only the actions mentioned above fail (and login redirects to example.com/gitea/gitea instead of example.com/gitea).

@zilti
Copy link
Author

zilti commented Nov 29, 2018

Oh, this seems to be a duplicate of the abandoned issue #5411.

@jabouchleih
Copy link

jabouchleih commented Dec 2, 2018

I cannot speak for lighttpd but Gitea with either NGINX or APACHE as a forward/reverse proxy works fine on an URL with a subpath, so that's definitely an issue with lighttpd.

@mckaygerhard
Copy link

mckaygerhard commented Dec 3, 2018

it's not working due there's some hardcoded paths in the code to the domain event the configured subpath

this problems does not happened with gogs! and firts versions of gitea

@zilti
Copy link
Author

zilti commented Dec 4, 2018

Yes. When the configured ROOT_URL is e.g. https://example.com/gitea, the login form will redirect to https://example.com/gitea/gitea. Also the CSRF tokens will be generated for example.com/gitea/gitea URLs.

@mckaygerhard
Copy link

this bug are causing issues in others due root url are kind of hardcoded from ROOT_URL as i described in #5316 make it imposible cofigure it as subpath..

today it 1.6.2 release and the bug is still happened!

@lafriks
Copy link
Member

lafriks commented Jan 5, 2019

I think the problem is how lighttpd handle proxying. Works just fine with Nginx, Apache and traefik

@mckaygerhard
Copy link

it happened in others.. too much tune up to handle it..

and if were the case, why it's not happened with gogs?

@mckaygerhard
Copy link

o yeah right! more easy are close issue rather than property support separate WORKING_DIR VS BINARY_DIR! Pufff

@zeripath
Copy link
Contributor

@mckaygerhard Gitea has to know it's external address otherwise LFS cannot work. That is supplied using the ROOT_URL. Gitea works fine on a suburl on nginx and Apache - I know because that is how I run it. So there is something to do with the lighthttpd configuration above.

Now you're also mentioning a different problem with the WORKING_DIR and BINARY_DIR. I think I responded to that issue. Could you respond there?

@mckaygerhard
Copy link

@zeripath gitea was a fork of gogs.. quite xtrange that gogs already works and "now" gitea not! that resume perfectly all the things.. and there's no different problem.. i dont know too much around go lang but seems there's a serious problems with paths and roots web urls

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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 type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

6 participants