I’ve got a mini pc which is running always and another one which consumes a lot more power for e.g. jellyfin.

Can I configure it such that the jellyfin server only boots if I connect to it? E.g. I try to connect to jellyfin.y.com and then the server boots because the mini pc tries to connect to it.

I already figured out how to let it sleep automatically as soon as nobody is watching.

Edit: can I add the magic package to the reverse proxy?

    • enemenemu@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 day ago

      Thanks!

      I use nginxproxymanager, I’ll try to find something similar (I couldn’t find something directly)

        • enemenemu@lemm.eeOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          11 hours ago

          I’d be happy to switch if I had a good tutorial for caddy. Unfortunately I couldn’t find one.

            • enemenemu@lemm.eeOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              9 hours ago

              It doesn’t work. I can’t manage to debug it.

              Fedora server. Podman. Selinux. Port 8443. Ipv4.

              • Xanza@lemm.ee
                link
                fedilink
                English
                arrow-up
                2
                ·
                2 hours ago

                it doesn’t work

                …what exactly doesn’t work. You’re not really giving me enough to help you with.

                • enemenemu@lemm.eeOP
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  2 hours ago

                  Thx for offering your help.

                  If I would know, I could debug it, but I don’t know where the problem is. I assume the problem is somewhere with podman or selinux

          • Xanza@lemm.ee
            link
            fedilink
            English
            arrow-up
            3
            arrow-down
            4
            ·
            edit-2
            20 hours ago

            I mean, use what you want. But caddy is significantly easier to configure. It additionally handles SSL and protects your proxy targets with zero configuration (by default) and supports live configuration reload via the admin interface. It’s tits.

            Here’s my config: http://i.xno.dev/u/fc8N0n.png

            Caddy is running a wildcard SSL cert, so once I’ve connected my box to cloudflare, I can setup a subdomain by simply adding it to my caddy config. No additional setup is required. It also works directly with docker, so if you install the lemmy (name of the container) docker container, you can reverse_proxy by simply (assuming they’re on the same docker network):

            lemmy.domain.com {
                reverse_proxy lemmy:80
            }
            
            • themachine@lemmy.world
              link
              fedilink
              English
              arrow-up
              10
              arrow-down
              1
              ·
              edit-2
              18 hours ago

              That sounds more or less to be exactly what I’m doing with NPM currently. I don’t see how it’s easier to configure as all I did was fire up the NPM container, log in, and add my host targets.

              NPM also handles SSL both standard http verification as well as DNS auth for wildcards.

    • enemenemu@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      1 day ago

      Thanks! I use wake on lan with rtcwake to boot at a certain time. I also found an app via which I can boot the server via wake on lan. But it would be nice if it could wake up just by requesting the service

  • Lucy :3@feddit.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    Also an option, systemd based, could be to use systemd socket files, which (as far as I understand) opens a dummy socket and starts the matching service as soon as it’s requested.

  • ShepherdPie@midwest.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    I think you’ll want to look into Wake On LAN to do this. I can’t give you instructions (tried once unsuccessfully on a Windows installation) but that should be enough to get you started.

    • enemenemu@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      1 day ago

      Thanks! I use wake on lan with rtcwake to boot at a certain time. I also found an app via which I can boot the server via wake on lan. But it would be nice if it could wake up just by requesting the service

  • Mubelotix@jlai.lu
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day ago

    I made a tool that can hibernate systemd services when no request get through their associated nginx service. Using it on jellyfin, works great

    • sugar_in_your_tea@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      24 hours ago

      I assume this works like the reverse of socket activation? If so, that’s pretty rad!

      That said, that doesn’t really solve OP’s problem, and I’m not exactly sure what it’s solving for you. Jellyfin doesn’t really use any resources when idle, so it’s not going to save on power or anything like that.

      That said, you could probably create an interesting service like this. Basically, if the last interesting service shuts down, you shut the whole machine down, and then use WoL to start it back up when someone wants it. Tune it a bit to reduce how often it reboots (i.e. extend life of your disks) and reduce boot times (i.e. don’t mount the RAID until it’s needed), and it could be really cool!

      • Mubelotix@jlai.lu
        link
        fedilink
        English
        arrow-up
        2
        ·
        19 hours ago

        Exactly. It’s like socket activation but plugged into nginx. It might or might not fit OP’s use case, as when you have many small services like jellyfin, ram usage starts adding up. Adding automatic shutdown is a great idea

        • sugar_in_your_tea@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          19 hours ago

          I can see that, especially if running on limited hardware. My server has way more RAM than it needs though (16GB), so saving 50MB here and there isn’t very important.