Assuming the user will not be connecting over vpn, but is both remote and non-technical, how would you expose Jellyfin to them securely?

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    72
    ·
    3 months ago

    At the very minimum stick a reverse proxy in front like caddy, nginx, or Traefik. Then have some middleware like crowdsec to inspect what’s going on. Then whitelist the IP or the country IP block.

    There is much more but those would be the bare minimum.

    • NarrativeBear@lemmy.world
      link
      fedilink
      English
      arrow-up
      19
      ·
      edit-2
      3 months ago

      I too would like to know more. Jellyfin has been something that I am still hesitating to expose online without a VPN.

      I have Plex behind a reverse proxy (HAproxy) with Crowdsec and firewall rules all behind Cloudflare. My firewall rules in HAproxy block access a few different ways, like if request are higher then 60 requests a second, or if there is strange path traversal. Used the following guide as a start.

      https://www.archy.net/building-a-native-fail2ban-with-haproxy-stick-tables/

    • BakedCatboy@lemmy.ml
      link
      fedilink
      English
      arrow-up
      13
      ·
      3 months ago

      How do you get apps through something like that? Do you have to open your browser and hit the URL periodically to handle auth there and it just remembers your IP?

      • halcyoncmdr@piefed.social
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        3
        ·
        3 months ago

        You can set pangolin to allow access to an entire resource or just certain paths without the front auth, instead relying on the built in auth.

        Your random plex/emby/jellyfin server isn’t going to be a huge target and the built in auth is good enough for the limited access your media system should have.

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          16
          ·
          3 months ago

          Wait so if you’re gonna allow access without authentication then why bother putting pangolin in front of jellyfin? Does it help in some other kind of way? I don’t really get how it helps without interfering with apps accessing jellyfin.

      • anon_8675309@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        Would you need to? Are apps a viable vector in? Basic auth in front of web ui does make sense though.

        • BakedCatboy@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          3 months ago

          What do you mean viable? The web UI is just an app that is delivered to your browser, it makes more or less the same API requests as an app would make, so IDK why the risk would be lower with an app?

          If an attacker can access the login endpoint for example to brute force or dictionary attack, it doesn’t matter if the web UI is or isn’t accessible if the login endpoint it uses is exposed for an app. The attacker could serve their own copy of the web UI and proxy requests to the API your app connects to. Blocking the html from being served doesn’t make a difference.

            • BakedCatboy@lemmy.ml
              link
              fedilink
              English
              arrow-up
              2
              ·
              3 months ago

              That’s exactly the point I’m getting at. Putting an auth wall doesn’t work with many apps, and if you add exceptions to the API then you’re not really protecting anything.

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    1
    ·
    3 months ago

    Run the jellyfin in a container that only has read privileges to the videos ( make sure you can’t get out to your whole NAS from there), put that behind a Cloudflaired tunnel.

    It’s not technically secure, but if they can’t get a foothold in your network and the only thing they can access is your video catalog, that’s a reasonable amount of risk.

    • Bazoogle@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      ·
      3 months ago

      Gotta be careful with cloudflared and media. They can block you if they detect copyrighted materials, even if it’s your own DVDs. You can setup TLS certs so the traffic is at least encrypted

        • Bazoogle@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          1
          ·
          3 months ago

          Right. Which is why Cloudflared would block you if it’s detected. But regardless, if for whatever reason, you ended up in court for the content you copied, the judge would probably give you a low fine. Obviously not legal advice, but the US justice system doesn’t have time to care about people making digital copies of DVDs they’ve purchased.

          It’s irrelevant anyway, since none of us are just copying our own DVDs… But for legal reasons /s

  • Nibodhika@lemmy.world
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    1
    ·
    3 months ago

    Secure is relative, you should be aware that jellyfin itself has security issues https://github.com/jellyfin/jellyfin/issues/5415 most of which are harmless, but at least one is fairly serious and allows people to watch your media without authentication, and adding an extra layer of authentication on the proxy would likely cause issues with clients.

    That being said, if you’re okay with those security issues what I would do is have a cheap VPS, connect both machines to tailscale, and have something like Caddy on the VPS to do the forwarding.

  • NeryK@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    14
    ·
    3 months ago

    For a remote and non-technical user I would say IP whitelisting offers a decent tradeoff.

    On your end you expose your jellyfin port to internet, but restrict at the router level to your user’s client IP address as soon as you have it. Obviously in practice this works best if the address does not change often.

    • Bazoogle@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 months ago

      Also not as ideal if their ISP uses CGNAT. Still waaay better than fully open, but you would be giving access to many households

      • NeryK@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        3 months ago

        Yep, that’s why I call that a tradeoff. Far from perfect and yet so much better than nothing.

        Pros:

        • Likely cuts 99.99% of attacks.
        • Nothing to do on client’s end.

        Cons:

        • Whitelisting must be updated everytime the client address changes.
        • Not 100% bulletproof as operators (notably for mobile networks) can NAT multiple connections behind a single publicly addressable IPv4 address.
        • Also IP addresses can be spoofed but I doubt that would be a major concern here.
    • MIDItheKID@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      Is there a way to this with like a MAC address instead of an IP? Allowing specific devices (my parents have a Firestick that they travel with) would be pretty ideal.

  • Encrypt-Keeper@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    3 months ago

    The biggest problem with that Jellyfin to this day is that you can’t.

    Seems like every new open source selfhosted app implements OIDC compatibility, but for some reason, I can only assume is technical debt, Jellyfin hasn’t.

  • zaggynl@feddit.nl
    link
    fedilink
    English
    arrow-up
    11
    ·
    3 months ago

    Ask them to visit https://ipv4.icanhazip.com/ and give you back the number, then whitelist in your webserver, as well as your LAN/VPN range, deny rest. Explain they can only reach jellyfin from their home internet. Repeat if they get 403 forbidden after they get a new WAN IP.

    That or VPN like openziti, wireguard but gets more complicated.

  • pnelego@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    3 months ago

    To be totally honest I’m not sure you can harden jellyfin enough for public Internet exposure without also breaking basic functionality of the platform.

    This is why everyone is always pushing so hard for a VPN/Tailnet of some kind. The public internet is a bit to much of a wild west to be exposing arbitrary services to it unless you really know what you’re doing.

  • anon_8675309@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    3 months ago

    Another way:

    Expose using caddy. Use basic auth for the web UI only. This exempts the Jellyfin app clients from basic auth that they don’t support but requires it before anyone even gets to the Jellyfin UI. This obfuscates the fact that your endpoint is even a Jellyfin end point.

  • Seefoo@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    3 months ago

    You can do a reverse proxy + authelia (or other auth service). It’s still more risky than a VPN IMO, buts wayyyy better than some of the other options in this thread

  • AllYourSmurf@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    3 months ago

    I agree with reverse proxy + middleware. I’d also suggest something like Jellyswarm as the front end. That way I can connect to other friends’ servers too.

  • 8j1obzlb@piefed.social
    link
    fedilink
    English
    arrow-up
    7
    ·
    3 months ago

    I agree with the folks saying reverse proxy of some kind + WAF. That way end users don’t have to deal with the VPN, but your home system is not directly exposed.

    I’ve been doing something similar with SSH local port forwarding and a $5/month VPS. Haven’t come anywhere close to my network quotas, and performance has not been an issue for home use with 2-5 concurrent users most of the time. I forward the local caddy ports to unprivileged ports/user on the VPS, then use the firewall on the VPS to forward that port to 443 and lock down the rest.

    • 8j1obzlb@piefed.social
      link
      fedilink
      English
      arrow-up
      3
      ·
      3 months ago

      That said, VPN would be much more manageable if I was trying to really push performance or scale out the network.

  • BandDad@lemmy.zip
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    2
    ·
    3 months ago

    If anyone has any tips for getting Tailscale running via Docker on my Openmediavault machine, I’m open to it. Everyone lauds it for being dead simple and I cannot for the life of me get it running on the machine it needs to be. Not sure my wife can/will handle anything more complicated.