A simple npm-compatible package registry built with Astro, Effect-TS, Drizzle ORM and AWS S3 for storage. Built to support private package management and distribution.
Note
Crude Registry is designed for managing and published scoped packages only!
Important
Crude Registry is still in early development and should not be used in production yet. Use at your own risk.
- Token-based authentication for uploads and downloads
- S3 storage for package tarballs
- SQLite/libsql database for metadata
- Built with Astro and Effect
- Full web-ui for users and admins
- npm CLI compatible
- Remote connection to external auth server for per-package/group licensing
- Dockerfile for quick production setup
- publish
- unpublish
- info
- audit
- install
- deprecate
- ping
- dist-tag
- login
- logout
- whoami
- Install dependencies:
pnpm install- Copy
.env.demoto.envand configure:
cp ./package/.env.demo ./package/.env- Generate and run database migrations:
pnpm run generate
pnpm run migrateSave the token output - you'll need it to publish and download packages.
- Start the server:
pnpm run dev- Create the initial Super Admin
Open the web-ui at http://localhost:4321 and signup to create the initial Super Admin user.
GET /api/docs- Scalar API docs
GET /api/health- Health Check status endpoint
GET /api/stats/downloads- Lookup download stats (optionally bypackageand/ortokenquery param) (requires auth)
PUT /:package- Publish a package (requires auth)GET /:package- Get package metadata (requires auth)GET /:package/-/:filename- Download package tarball (requires auth)
curl http://localhost:4321/@your-org/your-packagecurl http://localhost:4321/@your-org/your-package/-/your-package-1.0.0.tgz \
-H "Authorization: Bearer YOUR_TOKEN"Configure registry for your scope:
# Private registry for your packages
npm config set @your-org:registry http://localhost:4321
npm config set //localhost:4321/:_authToken YOUR_TOKENnpm publishnpm install @your-org/your-packageSee .env.example for all available configuration options.
- Always use HTTPS in production - Set up a reverse proxy (nginx, Caddy) with SSL
- Rotate tokens regularly - Create new tokens and revoke old ones
- Limit S3 bucket access - Use IAM policies to restrict access
- Monitor downloads - Check the
downloadstable for unusual activity - Backup your database - Regular backups of the SQLite database
- Use strong tokens - The generated tokens are cryptographically secure
- Crude Registry can only handle Scoped packages
- Ensure your auth token is correctly configured
- Check that the token hasn't been revoked
- Verify S3 credentials are correct
- Downloads require authentication
- Ensure Authorization header is present
- Check that the package version exists
- Run migrations:
npm run db:migrate - Check DATABASE_URL is correct
- Ensure write permissions for SQLite file
- Verify AWS credentials
- Check bucket exists and has correct permissions
- For MinIO/S3-compatible: set S3_ENDPOINT
