shit is a lightweight file server written in go designed for quickly sharing files and directories over http
it supports serving single or multiple files, directories, or a combination of both with features like mime type detection, directory browsing, file uploading, tls, and customizable server settings
shit is a successor to my previous project vmshare
go install github.com/notwithering/shit@latest # latest release unversioned
yay -S shit # latest release versioned
yay -S shit-git # latest git versioned- 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
- detects if using cURL and gives raw text output
- many options
- custom host/port (
--host,--port) - TLS support (
--tls,--cert,--key) - file upload support (
--upload) - index file serving (
--index) - go's
http.FileServermode (--go) - fine tuned control (
--max-upload-memory,--read-timeout,--write-timeout,--upload-timeout,--permanent-redirect)
- custom host/port (
- security & reliability
- path validation & traversal protection
- error logging with timestamps
- environment variable support
$ echo "hello" > a.txt
$ echo "hi" > b.txt
$ mkdir dir
$ echo "hey" > dir/c.txthost current directory
$ shit
$ curl 127.0.0.1:8080
a.txt
b.txt
dir/
$ curl 127.0.0.1:8080/a.txt
hellohost a single file
$ shit b.txt
$ curl -L 127.0.0.1:8080
hihost a few files
$ shit a.txt b.txt
$ curl 127.0.0.1:8080
a.txt
b.txthost 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
heyetc.
this project uses the following dependencies with the license as noted:
- github.com/alecthomas/kong - MIT License
- github.com/dustin/go-humanize - MIT License
each dependency retains its respective license. for more details refer to their official documentation or source code