Skip to content

Repository files navigation

Oshrin

License: MITDocker Hub

Open-source, self-hosted secrets management for developers.

Stack: ts-rest | Express | React | PostgreSQL | Drizzle ORM | pnpm workspace

Quick Start

git clone https://github.com/idrsdev/oshrin.git
cd oshrin
cat > .env <<EOFJWT_SECRET=$(openssl rand -base64 32)JWT_REFRESH_SECRET=$(openssl rand -base64 32)ENCRYPTION_KEY=$(openssl rand -base64 32)POSTGRES_PASSWORD=$(openssl rand -base64 16)CORS_ORIGIN=http://localhostVITE_API_URL=http://localhost:3000VITE_AUTH_STRATEGY=HEADER_BASEDEOF
docker compose up -d

Open http://localhost

Development

pnpm setup # install deps + copy .env files
pnpm dev:db # start postgres
pnpm db:push # create tables
pnpm dev # start all (shared + api + web)

Commands

pnpm dev # all services
pnpm dev:api # API only
pnpm dev:web # web only
pnpm build # build all
pnpm type-check # TypeScript validation
pnpm lint # lint API# Database
pnpm db:push # sync schema to local DB (dev only)
pnpm db:generate # generate migration from schema changes
pnpm db:studio # open Drizzle Studio

Structure

oshrin/
├── api/ # Express + ts-rest
├── shared/ # Shared types/contracts
├── web/ # React frontend
└── pnpm-workspace.yaml

Environment Variables

Required:

VariableDescription
JWT_SECRETAccess token signing key (32+ chars)
JWT_REFRESH_SECRETRefresh token signing key (32+ chars)
ENCRYPTION_KEYMaster encryption key (backup this — loss = permanent data loss)
POSTGRES_PASSWORDDatabase password

Optional:

VariableDefaultDescription
CORS_ORIGINhttp://localhostAllowed CORS origin
AUTH_STRATEGYCOOKIE_BASEDHEADER_BASED or COOKIE_BASED
VITE_AUTH_STRATEGYHEADER_BASEDMust match AUTH_STRATEGY
VITE_API_URLhttp://localhost:3000API URL for the frontend
APP_URLhttp://localhost:8080Used in email links

See api/.env.example for the full list including rate limits, timeouts, cookie settings, and resource limits.

Production

Critical:

  • Use HTTPS
  • Set CORS_ORIGIN to your domain
  • Match AUTH_STRATEGY and VITE_AUTH_STRATEGY
  • Use COOKIE_BASED auth with COOKIE_SECURE=true
  • Backup ENCRYPTION_KEY

Docker Images

ImageDescription
idrsdev/oshrin:api-latestAPI server
idrsdev/oshrin:web-latestWeb UI
# Build locally
docker build -t idrsdev/oshrin:api-latest -f api/Dockerfile .
docker build -t idrsdev/oshrin:web-latest -f web/Dockerfile .

Or use the GitHub Actions workflow (Actions → Build and Publish Docker Images → Run workflow).

API Documentation

Development only (disabled in production):

Docs

  • Architecture — system design, data model, auth, encryption
  • Database — Drizzle ORM workflow and migrations
  • Security — encryption details, limitations, vulnerability reporting
  • Privacy — data collection and storage
  • Terms — terms of service

License

MIT — Created by Malik Idrees (@idrsdev) • LinkedIn

About

Secret management tool

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages