af46f87eed
Build Electron Desktop App / Validate version (push) Failing after 33s
Build Electron Desktop App / Build Electron (macos-arm64) (push) Has been skipped
Build Electron Desktop App / Build Electron (linux) (push) Has been skipped
Build Electron Desktop App / Build Electron (macos-intel) (push) Has been skipped
Build Electron Desktop App / Build Electron (windows) (push) Has been skipped
Build Electron Desktop App / Create Release (push) Has been skipped
Resolves root cause of #252 (Electron black screen) and #249 (OAuth fail) for users running with zero configuration (no .env needed). New: scripts/bootstrap-env.mjs - Auto-generates JWT_SECRET (64 bytes), STORAGE_ENCRYPTION_KEY (32 bytes), API_KEY_SECRET (32 bytes) if missing or empty - Persists to {DATA_DIR}/server.env — survives restarts, Docker volume remounts, and upgrades without changing secrets - Reads .env from CWD (user overrides), then merges process.env (highest prio) - Logs friendly warnings for missing optional OAuth secrets Updated: run-standalone.mjs + run-next.mjs - Call bootstrapEnv() before spawning server — covers npm + Docker paths Updated: electron/main.js (synchronous inline — CJS cannot await import ESM) - Reads userData/server.env, generates missing secrets with crypto.randomBytes() - Persists back to server.env, sets OMNIROUTE_BOOTSTRAPPED=true New: BootstrapBanner.tsx + page.tsx update - Dismissable amber banner on dashboard home when running in zero-config mode - Shows where server.env is located and how to customize secrets
19 lines
444 B
JavaScript
19 lines
444 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import {
|
|
resolveRuntimePorts,
|
|
withRuntimePortEnv,
|
|
spawnWithForwardedSignals,
|
|
} from "./runtime-env.mjs";
|
|
import { bootstrapEnv } from "./bootstrap-env.mjs";
|
|
|
|
const runtimePorts = resolveRuntimePorts();
|
|
|
|
// Auto-generate secrets on first run, merge .env + process.env
|
|
const env = bootstrapEnv();
|
|
|
|
spawnWithForwardedSignals("node", ["server.js"], {
|
|
stdio: "inherit",
|
|
env: withRuntimePortEnv(env, runtimePorts),
|
|
});
|