Live data from Hacker News

CapRover: Build your own PaaS

caprover.com

171–180 of 183 posts

Re: CapRover: Build your own PaaS

#171

Earlier quoted context omitted.

I actually developed a system similar to this but used docker compose as an alternative to Procfiles and nginx+le to handle dynamic virtual hosting. It's actually a golang app that will automatically provision git repos with the necessary hooks and also allow you to exec into a container directly over SSH. I had the thought of using docker stack to achieve zero downtime but haven't had a chance to try that out. Happy…

The problem with nginx based setups is that one wrong container option (label, env var, etc ...) may cause a syntax error in the nginx configuration file and then nginx won't start, so all services will be down. Loved apache, loved nginx, but I can see traefik is the only http server on my tech blog for the last years... Nginx is made to load a configuration: you don't have the auto-configuration that comes with serv…

These are all extremely valid points! I guess I should've clarified how things work a bit (which I am currently in the process of documenting how it works and how to deploy it).

Ingress management is done with the very useful nginx-proxy[0] service that loads virtual host definitions directly from the docker daemon and sets virtual hosts based on env vars set on the container. Configuration changes are loaded using an nginx reload, so even if there was an error in the configuration (which I personally have never run into though is likely possible), it wouldn't take effect. LE is then handled using the nginx-proxy-letsencrypt-companion[1]. My goal was to abstract away reverse proxy+cert management and I think any solution (traefik, caddy, etc) would work here and I'm more than happy to change it. More or less just went with nginx since it was easy and I didn't have to do any configuration other than adding it to a docker-compose file.

I guess my goal wasn't to handle ZDD for stateful applications. As you mentioned, there's a plethora of issues that arise and make that type of application much more difficult to do ZDD. I tend to write a lot of stateless web apps for simple use cases and like to have an easy way to deploy them. In the primitive sense, creating a new container, waiting for it to be ready, and then swapping the upstream used for the reverse proxy with the new pointer would be ideal but isn't supported directly with docker-compose (as mentioned).

Happy to talk this through also, especially if you'd be interested in contributing!

[0] https://github.com/nginx-proxy/nginx-proxy [1] https://github.com/nginx-proxy/docker-letsencrypt-nginx-prox...

Re: CapRover: Build your own PaaS

#172

Earlier quoted context omitted.

How do you mean? I never touch the actual containers, I always just let Dokku take care of those, I just push the code with the Buildpack and Dokku handles the rest.

Oh wow, disregard that. I've never even touched buildpacks, didn't really know they were a feature. Everything I use is containers.

There is always a container in the end. But do you actually provide a Dockerfile along with your app code, or do you let buildpack create the container for you (ie. no Dockerfile in your source code)?

Re: CapRover: Build your own PaaS

#173
post #172

Earlier quoted context omitted.

Oh wow, disregard that. I've never even touched buildpacks, didn't really know they were a feature. Everything I use is containers.

There is always a container in the end. But do you actually provide a Dockerfile along with your app code, or do you let buildpack create the container for you (ie. no Dockerfile in your source code)?

Yeah, it's all containers. Here's my template project:

https://github.com/skorokithakis/django-project-template

Re: CapRover: Build your own PaaS

#175

Earlier quoted context omitted.

The problem with nginx based setups is that one wrong container option (label, env var, etc ...) may cause a syntax error in the nginx configuration file and then nginx won't start, so all services will be down. Loved apache, loved nginx, but I can see traefik is the only http server on my tech blog for the last years... Nginx is made to load a configuration: you don't have the auto-configuration that comes with serv…

These are all extremely valid points! I guess I should've clarified how things work a bit (which I am currently in the process of documenting how it works and how to deploy it). Ingress management is done with the very useful nginx-proxy[0] service that loads virtual host definitions directly from the docker daemon and sets virtual hosts based on env vars set on the container. Configuration changes are loaded using a…

Actually, the experience with broken config comes from using nginx-proxy (along with the le companion) in production for 18 months or something, that and other inconveniences pushed me to give Traefik a try and I was really delighted, no dealing a configuration template, and I can view the configuration from the web dashboard instead of having to ssh into nginx to get the config.

Traefik and Caddy are not comparable in my opinion because Traefik was literally made for self-configuration based on service discovery, see an interresting discussion here: https://www.reddit.com/r/selfhosted/comments/gq90aw/traefik_...

I completely agree with you about ZDD, 99.9% of uptime is plenty enough for 99.9% of the projects, and trashing the container to start a fresh process from a fresh system build does come with other advantages. Sure, any kind of blue/green deployment or canary would be really nice to see, but it wouldn't seem to create a lot of value for 99.9% of the projects, and for the rest well there's k8s that deals with clusto

Currently I'm just using a bunch of ansible roles with an ansible command line wrapper, so I'll do `bigsudo yourlabs.netdata @somehost` and it'll auto-install yourlabs.traefik if not already there, which will auto-install yourlabs.docker if not already there, and basically just leave me with `https://netdata.somehost.fqdn`

Thank you for the invitation to contribute ! As you probably guessed, I'm a bit like you in the sense that I cannot live without making my own system, and I have made different design decisions:

- Python for server side, I find it more fun than JS, nothing we can do about that

- Python for client side, because we maintain our crazy isophormic component library in python

- Not docker, but podman, which can run rootless and daemonless (thought we need the daemon that provides a docker compatible API to have Traefik service discovery)

- Not docker build, but something I'm cooking on my own ("shlax") that I find a lot better for my taste, and that uses buildah which can build rootless

- Not docker-compose, but shlax, which aims to support a broader range of use cases (such as backup/restore)

- The thing I'm building is first a really KISS Sentry alternative, then also a GitLab alternative, and I'm in the process of adding CI into it ... but I stopped doing that until I have finished my little Python lib ("shlax") that replaces docker/compose and ansible to have something to put in the CI test that's not tech that I'm trying to move away from, and so that it can build/test/deploy itself,

So, I suppose our goals and design decisions are a bit too different, but I can assure you that I'm always happy to see CapRover featured in social media, and I'm always happy to discuss rare passions like that, if you're looking for a crazy friend recoding his entire little world to just talk about these kind of things feel free to send me an email or give me a call ;)

Re: CapRover: Build your own PaaS

#176

Earlier quoted context omitted.

Could you quickly explain the math behind this please? Genuinely curious

For every character in the password, you have 26 possible letters to choose from in an English alphabet. Brute forcing this, you would have to try every combination. Which means for a four-letter long password: 26x26x26x26 = 456 976 possible passwords. For a 10 letter long password: 26^10 = 141167095653376 possible passwords.

You forgot the other 26 uppercase letters, and the 10 digits 0-9. Looks good otherwise, but the result is much larger with a base of 62.

Clarifying it further is “number of days to brute-force if you can try (eg) 10k requests/sec”.

Re: CapRover: Build your own PaaS

#177
post #176

Earlier quoted context omitted.

For every character in the password, you have 26 possible letters to choose from in an English alphabet. Brute forcing this, you would have to try every combination. Which means for a four-letter long password: 26x26x26x26 = 456 976 possible passwords. For a 10 letter long password: 26^10 = 141167095653376 possible passwords.

You forgot the other 26 uppercase letters, and the 10 digits 0-9. Looks good otherwise, but the result is much larger with a base of 62. Clarifying it further is “number of days to brute-force if you can try (eg) 10k requests/sec”.

Absolutely, you are of course correct. The uppercase letters and digits - together with the special characters like "!._-,...".

I kept it to 26 letters to keep the math simpler (or rather - the numbers smaller, for myself, really).

Number of days to brute-force if 10k requests/sec (26 letters still...):

4-length password = 45 seconds

10-length password = 453 years

Please give me a heads up if my math is off.

Re: CapRover: Build your own PaaS

#178

Earlier quoted context omitted.

>web services that require high availability, redundancy and reliable backups. For these I just use Heroku. How do you handle Heroku outages then?

Heroku outrage free was 99.9999%+ over the past 60 days[1], I'd have a hard time achieving this with a single dedicated server. [1] https://status.heroku.com/

I have a raspberry pi running on my desk that has been running for 60 days sitting on my desk with no outages. I don't even have a battery backup!

Re: CapRover: Build your own PaaS

#179

Earlier quoted context omitted.

>web services that require high availability, redundancy and reliable backups. For these I just use Heroku. How do you handle Heroku outages then?

Heroku outrage free was 99.9999%+ over the past 60 days[1], I'd have a hard time achieving this with a single dedicated server. [1] https://status.heroku.com/

Maybe I am just an exception but I have 100% availability on one dedicated server for the last 2 years.

Re: CapRover: Build your own PaaS

#180

I have been using CapRover for about half a year now on my personal server running multiple projects. It does what you'd expect and the configuration format is pretty easy to use, using any docker image directly works without any extra steps, just enter the image name and it'll do the rest. I'm pretty happy with it and will probably stay with it for the time being. It's not the best for hosting many static pages, as…

> you'll need a HTTP server for each site isn't that what virtualhosts are for?

CapRover creates virtual hosts for each "app" which is then proxy_pass'ed to the container for said app.

You could try and mount the static site's container files to the local filesystem and serve from there I suppose, but there's currently no easy way to do so.

Post reply on HN