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
Bashbro – Make Any Comp a Web-Based File Server
21–30 of 52 posts
Re: Bashbro – Make Any Comp a Web-Based File Server
#22This 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?
Re: Bashbro – Make Any Comp a Web-Based File Server
#23What is wrong with "python -m http.server"?
It requires Python. Bashbro, on the other hand, seems to require socat. I wonder if there's any bash-istic method of listening to a port...
But nc is not bash.
Re: Bashbro – Make Any Comp a Web-Based File Server
#24What does this mean?
Re: Bashbro – Make Any Comp a Web-Based File Server
#25Earlier quoted context omitted.
For Bash with `--enable-net-redirections` set at configure time (not a default, not enabled on popular distros to my knowledge), `/dev/{udp,tcp}/$host/$port` is available for this purpose.
Does anyone know if there is a good reason to disable net-redirections?
In a purpose-built environment there is practically no need for such a feature aside from mischief.
Re: Bashbro – Make Any Comp a Web-Based File Server
#26I 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?
Re: Bashbro – Make Any Comp a Web-Based File Server
#27I 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?
Re: Bashbro – Make Any Comp a Web-Based File Server
#28Re: Bashbro – Make Any Comp a Web-Based File Server
#29I 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?
Re: Bashbro – Make Any Comp a Web-Based File Server
#30Earlier quoted context omitted.
https://github.com/victrixsoft/bashbro/blob/c543d5d42ba2425f... needs amending to listen to a Unix socket instead of a port if that's something you'd like to contribute. As for using Nginx, you should be able to install Nginx and enable its service and in that way immediately get a local HTTP server. You can then edit the config such that requests for the Host `myfiles.localhost` are `proxy_pass ...` to your bashbro…
Ok, I appreciate your suggestions. But now I'm thinking about some utility where you can say: run-http-service myfiles bashbro -s -p PORT And then it would just allocate a new port (clash-free), invoke bashbro with the given flags and substitute PORT by the newly allocated port number, and such that it uses myfiles.localhost as the domain. And when bashbro exits, the port number is garbage collected. Somehow, it feel…
I would not bother with service management to the extent that you are checking to see if the process is still running. Maybe garbage collection is worth doing, you could do it in a single run of `lsof` (the temptation to do it with multiple should be resisted).
I think this does not exist because stuff like foreman/overmind have their own method for allocating ports per-project (add 100 for each line in the config file, set the PORT env var to that) as would any sort of production-ready solution.
But it is a fun idea. And perhaps it should exist.