by macns · 4y ago · 0 comments
> The proxy is extremely lightweight. An inexpensive and tiny VPS can easily handle hundreds of concurrent users. Here’s how to make it work:
SSH into the server.
Install Docker, Docker Compose, and git:
I'm sorry but installing Docker on a tiny VPS last time I checked wasn't any light at all.Anyway, the proxy is just an nginx with a custom config file. You can check that file and just add it yourself to an nginx you manage, probably with little changes.
https://github.com/signalapp/Signal-TLS-Proxy/blob/main/data...
https://github.com/signalapp/Signal-TLS-Proxy/blob/main/ngin...
Vs
https://github.com/nginxinc/docker-nginx
For one, this is 5 versions behind (1.18 vs 1.23).
In general seems caddy or haproxy might be a better fit - but nginx is a perfectly fine choice I suppose.
Providing a statically linked binary is even simpler, without all that extra complexity that comes with docker.
I didn't look at the image size but you might be paying a ~100 MB storage penalty to bundle dependencies.
It won't be rootless in this case as far as I know because you will need privileged ports 80 and 443 but good habit in general.
On beefcake supreme machines it's just usually not significant enough to worry about, because the perceived benefits outweigh the downsides.
- if you use docker nat, it about doubles connection time, if you only have extremely short connections this can be quite visible.
- If you need FS access, this can come at a high cost depending on your usage pattern, docker’s layered FS is not cheap.
- Finally Docker enables features which don’t come for free and which you may not be enabling separately e.g. seccomp (this can result in a 15+% performance hit in the worst case)
could it be done leaner? sure
is it worth it if it raises the barrier of entry of getting people to run the proxy? doubtful
Meanwhile, you can just install Docker, which you might already have if you do self-hosting often, and run one command. The overhead of containers is tiny, so you really won't notice it. Bonus points for using Podman, which doesn't even have a daemon.
glibc doesn't support static linking, so it's probably going to be musl. Running a musl binary on an otherwise glibc system isn't an issue.
Containers are more consistent and have less side effects than packages.
> I'm sorry but installing Docker on a tiny VPS last time I checked wasn't any light at all.
There's very little overhead and it takes a one liner[1] to install it.
[1]: curl -sSL https://get.docker.com/ | sh
- Single core 1GHz CPU - 640 MB RAM - 10 GB storage ( default size )
I'd say docker is pretty light.