hard fork of haste-server, feat: modern js, a nicer ui, & easy containerization https://hst.sh
  • JavaScript 71.3%
  • CSS 17.9%
  • HTML 8.9%
  • Dockerfile 1.1%
  • Shell 0.8%
Find a file
2025-12-08 16:41:06 +00:00
bin/postgres rewrite, initial edition 2025-09-19 21:31:43 +02:00
doc cleanup /about a bit 2025-12-08 16:41:06 +00:00
src return missing metadata to logger 2025-12-08 16:33:02 +00:00
static add abuse contact 2025-12-08 16:28:28 +00:00
.dockerignore rewrite, initial edition 2025-09-19 21:31:43 +02:00
.env.development simplify frontend & fix poor cache handling 2025-12-08 16:01:30 +00:00
.env.example migrate logger to winston@3 2025-12-08 15:28:31 +00:00
.gitignore rewrite, initial edition 2025-09-19 21:31:43 +02:00
compose.dev.yml make the dev workflow a bit nicer 2025-12-08 13:58:36 +00:00
compose.yml make the dev workflow a bit nicer 2025-12-08 13:58:36 +00:00
Dockerfile move deps out of the weird dockerfile 2025-12-08 15:33:42 +00:00
eslint.config.js rewrite, initial edition 2025-09-19 21:31:43 +02:00
license.md some readme cleanup 2025-12-08 14:57:29 +00:00
package.json move deps out of the weird dockerfile 2025-12-08 15:33:42 +00:00
pnpm-lock.yaml move deps out of the weird dockerfile 2025-12-08 15:33:42 +00:00
readme.md fill in readme 2025-12-08 15:44:58 +00:00
TODO fill in readme 2025-12-08 15:44:58 +00:00

hst.sh

hst.sh is an open-source pastebin software written in Node.js, which is easily installable in any network. it can be backed by either postgres, s3, or the filesystem, and has a very easy adapter interface for other stores. a publicly available version can be found at hst.sh

major design objectives:

  • be really pretty
  • be really simple
  • be easy to set up and use

hst.sh works really well with a little utility called hst-cli, allowing you to do things like:

cat something | hst

which will output a URL to share containing the contents of cat something's STDOUT.

installation

  1. git clone https://ravy.dev/mint/hst
  2. cp .env.example .env and fill it in
  3. docker compose up -d

local development

  1. git clone https://ravy.dev/mint/hst
  2. cp .env.development .env
  3. pnpm ci
  4. pnpm dev

settings

all configured via environment variables (will also be read from .env)

when running outside of docker:

  • HOST: which IPs to listen on (default: localhost)
  • PORT: what port to listen on (default: 7777)

when running in docker:

  • COMPOSE_PORT: what port to listen on (default: 7777)

document keys:

  • KEY_TYPE: phonetic (alternate vowel and consonant) or random
  • KEY_LENGTH: how many characters the key should have (default: 10)

server:

  • MAX_BODY_SIZE: maximum size of a document in bytes (default: 400000)
  • STATIC_MAX_AGE: how long the client should cache static files in seconds (default: 86400)

rate limiter (disabled unless either of these are specified):

  • RATELIMIT_AMOUNT
  • RATELIMIT_EVERY

storage:

  • STORAGE: one of: postgres, s3, file

storage file:

  • STORAGE_FILE_PATH: where to create the files, relative to the working dir (default: data/)

storage s3:

  • S3_REGION (default: us-east-1)
  • S3_BUCKET
  • S3_ENDPOINT

storage postgres:

  • STORAGE_EXPIRY seconds after which a document should be automatically deleted (default: 0 = never)
  • POSTGRES_USER
  • POSTGRES_DB (default: haste)
  • POSTGRES_HOST
  • POSTGRES_PASSWORD
  • POSTGRES_PORT (default: 5432)

logging:

  • LOG_COLOR: whether to colorize log output (default: false)
  • LOG_LEVEL: log level above which to print to the console (default: info, options: error > warn > info > http > verbose > debug > silly)