- JavaScript 71.3%
- CSS 17.9%
- HTML 8.9%
- Dockerfile 1.1%
- Shell 0.8%
| bin/postgres | ||
| doc | ||
| src | ||
| static | ||
| .dockerignore | ||
| .env.development | ||
| .env.example | ||
| .gitignore | ||
| compose.dev.yml | ||
| compose.yml | ||
| Dockerfile | ||
| eslint.config.js | ||
| license.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| readme.md | ||
| TODO | ||
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
git clone https://ravy.dev/mint/hstcp .env.example .envand fill it indocker compose up -d
local development
git clone https://ravy.dev/mint/hstcp .env.development .envpnpm cipnpm 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) orrandomKEY_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_AMOUNTRATELIMIT_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_BUCKETS3_ENDPOINT
storage postgres:
STORAGE_EXPIRYseconds after which a document should be automatically deleted (default:0= never)POSTGRES_USERPOSTGRES_DB(default:haste)POSTGRES_HOSTPOSTGRES_PASSWORDPOSTGRES_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)