Shrub: Share Hub
A fast, minimal short‑link and paste service
Visit /openapi endpoint for more details.
Create a short link or paste:
url or c (mutually exclusive), optional ttl (default from config){"code":"A1b2","expire":"2025-01-01T10:00:00Z","url":"https://example.com/A1b2"}Read a link or paste:
302 Temporary Redirect to the original URLDelete a link or paste:
204 No Content if successful# Create a short link
curl -s -F url=https://example.com http://127.0.0.1:8321/
# => {"code":"A1b2","expire":"2025-01-01T10:00:00Z","url":"https://example.com/A1b2"}
# Create a short link with custom TTL
curl -s -F url=https://example.com -F ttl=120 http://127.0.0.1:8321/
# => {"code":"A1b2","expire":"2025-01-01T10:00:00Z","url":"https://example.com/A1b2"}
# Create a paste with custom TTL
echo "hello shrub" | curl -s -F ttl=300 -F "c=@-" http://127.0.0.1:8321/
# => {"code":"A1b2","expire":"2025-01-01T10:00:00Z","url":"https://example.com/A1b2"}
# Create a paste with image
curl -s -F "c=@-" http://127.0.0.1:8321/ < avatar.webp
# => {"code":"A1b2","expire":"2025-01-01T10:00:00Z","url":"https://example.com/A1b2"}
# Delete a link or paste
curl -i -X DELETE http://127.0.0.1:8321/A1b2
# => HTTP/1.1 204 No Content
Create a .env file with .env.example as template.
Then run:
docker-compose up -d
Create a .env file with .env.example as template.
Then run:
docker run --env-file .env -d -p 3000:3000 zhxycn/shrub:latest
bun install
bun build --compile --minify-whitespace --minify-syntax --outfile server src/index.ts
chmod +x server
./server
Environment variables such as:
PORT=3000REDIS_HOST=redis