top 29 comments

sorted by: hot top controversial new old
[–] 11 points 10 months ago

If you see a Docker solution that looks nice just look at how it’s built and replicate whatever software is packaged in its Dockerfile.

  • source
  • [–] 9 points 10 months ago (7 children)

    There is really nothing wrong with Docker on a VPS. It's not a VM there is no overhead.
    I also run a VPS which is connected to my Honelab using Tailscale. I run Nginx Proxy Manager using Docker on the VPS and it's proxy'ing all incoming connections to my Honelab.

  • source
  • hideshow 7 child comments
  • [–] 3 points 10 months ago (6 children)

    Could you explain your setup a bit more? Because my understanding is:

    Let's say you have a blog website in your homelab. To access the blog you have to: you go to your VPS's hostname/IP, from there the VPS forwards your request over tailscale to your homelab which then responds with your blog website?

    If that's the case, why even have the VPS and instead just use tailscale to access your homelab directly?

    Unless you intend to have the VPS be a load balancer in some way? Or a filter/firewall? Or you can't do a static IP for your homelab but you want it to be publicly accessible?

    Just trying to understand why you're doing it this way. I love seeing all the crazy ways people can set things up like this lol

  • source
  • parent
  • hideshow 6 child comments
  • [–] 1 point 10 months ago (5 children)

    You're right, the VPS only serves the purpose of a static public IPv4 which I can use with a domain.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 10 months ago (4 children)

    Honestly never thought to use a VPS like that before. We've all seen using a VPS as a VPN exit node. Do you run into quota limits on the VPS or Tailscale side? Too many requests/data?

    I'm gonna have to look into this for fun lol

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 10 months ago* (last edited 10 months ago) (3 children)

    Nah, it's a Hetzner CX23 with 20 TB of included traffic, which I will never exceed. And the setup is actually recommended because you don't expose your actual server but only the VPS. I watched a video from the Headscale devs a few years ago where the recommended this type of setup.

    EDIT: btop is reporting 6.72 TB down and 6.43 TB up in the past 329 days of uptime.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 10 months ago (2 children)

    Ah I'll have to look into this then...gotta find a VPS that will hopefully have a Los Angeles location and have decent traffic bandwidth.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 10 months ago* (last edited 10 months ago)

    I've recently switched to pangolin, which works like cloudflared tunnels, and it's been pretty good.
    They offer docker support but they also support installing manually. You install pangolin on your vps via a setup script, and you install newt on a machine inside your homelab. It supports raw udp/tcp in addition to http.

    I'd challenge what you said about docker, though. There is very little overhead in making a docker turduckin.
    And actually docker is exactly for delivering turnkey applications, not for reproducable dev environment; I imagine that they don't have a default data persistence because not everything needs it and that's less secure by default. LXC (which is what you'll mostly use in proxmox) and VMs seem more for reproducable dev environments, afaict. And there are some really good tools for managing the deployment of docker artifacts, compared to doing it yourself or using LXCs: for example dockge or portainer. I gave proxmox a try, but switched to portainer recently, because managing containers was easier and they still let you define persistent shared volumes like proxmox does.

    Proxmox is still good if you need to run VMs, but if all you need is OCI/docker containers, then there are simpler alternatives, in my limited experience.

  • source
  • [–] 5 points 10 months ago* (3 children)

    I feel like im missing something here. This is pretty trivial and the comments i see are over complicating the hell outta everything. All you need is your VPN tunnel working. Personally i use wireguard for this. Then you just use nginx as the reverse proxy it talks to services on the other side of the VPN.

    The nginx server config looks like

    server { listen 443 quic; listen [::]:443 quic; listen 443 ssl; listen [::]:443 ssl; server_name my.domain.tld; http2 on; http3 on; quic_gso on; tcp_nodelay on; error_log /var/log/nginx/jellyfin.access.log; ssl_certificate /path/to/ssl/fullchain.pem; ssl_certificate_key /path/to/ssl/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; add_header Alt-Svc 'h3=":$server_port"; ma=86400'; add_header x-quic 'h3'; add_header Alt-Svc 'h3-29=":$server_port"';

    location / {
        proxy_pass http://10.159.4.12:8096/;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;
    }
    

    }

    I have no idea how to do the proper code block i guess so have a paste from my reverse proxy hosted pastebin lol https://paste.kitsuna.net/upload/snail-seal-pig

  • source
  • hideshow 3 child comments
  • [–] 3 points 10 months ago

    Here:

    server {
        listen 443 quic;
        listen [::]:443 quic;
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name jellyfin.kitsuna.net;
        http2      on;
        http3      on;
        quic_gso   on;
        tcp_nodelay on;
        # You can increase the limit if your need to.
        error_log /var/log/nginx/jellyfin.access.log;
    #    ssl on;
    #    ssl_certificate /etc/nginx/certificate.crt;
    #    ssl_certificate_key /etc/nginx/certificate.key;
    #    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE
            ssl_certificate /etc/letsencrypt/live/kitsuna.net/fullchain.pem;
            ssl_certificate_key /etc/letsencrypt/live/kitsuna.net/privkey.pem;
    #        ssl_certificate_key /etc/letsencrypt/live/kitsuna.net/privkey.pem;
            ssl_protocols TLSv1.2 TLSv1.3;
            add_header Alt-Svc 'h3=":$server_port"; ma=86400';
            add_header x-quic 'h3';
            add_header Alt-Svc 'h3-29=":$server_port"';
        location / {
            proxy_pass http://10.159.4.12:8096/;
    #       proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forward-Proto http;
            proxy_set_header X-Nginx-Proxy true;
        }
    }
    
  • source
  • parent
  • [–] 4 points 10 months ago (6 children)

    You can install nginx onto a bare metal server and run it that way.
    Check the nginx docs for the specific distribution family you are using

  • source
  • hideshow 6 child comments
  • [+] [S] 2 points 10 months ago (3 children)
  • [–] 4 points 10 months ago*

    apt/yum/dnf install nginx, listen on public IP of VPS, use proxy_pass to forward to your internal IP

    server {
        listen [::]:443 ssl;
        http2 on;
        server_name service.example.com;
        root /var/data/websites/holding;
        index index.php index.html index.htm;
    
        #SSL setting
        ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
        add_header X-Clacks-Overhead "GNU Terry Pratchett";
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
    
        # access_log /var/log/nginx/service-access.log main;
        access_log off;
    
        location / {
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "Upgrade";
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $remote_addr;
          proxy_set_header X-Forwarded-Proto "https";
          proxy_set_header X-SECURE-REQUEST "true";
          proxy_set_header Host $http_host;
          proxy_pass http://192.168.1.2/; #IP of the service over the VPN
        }
    
    }
    
  • source
  • [–] 3 points 10 months ago (1 child)

    Docker is fine for turnkey applications. Mounting external storage that persists across containers is a feature that enables that pattern.

    Running Docker in a VM is also fine and has potential advantages. However I agree that it's probably overly complex for many people.

    I'm confused what you're trying to accomplish here. Are you trying to make it look like the traffic is coming from your VPS for some reason? Nginx (amongst others) can reverse proxy tcp traffic.

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 2 points 10 months ago

    Nginx, Traefik, Caddy, HAProxy...lots of options.

    Nginx and Traefik are probably the most complex if you're not familiar with either.

    HAProxy is dead simple if you solely intend to just use it as a reverse proxy.

    Caddy is fairly simple as well, but slightly more complex than HAP.

    If you're not familiar with routing and VPNs in general, you may want to have a look at Tailscale or ZeroTier which use Wireguard under the hood, but making the routing dead simple, especially if you're behind a NAT and don't want to have to mess with ports forwarding.

  • source
  • [–] 2 points 10 months ago

    a virtual turducken

    LOL

  • source
  • [–] 2 points 10 months ago

    There are many ways to do this and you got the right gist, but my recommendation:

    • Set up a WireGuard tunnel connecting your VPS and homeserver
    • Set up a layer-4 TCP reverse proxy (Nginx's stream module/Traefik TCP routers/Caddy-L4/HAProxy are all doable) on the VPS
    • Use that reverse proxy to route all TCP traffic back to the homeserver's HTTPS service(s), via the wg tunnel

    Here's a guide that helped me with such a setup: https://theorangeone.net/posts/wireguard-haproxy-gateway/

    Wireguard only need one peer to open a silent UDP port, so use the VPS' IP and no need to portforward your homeserver. There are other more convenient solutions like Tailscale or Pangolin, but being Wireguard-based they all follow the same principle. Lastly this keeps your certs locally for TLS all the way through

  • source
  • [–] 1 point 10 months ago

    You can easily forward arbitrary IP traffic if you get an additional IP for that VPS. Then you add the IP as your own on the local end, and set up routing like

    ip r a 1.2.3.4 via 10.10.10.10 dev wg0 where 1.2.3.4 is the extra ip, and 10.10.10.10 is your local wireguard address.

    With just one IP, you can forward ports over wireguard with iptables, but I failed to do that correctly.

    Now I'm using xinetd to forward traffic from external ports to Wireguard with a single IP. iptables would be better but I ran out of patience.

  • source
  • I have nothing useful to add, I just really love the phrase "Virtual Turducken"

  • source
  • [–] 1 point 10 months ago*

    Install tailscale on your vps. Install tailscale on your router. Use tailscale option (on your router) to expose subnet to the tailnet, the subnet being whatever you're trying to reverse proxy.

    Replace tailscale with headscale if you're paranoid, can run headscale on the vps too if you want to. I had this sort of working, my issue i ran into was manually setting up outbound rules for tailscale traffic in pfsense. Manual because the pfsense tailscale plugin didn't let you specify a headscale server, it only plays with the official tailacale backplane. Installing tailacale on the pfsense command line works and gets around this and your router will show up on your headscale tailnet, but the outbound rules wont automatically be created... so... twas a rabbit hole I didn't feeling like exploring at the time.

  • source