Not an native app for a mobile ecosystem, not a Linux or Windows app. This is a web app, and the story behind it is as follows.
I wrote a while back about my big issue with self-hosting services, which is that the most secure method of access means unauthorised devices don’t know they exist. That in my case is the Tailscale VPN service, and it does its job well. So well, in fact, that it becomes downright annoying when I have a set of files on one device and I want to transfer them over to another that isn’t on Tailscale.
I should point out that I am entirely aware that other sharing protocols do exist that solve this exact problem, as well as hosted file storage platforms. However, this had not occurred to me at the point of starting this project, so frankly, shush.
In that article, written on the 30th October, I mentioned at the end a potential solution that I could see, which was a web server open on LAN, where you could drop files into it and any other device on the network could download those files within the specific time window, before they were deleted from the server. I made a passing comment that probably, there were a half-dozen different reasons why that couldn’t work. So I’m going to build it.
Now that the little excerpt that the frontpage gets is finished and has done its nefarious purpose of being suitably vague as to attract attention, I can actually talk about the nuances of this process.
The way this platform would work is, in theory, relatively simple. No accounts, no sign-in. Any device on the local network can access the server in their browser, where they can upload a file. That file then has a 24-hour (or some other time limit) lifetime on the server, before it’s forcibly removed from existence. But before then, any other device can go to the server and download a copy of the file. Those are the rules.
Because I’ve got nothing better to do, I’m going to build the backend in Go. Why? Partly because of its low overhead, excellent HTTP integration, and ease-to-deploy on Linux. Partly because I’m bored right now and have never coded in Go. At the time of writing, I’ve done a little experimentation already and found it quite similar to JavaScript in many ways, but that’s for a different post. The frontend will be built using React, because I’m comfortable with it; an SQLite database will store records; the files themselves will be on the local filesystem, and the whole thing will be topped off with a REST API for ease.
This server should be relatively simple: file is uploaded, and a timestamp is calculated set to 24 hours in the future from the upload time. Until that time, the file is stored locally, and the server frontend presents it with a download button. Once the 24 hours have passed, the server deletes that file, and carries on with its day. Then I get to decide what meaningless features I stuff in there too.
You can follow me building this in realtime over on Codeberg โ I’ve made the repo public. It’s called “Blink” as a reference to the ephemeral nature of the files uploaded, and as an ode to every piece of software ever that has a philosophical title and makes me wince somewhat to read. One thing to note: I’ve deliberately turned off pull requests, because I don’t want anyone building it for me. I have left issues open though, so if you have suggestions or find a bug somewhere, please let me know. Expect revisions, relapses, and possibly the repo will be entirely deleted and remade once or twice; who knows.
Anyway, I’m off to write more Go and curse the compiler for not letting me off omitting commas. Allons-y!