Hosting files instead of synchronizing

Hi.

I was thinking about a project where I would use Syncthing to share and receive data from untrusted devices. For security reasons I would like not to receive/sync files to my drive from these untrusted devices which of course is kind of weird when using Syncthing.

But this made me think if anyone ever considered a feature for Syncthing where files were not synchronized but instead hosted on a web server? From this web server only accepted devices in Syncthing (with access to a specific shared folder) could make http request to read/download files in a specific folder.

I don’t know if this would be really difficult to implement but seems like a more secure way to share some data files compared to receiving files and double clicking them (maybe I am wrong?).

It seems like such a http hosting feature would enable many different possibilities as Syncthing could then act as a decentralized hosting layer on which one could build many decentralized applications.

Anyways just a thought but would be interesting to hear peoples opinions on such a feature.

Now sure how is this different to just hosting files on a webserver? Whats the point of syncthing?

Sorry I should have explained the purpose of this a bit better.

Its probably not that different than just hosting on a webserver. But the point of Syncthing would be to provide the authorization mechanism and provide the webserver functionality out of the box without any further installation requirements (e.g. opening ports on routers etc). Also the role of Syncthing would be to make it more practical to run a webserver on an internet connection with dynamic IP address.

So summarized Syncthing would make it very easy to host files. Download Syncthing, add devices, share (web hosted) folder, done.

Yeah, that is not what syncthing is, and not what we see syncthing solving.

You could setup certificate based authentication on a normal web server if you wanted to.

Perhaps ipfs is more what you are after.

Ok.

I think maybe my lack of knowledge on syncthing and my bad explanation of this “hosting” feature has made my post (and title) somewhat misleading.

From what I understand syncthing splits files into blocks which are synchronized across devices and then combines blocks into a file in a folder. With this “hosting” feature syncthing would still keep track of blocks hashes (which I guess is kind of still synchronizing) but not necessarily download the blocks continuously from other devices. Instead syncthing would include a local web server that upon requests to a specific url (e.g. [http://127.0.0.1:8384/[folder_name]/file_name]) would start the “synchronization”/downloading of file blocks. However the blocks should not be combined into a file in the filesystem but instead served as a http response at the specified url. Different caching mechanisms in the local web server could of course be implemented and hence synchronization could possibly still happen continuously in the background. But the idea would be to prevent synchronized/downloaded files to be accessible/executable directly from the file system for security reasons. Kind of similar to how Javascript in the browser for security reasons cannot write to the file system.

The effects of the above described feature would probably be the same as hosting files on a public web server with authorization combined with some mechanism for handling changing IP addresses of hosts. But imo syncthing could probably do this in a much more simple, out of the box manner compared to setting up a web server, then setting up authorization (maybe using certificates), then handling changing IP addresses. With syncthing it could be as simple as install syncthing, add devices, share folder and then you could start sending local http request which are actually serving non-local/shared data.

Hope this makes more sense. And fair enough if this is still not something you see syncthing solving. For me the simplicity of using syncthing is really one of the great benefits and a “hosting” feature like this seems like a pretty good opportunity to increase usage of syncthing. But of course I could be wrong :slight_smile:

best regards

I think this is out of scope for syncthing, and should probably be a separate application to syncthing, potentially reusing syncthing’s libraries.

However, I don’t think anyone is planning to work on that.

Lastly, I still think you could solve this with syncthing (downloading data locally) and a webserver serving that data.

There is something fundamental in your idea that I do not understand. You say that Syncthing would provide the authorization mechanism, but between what two entities? Is the client an HTTP client or is it an instance of Syncthing itself?

You may find something useful in Syncthing Lite, whose purpose was very similar if I recall correctly:

This is a client-oriented implementation, designed to work online by downloading and uploading files from an active device on the network (instead of synchronizing a local copy of the entire repository). Due to that, you will see a sync progress of 0% at other devices (and this is expected). This is quite different from the way the syncthing-android works, and it’s useful for those devices that cannot or do not wish to download the entire repository (for example, mobile devices with limited storage available, wishing to access a syncthing share).