Coder Social home page Coder Social logo

basic authentication with nginx about send HOT 5 OPEN

timvisee avatar timvisee commented on August 17, 2024
basic authentication with nginx

from send.

Comments (5)

timvisee avatar timvisee commented on August 17, 2024

So it seems that somehow the browser requests some resources without passing the authentication header?

I'm not sure.

Is this a known issue? Is there a standard way to deploy send behind a proxy with basic auth?

It is not. I did never deploy Send with BasicAuth myself, though there have been others who did, with success. I don't have much experience with BasicAuth either, it may be worth checking what headers affect it.

Please note that when uploading a file, it is done so over a websocket rather than a regular HTTP request. That might need special attention.

from send.

DavyLandman avatar DavyLandman commented on August 17, 2024

I've been debugging this, it looks like the XHR request don't use the credentials of the browser? That means that the calls to API fail, and that is what causing the downloads to fail.

afbeelding

I've been reading a bit, and it seems like it might be resolved by setting the withCredentials property on the xhr, but I don't know how to test that currently.

from send.

martin-braun avatar martin-braun commented on August 17, 2024

@timvisee I think it would make sense to provide a way to configure credentials in the server configuration that need to be put for home use. I'd like to host send for my partner and me and I wish to prevent strangers from using it on my server.

from send.

ben-64 avatar ben-64 commented on August 17, 2024

I face exactly the same problem.
Due to basic authentication and reverse proxy, all links are expired, but the real reason is the authentication problem.

from send.

AlassaneWone avatar AlassaneWone commented on August 17, 2024

I don't know if this is relevant or helpful, but I just implemented Send with basic authentication on my Apache server.

I created users and passwords using this command (-c create the file so, if you want to create more users, just get rid of it):

htpasswd -c /etc/apache2/.htpasswd <username>

I also added this bit of code to the VirtualHost so that everyone can access downloads via links, but only authentified users can access the upload page.

        <LocationMatch "^/$">
                AuthType Basic
                AuthName "Send"
                AuthUserFile /etc/apache2/.htpasswd
                Require valid-user
                Order Deny,Allow
        </LocationMatch>

        <LocationMatch "^/download/">
                allow from all
                Satisfy any
        </LocationMatch>

However, there's still an issue I couldn't figure out how to resolve.
Accessing the download page and clicking on the 'Send' logo (up left of the page) redirects an unauthenticated user to the upload page without requiring username or password.

Feel free to notify me if you discover a better solution, security issues, or anything that could be improved.

from send.

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.