gone is an ephemeral content hosting server written in Go.
The primary goal is to enable sharing of files and text using command-line API or simple HTML user interface.
gone requires Go to develop.
To build on Linux:
make build
Binaries are built to the release
directory for distribution and installation.
To run on Linux:
make run
To run in debug mode on Linux:
make debug
Application output is structured in JSON format and can be parsed with jq
for convenience, for example:
./gone | jq .data
The optional -debug
flag can be used for debug mode (provides additional application output).
gone uses an embedded JSON-based configuration defaultSettings.json as default settings.
To change application settings, copy the default settings JSON file and use the -config
flag:
./gone -config=mySettings.json
The server provides a basic user interface for uploading, downloading and listing files at the default path (/
):
All features are also available using command line programs such as curl:
Get server status:
curl localhost:8080/heartbeat
Upload file:
curl -F "file=@test.txt" localhost:8080/upload
Upload multiple files:
curl -F "file=@test.txt" -F "file=@test2.txt" localhost:8080/upload
With 3 allowed downloads before file expiration:
curl -F "downloads=3" -F "file=@test.txt" localhost:8080/upload
With a 15 minutes file expiration:
curl -F "duration=15m" -F "file=@test.txt" localhost:8080/upload
List uploaded files:
curl localhost:8080/list
Download file (the default configuration requires basic authentication):
curl -H "X-Auth: mySecret" "localhost:8080/download/test.txt"
Get static (never expires) content:
curl localhost:8080/static
Post a message (use single quotes to wrap special characters):
curl -s -F 'message=hello, world!' localhost:8080/msg >/dev/null
Post multi-line text for shared edit:
curl -s -F "wall=$(cat /etc/dnsmasq.conf)" localhost:8080/wall >/dev/null
Get shared multi-line text:
curl localhost:8080/wall | jq -r
Get a random value of certain type:
curl localhost:8080/random/
curl localhost:8080/random/name
curl localhost:8080/random/nato
curl localhost:8080/random/number
curl localhost:8080/random/coin
See config/zshrc for alias and function examples, such as:
$ gone_put test.txt 1 20m
[
{
"name": "test.txt",
"downloads": {
"allow": 1
},
"size": "6.00 Bytes",
"owner": {
"address": "127.0.0.1:4306",
"agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.3"
},
"time": {
"allow": "20m0s",
"upload": "2025-04-22T10:00:00"
}
}
]
Application documentation is available with godoc:
make doc
Unit tests are validated by a workflow on repository changes. They can also be run manually:
make test
make test-verbose
Test coverage is also available - to generate an HTML report (testCoverage.html
):
make cover