Files
shared/packages/node-backend
Gabriel20xxandClaude Sonnet 5 449bb6fd6a Auto-detect scheme for AUTHGUARD_URL instead of always assuming https
A bare host:port (e.g. a LAN AuthGuard reachable only over plain HTTP)
was always defaulting to https, so a TLS handshake against a plain-HTTP
AuthGuard failed at the transport level. Now a loopback, RFC1918/RFC4193
private, or link-local host (or a .local name) defaults to http instead;
an explicit http:// or https:// is still always honored as-is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 21:46:53 +02:00
..
2026-08-06 16:55:51 +02:00

@gabriel20xx/node-backend

Shared Node.js backend infrastructure for services that use PostgreSQL:

  • validated DATABASE_URL and pool settings;
  • one pool owner with startup retry, transient query retry, transactions, and shutdown;
  • PBKDF2 password hashing and secure session-token helpers;
  • short-lived, one-time admin reset codes printed to the server console;
  • common account/session persistence;
  • transaction-locked ordered migrations.

The package does not depend on Express. Each service keeps its own routes, cookies, roles, validation policy, and domain repositories. Existing MediaShared code can be migrated into this package incrementally; keep the legacy package as a compatibility layer until every consumer has moved.

Pass a service-specific tableName to runMigrations when multiple services share one PostgreSQL database, so their migration histories cannot collide.

Run npm test from this package or npm run test --workspace=@gabriel20xx/node-backend from shared.