I ( @alpin@lemmy.ml ) started writing a small piece of software some time ago to easily host files on a local server and share them with any device equipped with a web browser or an HTTP client (curl, wget, etc.). I've been using it myself at home and I keep slowly working on it in my free time to add features and fix the problems that I find.

It's very lightweight and fast, and it doesn't require anything special to compile, just a Unix-like system, a C compiler, and a few standard utilities (sorry Windows users). It's compiled into a single binary and that can be configured at compile time or with a config file.

For now it can only be used to download files from the hosting server, but I'm working on uploading, renaming, and deleting files.

Hopefully it can be useful to other people. Any (constructive) feedback is welcome!

Link with source code and instructions: https://codeberg.org/alpin/lanstash

OC by Developer @alpin@lemmy.ml

all 9 comments

sorted by: hot top controversial new old
[–] 7 points 2 months ago (4 children)

Is an SMB share just to difficult to figure out or something?

  • source
  • hideshow 4 child comments
  • [–] 3 points 2 months ago

    To be fair setting up a user account for a random file is a nuisance.

    I run a simple web server for just this purpose. Anyone in the net can access my software folder via any browser, download whatever they need. Windows/Linux/Android apps, scripts, etc.

    This way no user account is needed, I just send them a link. And the files are well-isolated by both the share the webserver connects through (read only) and then users can only access the files through the web server which doesn't have any change capability.

  • source
  • parent
  • [–] 2 points 2 months ago (1 child)

    Unironically, yes.

    I used to have every device on my network connected via smb share. Either I did something completely wrong or the protocol is just dog slow. Switched to filebrowser quantum with local mDNS resolution and haven't looked back. Now when I need to move files from pc to pc over the network I just navigate in a browser to http://files.local/ and download them on the client machine. It is also significantly more friendly for my (non-techie) partner who often uses it to grab music from our shared digital music library to put on their MP3 player.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 2 months ago

    what's wrong with python -m http.server ?

  • source
  • [–] 2 points 2 months ago

    What in the name of AI insanity is all this unrelated code.

  • source
  • [–] 2 points 2 months ago (1 child)

    My go-to is LocalSend for this, but sure, why not.

  • source
  • hideshow 1 child comment
  • [–] 4 points 2 months ago

    I think the localsend protocol is nice yes

    The apps work nice too

    But it is written in dart and flutter, which makes it pretty heavy and not native. The android app is 46MB wich doesnt sound much because android apps generally got more and more bloated... but for comparison iyox wormhole is only 14MB.

    Syncthing-fork is bigger, basic-sync a bit smaller. But still, a small CLI could be under 1mb and run on way more devices

  • source
  • parent
  • 6 comments in c/opensource@lemmy.ml view that post
    [–] 11 points 2 months ago (3 children)

    I'm not trying to discourage you, I think projects like this should exist.

    That said, there's a lot of other things that do this as well. Off the top of my head there's python -m http.server that i've used to quickly make a directory available to other machines on the lan.

  • source
  • hideshow 3 child comments
  • [–] [S] 3 points 2 months ago*

    That's a good point. At the beginning I was using a CGI script in Python with Apache, but I wanted to learn how HTTP works and how to use sockets and list directory contents in C. I experimented and eventually got something that I liked, so that's why I continued working on it ^.^

  • source
  • parent
  • [–] [S] 4 points 2 months ago (1 child)
  • [–] [S] 4 points 2 months ago*

    (Sorry, it's the first time I post on Lemmy. I thought I was writing an edit summary after fixing a typo in my post. And deleting my comment leaves a "Deleted by creator", so better leave it there I guess)

  • source
  • parent