Skip to content

simple and effective fileserver written in go to share files quickly

License

Notifications You must be signed in to change notification settings

notwithering/shit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shit - share it

simple and effective fileserver written in go to share files quickly

shit when i first created it was just a go script that ran an http.FileServer on the current directory but i kept adding more features as i needed them over time (hosting a single file, hosting multiple files, hosting both files and directories, etc.) but now i think its ready for other people to use

shit is a successor to my previous project vmshare

go install github.com/notwithering/shit@latest

features

  • smart
    • share single files, multiple files, and/or directories
    • auto-redirects for single items
    • built-in directory browsing with HTML interface
    • proper MIME type detection and handling
  • many options
    • custom host/port (--host, --port)
    • TLS support (--tls, --cert, --key)
    • file upload support (--upload)
    • index file serving (--index)
    • go's http.FileServer mode (--go)
  • security & reliability
    • path validation & traversal protection
    • error logging with timestamps
    • environment variable support

examples

$ echo "hello" > a.txt
$ echo "hi" > b.txt
$ mkdir dir
$ echo "hey" > dir/c.txt

host current directory

$ shit
$ curl 127.0.0.1:8080
a.txt
b.txt
dir/
$ curl 127.0.0.1:8080/a.txt
hello

host a single file

$ shit b.txt
$ curl -L 127.0.0.1:8080
hi

host a few files

$ shit a.txt b.txt
$ curl 127.0.0.1:8080
a.txt
b.txt

host a file and a directory

$ shit a.txt dir/
$ curl 127.0.0.1:8080
a.txt
dir/
$ curl 127.0.0.1:8080/dir
c.txt
$ curl 127.0.0.1:8080/dir/c.txt
hey

etc.

licenses

this project uses the following dependencies with the license as noted:

each dependency retains its respective license. for more details refer to their official documentation or source code

About

simple and effective fileserver written in go to share files quickly

Topics

Resources

License

Stars

Watchers

Forks