mirror of
https://github.com/temetro/temetro.git
synced 2026-07-26 11:58:14 +00:00
01dbc07e92
The default http://localhost:8080 silently failed for clinics that joined the network without setting RELAY_URL — inside Docker localhost is the container itself, so the hub connection never reached the relay (endless "relay unreachable" retries) and pairing QRs encoded an unreachable localhost. Default to https://network.temetro.com so "Join Temetro Network" works out of the box; self-hosters running their own relay still override it. Also (re)ensure the hub is connected before pre-registering a pairing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
62 lines
3.0 KiB
Bash
62 lines
3.0 KiB
Bash
# --- Database -------------------------------------------------------------
|
|
# When running via docker compose, "db" is the Postgres service hostname.
|
|
# For running the backend directly on your host, use localhost:5432.
|
|
DATABASE_URL=postgres://temetro:temetro@db:5432/temetro
|
|
|
|
# --- Better Auth ----------------------------------------------------------
|
|
# Generate a strong secret (min 32 chars): openssl rand -base64 32
|
|
BETTER_AUTH_SECRET=replace-me-with-openssl-rand-base64-32
|
|
# Public base URL of THIS backend (used for auth callbacks & cookies).
|
|
BETTER_AUTH_URL=http://localhost:4000
|
|
|
|
# Directory for uploaded patient/lab files. Defaults to ./uploads in local dev;
|
|
# in Docker it's a persistent volume (see docker-compose.yml).
|
|
UPLOAD_DIR=./uploads
|
|
|
|
# --- AI ------------------------------------------------------------------
|
|
# Key used to encrypt at-rest AI provider API keys (per-user, set in the app's
|
|
# Settings → AI). Generate one: openssl rand -base64 32. Rotating it forces
|
|
# users to re-enter their provider keys.
|
|
AI_CREDENTIALS_KEY=replace-me-with-openssl-rand-base64-32
|
|
|
|
# --- App ------------------------------------------------------------------
|
|
# The frontend origin — used for CORS, Better Auth trustedOrigins, and the
|
|
# links embedded in verification / reset / invitation emails.
|
|
FRONTEND_URL=http://localhost:3000
|
|
PORT=4000
|
|
NODE_ENV=development
|
|
|
|
# Host ports docker compose publishes. Change any that are already in use on
|
|
# this machine (the services still talk to each other on their internal ports).
|
|
POSTGRES_PORT=5432
|
|
BACKEND_PORT=4000
|
|
FRONTEND_PORT=3000
|
|
|
|
# --- Temetro Network relay ------------------------------------------------
|
|
# The standalone relay (github.com/temetro/temetro-network) that connects this
|
|
# backend to patient phones. Deploy it (e.g. on Railway) and point both this
|
|
# backend and the wallet app at it. RELAY_URL is the relay's public URL (also
|
|
# baked into the QR a patient scans). This clinic authenticates to the relay's
|
|
# /hub with its own Ed25519 signing key, so no shared secret is needed.
|
|
# RELAY_TOKEN is OPTIONAL/LEGACY — set it only for a private relay that also
|
|
# gates on a shared token (then use the SAME value here and on the relay).
|
|
# Defaults to the hosted relay (https://network.temetro.com) when unset, so
|
|
# "Join Temetro Network" works out of the box; set RELAY_URL only to point at
|
|
# your own relay. Do NOT use http://localhost — inside Docker that's the
|
|
# container itself and the relay connection will silently fail.
|
|
RELAY_URL=https://network.temetro.com
|
|
RELAY_TOKEN=
|
|
|
|
# (Legacy, pre-relay self-hosting.) A phone-reachable URL for the QR when NOT
|
|
# using the Temetro Network relay. RELAY_URL takes precedence over this.
|
|
# PUBLIC_RELAY_URL=http://192.168.1.20:4000
|
|
|
|
# --- Email (optional) -----------------------------------------------------
|
|
# If SMTP_HOST is unset, emails (verify/reset/invite) are printed to the
|
|
# server console instead of being sent — zero setup for local development.
|
|
# SMTP_HOST=smtp.example.com
|
|
# SMTP_PORT=587
|
|
# SMTP_USER=
|
|
# SMTP_PASS=
|
|
# SMTP_FROM="temetro <no-reply@temetro.local>"
|