GithubHelp home page GithubHelp logo

support for subdirs about goploader HOT 8 OPEN

bioryb avatar bioryb commented on May 28, 2024
support for subdirs

from goploader.

Comments (8)

Depado avatar Depado commented on May 28, 2024

In order to use goploader with a reverse proxy and for it to serve HTTPS links, you have to set the X-Forwarded-Proto header in your proxy configuration. Otherwise goploader can't determine whether or not the request was HTTP or HTTPS (because it has no knowledge of your proxy and your proxy's configuration).

As for the subdirectory, I'm sorry but I don't get it. Could you give me an example of what you're trying to achieve ?

from goploader.

Depado avatar Depado commented on May 28, 2024

Related to #38

from goploader.

bioryb avatar bioryb commented on May 28, 2024

Hi,
I wanted to have a proxy using a subdir (virtual) like https://mydomain/goploader and forward this to the goploader server via http. I think the issue concernig the subdir was a configureation fault on my site. But the link produced by goploader is http, because it is requested via http by the proxy. Can I change this without using https between the proxy and goploader?

Thanks in advance
Ronny

from goploader.

Depado avatar Depado commented on May 28, 2024

Hi,
I don't think this is related to goploader itself. It's more of a configuration problem on your proxy. It is not related on how your proxy talks to goploader, it's about the information sent by your proxy.

For example, here is my Caddy configuration :

gpldr.in up.depado.eu {
    proxy / 127.0.0.1:8002 {
        proxy_header Host {host}
        proxy_header X-Real-IP {remote}
        proxy_header X-Forwarded-Proto {scheme}
    }
    gzip
}

This is actually quite simple : Simply forward the protocol your proxy receives to the goploader server, and it will send back a link with the appropriate protocol. (Meaning, if someone sends an http request, goploader will send back an http link, same applies if someone sends an https request)

nginx
proxy_set_header X-Forwarded-Proto $scheme; (both http and https)
or
proxy_set_header X-Forwarded-Proto "https; (only https)

Apache
RequestHeader set X-Forwarded-Proto 'https' env=HTTPS (both http and https)
or
RequestHeader set X-Forwarded-Proto "https" (only https)

Caddy
proxy_header X-Forwarded-Proto {scheme}

Hope this helps

EDIT: About the subdirectory stuff, you should customize your name_server to mydomain.com/goploader I think. Although I did not test that.

from goploader.

bioryb avatar bioryb commented on May 28, 2024

Hi,
the parameter RequestHeader for apache works. THX!

The other issue with subdirs did not work. Because I will protect this site using username and password, this is no showstopper ;-)
If you are interested in: the index.html has to be changed to link the .js files to the subfolder. But if you want to upload a file, jquery uses the absolute path ( / ) and so it does not work. I did not find where to configure that ...

from goploader.

Depado avatar Depado commented on May 28, 2024

So the second issue is about the way static files are handled. I'll have a look later. Thanks for the feedback :)

from goploader.

stiobhan avatar stiobhan commented on May 28, 2024

I got it to work with a subdir, e.g. http://my.server.com/gop/

First of all I had to replace all \static\ href and script src in index.html with /gop/static/.
Then to make the upload script work in custom.js change url (line 106) to '/gop/'.
And then to have the download links displayed correct, append /gop to my name_server variable in the config file.

So based on that it shouldn't be too difficult to make it work with a base_dir variable in the config file. I haven't looked at the code at all, though.

from goploader.

Depado avatar Depado commented on May 28, 2024

Thanks for your input @stiobhan !
It's been a while I haven't worked on goploader, though I intend to work on it again soon.
There are multiple issues and enhancements that need some work.

from goploader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.