Simple editable pastebin
Jot is a simple and editable pastebin that’s super easy to host yourself. It
doesn’t require installation of large dependencies and everything runs from a
single binary. Outside a data dir and encryption seed file for password
generation, you don’t need a programming language installed or assets anywhere
on your server.
The Jot feature set is very simple. The server exposes a very limited set of
CRUD operations defined below:
POST
content and get back a unique URL (JOT_URL
) and a Jot-Password headerGET
to JOT_URL
and you get back the content and an ETag header with the lastGET
to JOT_URL
with If-None-Match
header set and you will get a 304 NotPUT
to JOT_URL
with ?password=<Jot-Password value>
and you can update thatPUT
supports If-Match
header allowing you to bail if the content has beenGET
.DELETE
to JOT_URL
with ?password=<Jot-Password value>
and you will deleteGET /
: help text
POST /txt
: create a text jot
GET /txt/<id>
: get a text jot
PUT /txt/<id>?password=<password>
: edit a text jot
DELETE /txt/<id>?password=<password>
: delete a text jot
POST /img
: upload an image
GET /img/<id>
: get an image
DELETE /img/<id>?password=<password>
: delete an image
Requires: Go >=1.14
Running from localhost is simple. Below describes the minimal effort that goes
into running Jot:
# setup the source code dir
export JOT_HOME="${HOME}/code/jot"
mkdir -p "${JOT_HOME}"
git clone https://github.com/kyleterry/jot "${JOT_HOME}"
# these two are for config and data storage
mkdir -p "${HOME}/.config/jot"
mkdir -p "${HOME}/.local/share/jot"
# export the configuration for the jot proc
export JOT_MASTER_PASSWORD="please change this, this is your master password (also don't lose it)"
export JOT_SEED_FILE="${HOME}/.config/jot/seed"
export JOT_DATA_DIR="${HOME}/.local/share/jot"
cd "${JOT_HOME}"
# generate the seed file encrypted with the master password
go install github.com/cloudflare/gokey/cmd/gokey
gokey -p "${JOT_MASTER_PASSWORD}" -t seed -o "${JOT_SEED_FILE}"
# build and run jot
go build ./cmd/jot
./jot
curl http://localhost:8095