Live data from Hacker News

Putting Raspberry Pi Online with Caddy and SSH Tunnel

gist.github.com

121–130 of 157 posts

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#121
post #27
post #2

I think a better option would be to create a Wireguard tunnel between Raspberry Pi and the remote server instead of a SSH Tunnel. Then there is no need to add or change ports and restart the tunnel for every service.

while i think this is true (any other vpn software would work too though) i want to point out that you actually can bring up a tun interface using ssh with the "-w local_tun[:remote_tun]" flag somewhat easily if you want to. It is also possible to make forwarding work in either direction using an integrated socks proxy using "-R" or "-D" flags ...

> you actually can bring up a tun interface using ssh

Beware of TCP over TCP issues[0] when using SSH for tun.

[0]: http://sites.inka.de/bigred/devel/tcp-tcp.html

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#122

Side conversation: I'm interested in being pretty good at this sort of thing: setting up servers, making them connect, understand the protocols enough to put them to practice. I believe this is in the realm of IT. What are some good resources to read to get to my goal? Thanks!

I'd recommend doing almost exactly what OP describes. Start on your local network first. Get a raspberry pi, and figure out how to set up a webserver on it you can access from other computers on your network.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#123

One can also use the Diode P2P network to get the same without a server: https://support.diode.io/article/ss32engxlq works for ssh remote access, websites and stuff similar to ngrok just without the strings attached.

There's got to be a public IP somewhere. What are the "exit nodes" for Diode?

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#124

I maintain a list of solutions to this problem: https://github.com/anderspitman/awesome-tunneling . There are a surprising number of tools that all do essentially the same thing, and it's often hard to tell how they're different from the other 30 options. Making a really good solution to this problem has been the focus of my free time for the past month since I wrote this comment[0]. The project I'm working on: * 100…

THANK YOU!

I still miss Serveo because this was easiest tunnel solution that "just works!"

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#125

> I disabled nginx on the server and installed Caddy instead. I wonder how a somehow simpler config syntax (Caddyfile) compares to a simpler maintenance system (apt).

In my experience, Caddy is much easier than Nginx. The auto TLS alone is worth it.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#126
post #114

A comparison of the security of these several approaches would be helpful. Am I correct that Wireguard and SSH are the more secure options?

I would personally trust SSH based on OpenSSH the most, WireGuard second, custom SSH third, TLS 4th, and then the rest.

Interesting! I thought Wireguard is 4K lines of code while OpenSSH is hundreds of thousands of lines of code. Thus Wireguard is more secure.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#127
post #38
post #13

Earlier quoted context omitted.

Caddy underwent a complete rewrite that also invalidated most of the existing config. Personally I don't see any benefits in using caddy or another non mainstream httpd as it adds more risk to my project with usually very little benefits. Nothing against using it for hobby projects but in production I've migrated back to nginx.

I had an itch to look at Caddy, after reading the comments, but breaking configuration backwards compatibility is a huge turn off.

Personally I prefer software that improves (slowly) over time, for at least a couple iterations. It's a balancing act to be sure, and there are diminishing returns to changing things up, but I think very little software comes out of the gate in a >80% optimal form.

I haven't found the changes in Caddy's config format to be problematic in the least.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#128

Had a similar setup going. What next? Well I setup some handy shell functions: 1) copy the latest screenshot into webroot/screenshots/${randstr}.png and copy the url to clipboard. this replaces dropbox's cool screenshot sharing feature. love sharing screenshots with coworkers this way, the files stays with you, you can redact easily. 2) serve static files the same way, if needed too. the magic's all in the shell scri…

Found the /r/selfhosted member.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#129

Earlier quoted context omitted.

As an alternative, you could put it on a public mesh VPN. I use ZeroTier for that so I don't have to host an explicit beacon.

Does ZeroTier let you expose a specific machine publicly? ie if I have a raspberry pi behind a NAT, will ZeroTier provide me with a public IP anyone can use to connect to it?

No, you still need to find a machine with a public IP. The usecase in parent comment mentioned only the SSH part, which is easier. But if you want to do forwarding from a specific machine to the public, you can do it manually.

Re: Putting Raspberry Pi Online with Caddy and SSH Tunnel

#130

I use Cloudflare Argo Tunnel for this purpose and am very satisfied. It's easy to setup and if you have TLD on Cloudflare, the daemon(cloudflared) creates new A record for each host and creates a tunnel between your host and the nearest Cloudflare data center. You can also run multiple services on a single host. And all these connections are secure.

$5 per month and 10c per GB or am I missing something?

That's what I understand. They could corner this market if they made it flat $5-$10/mo and finished getting their DNS registrar up and running. But I suspect they have bigger fish to fry.
Post reply on HN