This fileserver is a very minor change ontop of the built in golang fileserver. It adds a few things:
- Fitler out .dotfiles
- Use lets encrypt
- Use a basic template for layout
- This lets me add id values to the links generated so I can know if something is
a
.filelink
or.folderlink
w/o too much processing post fact
What you need to compile:
sass compiler of some sort gnu Make
make
run ./fileserver -serveDir <directory you want to share> -domains <coma.net,separated.org,domain.co,list.com>
This will do HTTP/2 TLS only serving (probably does http/1.1 as well, but didn't bother to check). You need to be listening on the domain you specified. This will fetch you a letsencrypt certificate for the domain/domains listed. Should do the refreshing as well: but haven't checked.
Also: make sure you understand how the autocert is cached on your system.
https://godoc.org/golang.org/x/crypto/acme/autocert#NewListener
don't do this excecpt for testing
run `./fileserver -serveDir -tls false