July 8th, 2024

Bashbro – Make Any Comp a Web-Based File Server

The GitHub repository "bashbro" offers a Bash web file browser for remote browsing, streaming, and document viewing. It supports Windows via WSL, includes key points, integrates various tools, and is GPL v3 licensed. Instructions for local and remote use are detailed.

Read original articleLink Icon
Bashbro – Make Any Comp a Web-Based File Server

The GitHub repository for "bashbro" hosts a Bash-based web file browser enabling remote browsing, streaming, document viewing, and file saving via a web browser. It is compatible with Windows through WSL. Key points include starting bashbro locally or on a remote server, downloading the repository, and additional tips like using IP addresses if localhost is blocked. Bashbro integrates tools like Bash, Tree, Sed, Socat, and getopt and is licensed under the GNU General Public License v3. The repository includes images illustrating "Bashbro Usage" and a demo showcasing its functionality. Instructions for running bashbro locally involve commands like 'bashbro -s -p 5555' or 'bashbro -sp6555', while running it on a remote server requires copying the tool and executing it via SSH. Users can clone the repository or directly fetch and run bashbro using commands provided in the repository.

Link Icon 14 comments
By @password4321 - 7 months
In a slightly more heavyweight category I've settled on dufs for my single binary file serving / uploading / password-protecting needs.

https://github.com/sigoden/dufs

By @sigmonsays - 7 months
go's version is this which is my favorite because a single http server serving static files is cool but it's better to program it to do what you want.

    package main

    import (
        "net/http"
        "os"
    )

    func main() {
        if err := http.ListenAndServe(os.Args[1], http.FileServer(http.Dir(os.Args[2]))); err != nil {
            panic(err)
        }
    }
By @gouggoug - 7 months
I re-read "Make Any Comp a Web-Based File Server" 10 times and I don't understand what it means. Specifically the word "Comp".

What does this mean?

By @apitman - 7 months
In case you're wondering the same thing I was, it uses socat to listen on the port
By @jdefr89 - 7 months
What is wrong with "python -m http.server"?
By @andrewstuart - 7 months
Also "For when you really just want to serve some files over HTTP right now! "

https://github.com/svenstaro/miniserve

By @rasengan - 7 months
Nice job.

You can do it in python with python -m http.server also!

By @amelius - 7 months
This is cool, but there's currently an overload of ports assigned on my system.

Is there a way to manage all these port numbers? And why can't we use strings, even if just locally?

And what do people use to allocate port numbers in a way that you'll never get clashes?

By @pama - 7 months
If you can ssh to the remote, you can simply use Emacs (dired and trump). I suppose the advantage here is that once you turn a machine into a file server you can access it from other devices.
By @johnbellone - 7 months
Still doesn’t beat ksh cgi server. Ugh.
By @etc-hosts - 7 months
needs a Dockerfile