unoverse 0.1.38 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/operator/lib/db-setup.sh +6 -0
- package/operator/lib/init.sh +10 -0
- package/package.json +1 -1
package/operator/lib/db-setup.sh
CHANGED
|
@@ -34,11 +34,16 @@ cmd_db_setup() {
|
|
|
34
34
|
echo ""
|
|
35
35
|
echo " Running migrations (local dev)..."
|
|
36
36
|
|
|
37
|
+
# --no-check-order: databases from before the 2026-07-28 squash have
|
|
38
|
+
# 002-018 recorded in pgmigrations with no matching files (they live inside
|
|
39
|
+
# 001_baseline now), which trips the order check on ANY new migration.
|
|
40
|
+
# Ordering still holds by filename; applied names are never re-run.
|
|
37
41
|
NODE_TLS_REJECT_UNAUTHORIZED=0 DATABASE_URL="$db_url" \
|
|
38
42
|
npx node-pg-migrate up \
|
|
39
43
|
--migrations-dir "$ROOT/apps/unoverse/engine/migrations" \
|
|
40
44
|
--migration-file-language sql \
|
|
41
45
|
--no-lock \
|
|
46
|
+
--no-check-order \
|
|
42
47
|
2>&1 | sed 's/^/ /' || {
|
|
43
48
|
fail "Migrations failed"
|
|
44
49
|
exit 1
|
|
@@ -73,6 +78,7 @@ cmd_db_setup() {
|
|
|
73
78
|
--migrations-dir /app/apps/unoverse/engine/migrations \
|
|
74
79
|
--migration-file-language sql \
|
|
75
80
|
--no-lock \
|
|
81
|
+
--no-check-order \
|
|
76
82
|
2>&1 | sed 's/^/ /' || {
|
|
77
83
|
fail "Migrations failed"
|
|
78
84
|
exit 1
|
package/operator/lib/init.sh
CHANGED
|
@@ -350,6 +350,13 @@ cmd_init() {
|
|
|
350
350
|
read -p " SEARCHAPI_KEY (web-search nodes, blank to skip): " SEARCHAPI_KEY
|
|
351
351
|
fi
|
|
352
352
|
|
|
353
|
+
# A silent fact, not a question: the encryption key is GENERATED (a human never types
|
|
354
|
+
# one) and kept verbatim on re-runs — a new key orphans every stored credential.
|
|
355
|
+
CREDENTIAL_ENCRYPTION_KEY=$(_env_cur CREDENTIAL_ENCRYPTION_KEY)
|
|
356
|
+
if [ -z "$CREDENTIAL_ENCRYPTION_KEY" ]; then
|
|
357
|
+
CREDENTIAL_ENCRYPTION_KEY=$(openssl rand -hex 32 2>/dev/null || head -c32 /dev/urandom | xxd -p -c64)
|
|
358
|
+
ok "Credential encryption key generated"
|
|
359
|
+
fi
|
|
353
360
|
# Write .env
|
|
354
361
|
cat > "$ROOT/.env" << ENVEOF
|
|
355
362
|
# Generated by unoverse init
|
|
@@ -367,6 +374,9 @@ AUTH_CLIENT_ID=${AUTH_CLIENT_ID}
|
|
|
367
374
|
AUTH_AUDIENCE=${AUTH_AUDIENCE}
|
|
368
375
|
API_URL=${API_URL}
|
|
369
376
|
OPENAI_API_KEY=${OPENAI_API_KEY}
|
|
377
|
+
# Generated at setup: encrypts credentials stored by nodes. Losing it orphans them —
|
|
378
|
+
# back it up with the database. Kept on re-runs.
|
|
379
|
+
CREDENTIAL_ENCRYPTION_KEY=${CREDENTIAL_ENCRYPTION_KEY}
|
|
370
380
|
HYPERBROWSER_API_KEY=${HYPERBROWSER_API_KEY}
|
|
371
381
|
SEARCHAPI_KEY=${SEARCHAPI_KEY}
|
|
372
382
|
DOMAIN=
|
package/package.json
CHANGED