WebSocket-based chat server with end-to-end encryption, SSH key authentication, and PostgreSQL storage.
- Node.js 20+
- PostgreSQL 15+
- npm
npm install
cp .env.example .env
# Edit .env with your configuration
npx prisma generate
npx prisma migrate deploy
npm run build
npm startNODE_ENV=production
PORT=8081
HOST=127.0.0.1
JWT_SECRET=your-secret-here
DATABASE_URL=postgresql://user:pass@localhost:5432/eurusRegister user with SSH public key:
# Using the CLI directly
node dist/cli/register.js --username alice --key-file ~/.ssh/id_ed25519.pub --server https://eurus.sreus.tech- GET /health - Health check
- POST /api/auth/register - Register user with SSH key
- POST /api/auth/challenge - Get authentication challenge
- POST /api/auth/verify - Verify SSH signature
- WS /ws - WebSocket connection (token in query param)
Client to Server messages: createRoom, joinRoom, sendMessage, listRooms, leaveRoom
Server to Client messages: roomCreated, roomJoined, message, roomsList, error, info
See deployment/ directory for nginx, systemd, and logrotate configurations.
MIT