SPB Git

Repository Public

dev-stack.sh 1.0 KB 16 lines shellscript

1#!/bin/bash2# Local stack for development/e2e: throwaway signer keystore, local Postgres DB "spw_dev", http://localhost:8650.3set -euo pipefail4cd "$(dirname "$0")/.."5D=${SPW_DEV_DIR:-/tmp/spw-dev}; rm -rf "$D"; mkdir -p "$D"6export SPW_SIGNER_DIR="$D/signer" SPW_SIGNER_WRAP_KEY="$D/wrap/wrap.key" SPW_SIGNER_SECRET=$(openssl rand -hex 32)7export SPW_ORIGIN=http://localhost:8650 SPW_RP_ID=localhost SPW_SIGNER_PORT=86518node dist/signer.mjs init > "$D/init.json"9node dist/signer.mjs setup-token > "$D/setup-token"10node dist/signer.mjs serve > "$D/signer.log" 2>&1 & echo $! > "$D/signer.pid"11psql -q -d spw_dev -c 'drop schema public cascade; create schema public;' >/dev/null12DATABASE_URL=postgres:///spw_dev SPW_SIGNER_URL=http://127.0.0.1:8651 SPW_WEB_DIR=$PWD/dist/web PORT=8650 SPW_BROADCAST=${SPW_BROADCAST:-off} \13  node dist/api.mjs > "$D/api.log" 2>&1 & echo $! > "$D/api.pid"14for i in $(seq 1 40); do curl -sf http://localhost:8650/api/v1/health/live >/dev/null && break; sleep 0.25; done15echo "stack up: http://localhost:8650  (setup token in $D/setup-token)"16
Files main
Menu

Theme