Obviously the “server” API is extremely sensitive and I think you have to assume it is effectively exposed to the outside world, even with a 127.0.0.1 binding and a firewall.
I guess if you make localhost users literally login and establish a session then you could consider yourself safe. But it’s a weird experience logging into a local application. So whatever you are doing to authenticate the request as local, it has to be unspoofable.
I just don’t think I trust the HTTP headers enough!
(Edit: I just looked it up again and I'm 99% sure that web pages can't override the Origin header, especially when making cross-origin requests.)
What about other, potentially unprivileged software running on your machine that can?
> Yeah, we don't trust just anything that comes in on that socket
Well, you are, you're trusting it came from a browser so the Origin header is correct, right?
But for now we just hard-code a port. I personally prefer this since it's easy to use and convenient to remember. But if a lot of client machines have conflicts, I guess we'll change that...
I've implemented something similar and went through the same stage "I will wait until someone complains" and they will happen, just prevent them right now :)
- is designed for consumers who are not technically skilled
- works on Linux and BSD (I don't think Arq does)
- offers redundant cloud storage with up to 5 providers, and requires only a single upload of the data as compared to uploading it 5 times
- allows you to backup to local disk, friends' computers (or your own) running Relica (with authorization of course), or the cloud, which is totally managed by us so non-technical users can use it
Relica also does client-side encryption and deduplication, of course. Backups can also be restored directly with restic (open source), without requiring a reliance on Relica.
Basically, Relica is a good balance of "user-friendly" combined with features for power users.
How does that work?
This does raise the question of how fast the upload will be - how's your network?
Switching from Dropbox to OneDrive doubled my upload speed simply because there's better peering from my ISP to Akamai vs whatever Dropbox was using at the time.
We're doing exactly this prime-time with Relica: https://relicabackup.com (sorry, not much on the landing page yet, but we have emailed out some info about the UI already [1]). That technique will allow us to distribute backup software that works the same for macOS, Linux, BSD, and Windows, right away; screenshot: [2]. And it's very lightweight.
An added benefit of this approach: we were able to take its REST API and, after writing a small custom Go package, we instantly gained an elegant CLI [3] so it has a headless mode too! With all the functionality of the GUI [4].
I haven't seen much consumer software that does this, and I'm not sure why, so I feel like we're taking a bit of a risk, but I think (hope) it will pay off; the benefits have already started becoming clear and they're definitely appealing.
[1]: https://mailchi.mp/2b5e7f57e400/a-brief-introduction-to-reli...
[2]: https://twitter.com/relicabackup/status/1005105584260067329
[3]: https://twitter.com/relicabackup/status/1006204516344086528
[4]: https://twitter.com/relicabackup/status/1006206423821254656