Alyssa Rosenzweig b49a7b490f Switch to set | 5 years ago | |
---|---|---|
accounts | 5 years ago | |
.editorconfig | 6 years ago | |
.gitignore | 5 years ago | |
LICENSE | 5 years ago | |
Makefile | 5 years ago | |
README.md | 5 years ago | |
cert.sh | 5 years ago | |
core.c | 5 years ago | |
core.h | 5 years ago | |
event-loop.c | 6 years ago | |
event-loop.h | 6 years ago | |
jailed.sh | 5 years ago | |
json_compat.h | 6 years ago | |
proxy.c | 5 years ago | |
push.c | 5 years ago | |
push.h | 5 years ago | |
sapphire-accounts.json | 5 years ago | |
secure-compare-64.h | 5 years ago | |
websocket.c | 5 years ago | |
websocket.h | 5 years ago |
sapphire-backend communicates only over local filesystem-resident sockets, to simplify jailing. To reach the outside world -- in particular, to benefit from websockets -- it must be paired with sapphire-proxy, which implements proxying, authentication, and SSL.
To set this up, use:
$ ./sapphire-backend & ./sapphire-proxy
And if you need to restart, it's probably safest to quit both.
This process might be further streamlined in the future.
Historically, on a local single-user Sapphire instance, the architecture was simple:
Browser <--> Backend
However, this does not work for multi-user, public-facing instances. In these cases, to minimise attack surface, this proxy is publicly facing while the backends only listen to localhost and are sandboxed:
Browser <--> Proxy (<--> Backends)
This package proxies WebSockets and implements authentication. It therefore depends on glib/json-glib/libsoup, but it MUST NOT depend on libpurple due to security isolation concerns.