Skip to content

mirtlecn/post

Repository files navigation

Logo

Go version API server | CLI client | Skills for AI Agents

Post — Lightweight File, Text & URL Sharing API & Web UI

Web UI

Available at http://localhost:3000/admin. Password is SECRET_KEY or ADMIN_KEY if set. The composer supports optional meta fields for title and created. created can be submitted as date-only or date with time.

Web UI Screenshot

HTTP API

Suggested shell variables:

export POST_BASE_URL="https://example.com"
export POST_TOKEN="your-secret-key"

For details, see API documentation

CLI client

CLI client

Deploy

Vercel

Deploy with Vercel

Required:

  • LINKS_REDIS_URL : 'redis://...' or 'rediss://...' URL for Redis connection
  • SECRET_KEY : API token
  • ADMIN_KEY : Password for admin GUI login

Local

Prerequisites:

  • Node.js 24+
  • Redis (a valid Redis URL. Get a free one at https://redis.com/)
  • S3-compatible storage (Required for file uploads)
# Install dependencies
npm install

# Run the default local regression suite: unit + both local smoke suites
npm test

# Run only the quick unit suite
npm run test:quick

# Run only unit tests
npm run test:unit

# Run both local smoke suites without re-running unit tests
npm run test:smoke:local

# Run only the local admin/web smoke suite
npm run test:smoke:web:local

# Run only the local API smoke suite
npm run test:smoke:api:local

# Configure environment variables
cp .env.example .env.local

# Build admin UI and start local server (http://localhost:3000)
npm start

# Bump the package version
npm run version:bump -- patch
# or
npm run version:bump -- 1.4.0

# Create a release tag after the version bump commit
git tag -a v1.4.0 -m "v1.4.0"

# Visit admin UI at <http://localhost:3000/admin>

Env:

  • Required: LINKS_REDIS_URL, SECRET_KEY
  • Optional: ADMIN_KEY (only for /admin GUI login; if missing, GUI login falls back to SECRET_KEY)
  • LINKS_REDIS_URL should use:
    • rediss://... for TLS-enabled providers (recommended for Upstash and other managed Redis)
    • redis://... only for non-TLS Redis
  • If you see socket-closed errors when using redis://, switch to rediss://
  • Optional: MAX_CONTENT_SIZE_KB (default 500), MAX_FILE_SIZE_MB (default 10), S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET_NAME, S3_REGION, S3_FORCE_PATH_STYLE
  • S3_FORCE_PATH_STYLE defaults to true when S3_ENDPOINT is set. Set it to false only if your provider requires bucket subdomains instead of path-style requests.

Testing

  • npm test: default local regression chain. Runs test:quick, test:smoke:web:local, and test:smoke:api:local.
  • npm run test:all: compatibility alias for npm test.
  • npm run test:quick: runs only the unit test suite.
  • npm run test:smoke:local: runs the local admin/web smoke suite and the local API smoke suite.
  • npm run test:smoke:web:local: starts the local app with a dedicated Redis DB and exercises /admin, /api/admin, and the main JSON API with shell assertions.
  • npm run test:smoke:api:local: starts the local app with a dedicated Redis DB and runs the API-focused smoke suite in test/functional/smoke-api.sh.
  • npm run test:smoke:web:vercel: reserved for environments where vercel dev is available. It is not part of the default test chain.

Credits

MIT Licence

© Mirtle together with OpenAI Codex

About

Redis based lightweight file, text & URL sharing API. Vercel compatible

Topics

Resources

License

Stars

Watchers

Forks

Contributors