Lurker News

Comments (152) 45 threads

pqdbr2 replies#
This looks really nice, congrats!

1) I see Kamal was an inspiration; care to explain what differs from it? I'm still rocking custom Ansible playbooks, but I was planning on checking out Kamal after version 2 is released soon (I think alongside Rails 8).
2) I see databases are in your roadmap, and that's great.
One feature that IMHO would be game changer for tools like this (and are lacking even in paid services like Hatchbox.io, which is overall great) is streaming replication of databases.
Even for side projects, a periodic SQL dump stored in S3 is generally not enough nowadays, and any project that gains traction will need to implement some sort of streaming backup, like Litestream (for SQLite) or Barman with streaming backup (for Postgres).
If I may suggest this feature, having this tool to provision a Barman server in a different VPS, and automate the process of having Postgres stream to it would be game changer.
One barman server can actually accommodate multiple database backups, so N projects could do streaming backup to one single barman server.
Of course, there would need to be a way to monitor if the streaming is working correctly, and maybe even help the user with the restoration process. But that effectively brings RTO down to near 0 (so no data loss) and can even allow point in time restoration.

indigodaddy1 reply#
Pretty sure that fly.io for example supports litestream as I remember seeing some fly doc related to litestream when I was looking a few days ago for my own project. Would also make sense that they do given Litestream’s creator is currently Fly’s VP of Product (I believe).
ctvo2 replies#
Yes, fly.io is associated with Litestream, but... how is that related to the above thread or this tool?
indigodaddy#
Quoted from the parent comment:

“One feature that IMHO would be game changer for tools like this (and are lacking even in paid services like Hatchbox.io, which is overall great) is streaming replication of databases.”
And then I mentioned that I believe fly.io has litestream support. I think it’s fairly relevant to the comment/thread.

russelg#
The repo has the following sub title: "Bare metal to production ready in mins; imagine fly.io on your VPS"
mightymoud#
1) Kamal is more geared towards having one VPS for project - it' made for big projects really. They also show on the demo that even the db is hosted on its own VPS. Which is great! But not for me or Sidekick target audience. Kamal V2 will support multi-projects on a single VPS afaik

2) yes yes yes! I really like litestream. Also backup is one of those critical but annoying thing that Sidekick is meant to take care of for you. I'll look into Bearman. My vision is like we would have one command for most popular db types and it would use stubs to configure everything the right way. Need to sort out docker-compose support first though...

4star3star7 replies#
I like what I'm seeing, though I'm not sure I have a use case. On a VPS, I'll typically run a cloudflared container and configure a Cloudflare tunnel to that VPS. Then, I can expose any port and point it to a subdomain I configure in the CF dashboard. This gives https for free. I can expose services in containers or anything else running on the VPS.

I'll concede there's probably a little more hands on work doing things this way, but I do like having a good grip on how things are working rather than leaning on a convenient tool. Maybe you could convince me Sidekick has more advantages?

skinner9272 replies#
I must be an old simpleton, but why get cloudflare involved? You can get https for free with nginx and letsencrypt.
mightymoud1 reply#
It's a tunnel. So VPS can only be reached through cloudflare. It's not only for https, but more for security and lockdown
mediumsmart3 replies#
excellent and if cloudflare thinks your IP is iranian its going to get a really secure lockdown.

Continue this thread — 3 replies

worik#
> You can get https for free with... [any webserver] and letsencrypt.
mightymoud#
Interesting setup....

How do you run the containers on your VPS tho? You could still use Sidekick for that!
I think your setup is one step up in security from Sidekick nonetheless. A lot more work it seems too

tacone#
Interesting! How do you connect via ssh? Do you just leave the port open or is there any trick you'd like to share?
hu32 replies#
Nice setup.

But isn't this a little too tied to Cloudflare?
Caddy as a reverse proxy on that VPS would also give us free HTTPS. The downside is less security because no CF tunneling.

aborsy#
You could put Authentik in front. It does Cloudflare stuff on VPS.
eikenberry#
Are there other services that provide the similar offering as Cloudflare that could be switched to in case they changed policy (eg. removed the free teir)? I.E. is there any mitigation to Cloudflare lock-in?
vineyardmike#
I do this for “internal” apps but with Tailscale.
SahAssar#
Are you also making sure that nothing on the VPS is actually listening on outside ports? A classic mistake is to setup something similar to what you are describing but not validating that the services are not listening on 0.0.0.0.

I'd also not want to have cloudflare as an extra company to trust, point of failure and configuration to manage.

renewiltord1 reply#
This is pretty cool. I did not know I could do this. Currently, I have:

1. nginx + letsencrypt
2. forward based on host + path to the appropriate local docker
3. run each thing in the docker container
4. put Cloudflare in front in proxy DNS mode and with caching enabled
Your thing is obviously better! Thank you.

jmpavlec1 reply#
I used to run it the cloudflared way as the other user described but the tunnel often went offline without explanation for short periods of time and the latency was so so in my testing. I run it more similar to you now and haven't had any stability problems since dropping the cloudflared setup. I use cloudflared for a less critical app on my own hardware and that also goes up and down from time to time.
renewiltord#
Oh thank you for that experience. This way has been entirely fire and forget (except for application layer issues) so I wouldn't want to change things then. The infra layer is pretty simple this way. I lost a 10 year server to bitrot (Hetzner wanted to sunset it and I had such a bespoke config I forgot how to admin it over the 10 years) so I'm trying to keep things simple so it will survive decades.
Humphrey#
Love this! That said, I achieve the same thing manually using Docker Compose & some shell scripts. It takes a bike longer, but it has forced me to learn the lower level tools that helpers like Sidekick use.

Also, all of these tools have great documentation on getting up and running, but SIGNIFICANTLY LESS INFO ON HOW TO MAINTAIN OVER THE LONG TERM. If I was going to start using a tool like Sidekick, Kamal, or Dokku I would want clear answers to the following:
- How do I keep my VPS host up and running with latest security updates? - How do I update to more recent versions of Docker? - How do I update services that maintain state (eg. update to a new Postgres version) - How do I seamlessly migrate to a new host (perhaps as a way to solve the above)? - How should I manage and serve static resources & user media? (store on host or use cloud storage?) - How do I manage database migrations during an update, and how do I control that process to avoid downtime during an update?
I just spent an entire evening transferring a side project to a new VPS because I needed to update Postgres. The ideal self-hosting solution would make that a 20 min task.

LVB3 replies#
This looks good, and I’m a target user in this space.

One thing I’ve noticed is the prevalence of Docker for this type of tool, or the larger self-managed PaaS tools. I totally get it, and it makes sense. I’m just slow to adapt. I’ve been so used to Go binary deployments for so long. But I also don’t really like tweaking Caddyfiles and futzing with systemd unit files, even though the pattern is familiar to me now. Been waffling on this for quite a while…

kokanee2 replies#
I'm a waffler on this as well, increasingly leaning away from containers lately. I can recall one time in my pre-Docker career when I was affected by a bug related to the fact that software developed on Mac OS ran differently than software running on CentOS in production. But I have spent untold countless hours trying to figure out various Docker-related quirks.

If you legitimately need to run your software on multiple OSes in production, by all means, containerize it. But in 15 years I have never had a need to do that. I have a rock solid bash script that deploys and daemonizes an executable on a linux box, takes like 2 seconds to run, and saves me hours and hours of Dockery.

bantunes2 replies#
I don't understand how running a single command to start either a single container or a stack of them with compose, that then gets all the requirements in a tarball similar and just runs is seen as more complicated than running random binaries, setting values on php.ini, setting up mysql or postgres, demonizing said binaries and making sure libraries and the like are in order.
bluehatbrit7 replies#
I suppose like anything, it's a preference based on where the majority of your experience is, and what you're using it for. If you're running things you've written and it's all done the same way, docker probably is just an extra step.

I personally run a bunch of software I've written, as well as open source things. So for me docker makes everything significantly easier, and saves me installing a lot of rubbish I don't understand well.

Continue this thread — 7 replies

hiAndrewQuinn1 reply#
You're going to be setting all that stuff up either way, though. It'll either be in a Dockerfile, or in a Vagrantfile (or an Ansible playbook, or a shell script, ...). But past a certain point you can't really get away from all that.

So I think it comes down to personal preference. This is going to sound a bit silly, but to me, running things in VMs feels like living in an apartment. Containers feel more like living out of a hotel room.
I know how to maintain an apartment, more or less. I've been living in them my whole life. I know what kinds of things I generally should and should not mess with. I'm not averse to hotels by any means, but if I'm going to spend a lot of time in a place, I will pick the apartment, where I can put all of my cumulative apartment-dwelling hours to good use.

Continue this thread — 1 reply

codiogo#
I did the same, created a thing that is supposed to be a collection of scripts to set up a vps without any container. You can check it out at https://github.com/diogocasado/coderaft
mikkelam2 replies#
There are tools like firecracker that significantly reduces docker overhead https://firecracker-microvm.github.io/

I believe fly.io uses that. Not sure if OP’s tool does that

indigodaddy#
Was wondering the same— didn’t see any mention of it in the GH page though, nor even in roadmap
mightymoud#
No Sidekick doesn't use firecracker. I know fly.io is built around it yes. They do that so they can put your app to sleep - basically shutting it down - then spin it up real quick when it gets a request. No place for this in Sidekick vision
faangguyindia1 reply#
Here's the thing, we've code running on VPS in cloud for a decade with any problem

When we ran it on kubernets, without touching it, it broke itself in 3 years.
Docker is fantastic developement tool, I do see real value in it.
But kubernets and whole ecosystem? You must apply updates or your stuff will break one day.
Currently I am using docker with docker compose and GCR, it does make things very simply and easy to develop and it's also self documenting.

prmoustache2 replies#
Kubernetes doesn't break on itself. This is totally untrue. The only thing that is a timebomb are the ssl certificates it is using but they can easily be checked and renewed.
faangguyindia#
We were using gcp and aws managed kubernets.

Same experience in both places.
The app broke itself.
Now we don't use managed kubernets anymore.

rustyminnow#
I'm pro kubernetes, but AWS does push you to upgrade your cluster fairly often (annually?) which could break things. It would be cool if kubernetes had LTS releases.

Load more comments