szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.71k stars 172 forks source link

OIDC/OAuth support #284

Open luochen1990 opened 2 weeks ago

luochen1990 commented 2 weeks ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when I want to share a big file with my friends, since allowing unauthorised user to upload big file might cause the disk space abused.

Describe the solution you'd like

Allowing user login via OIDC, and add limitation options for login user and unauthorised user seperatelly.

ALLOW_UPLOAD = "none" / "login" / "all"
ALLOW_UPLOAD_FILE =  "none" / "login" / "all"
tecosaur commented 1 week ago

Hello! I've wanted to do something similar myself, and in case you find it helpful I'll share how Caddy + Authelia can be used to make uploading require login:

pastes.example.com {
    route /raw/* {
        reverse_proxy :4144 {
            header_down Content-Type "text/plain; charset=UTF-8"
        }
    }
    @public path /static/* /upload/* /file/* /p/* /raw/* /u/* /qr/* /auth/* /auth_file/*
    route @public {
        reverse_proxy :4144
    }
    route * {
        import auth
        reverse_proxy :4144
    }
}