ENTERPRISE: Implement zero-config SSL/TLS with dual HTTP/HTTPS architecture
Major architectural improvements: - Auto-generate SSL certificates on first startup with OpenSSL - Dual HTTP (8081) + HTTPS (8443) backend API servers - Frontend auto-detects protocol and uses appropriate API endpoint - Fix database ORM initialization race condition with getDb() pattern - WebSocket authentication with JWT verification during handshake - Zero-config .env file generation for production deployment - Docker and nginx configurations for container deployment Technical fixes: - Eliminate module initialization race conditions in database access - Replace direct db imports with safer getDb() function calls - Automatic HTTPS frontend development server (npm run dev:https) - SSL certificate generation with termix.crt/termix.key - Cross-platform environment variable support with cross-env This enables seamless HTTP→HTTPS upgrade with zero manual configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -222,7 +222,7 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
||||
}
|
||||
|
||||
const baseWsUrl = isDev
|
||||
? "ws://localhost:8082"
|
||||
? `${window.location.protocol === "https:" ? "wss" : "ws"}://localhost:8082`
|
||||
: isElectron()
|
||||
? (() => {
|
||||
const baseUrl =
|
||||
|
||||
@@ -261,7 +261,7 @@ export const Terminal = forwardRef<any, SSHTerminalProps>(function SSHTerminal(
|
||||
}
|
||||
|
||||
const baseWsUrl = isDev
|
||||
? "ws://localhost:8082"
|
||||
? `${window.location.protocol === "https:" ? "wss" : "ws"}://localhost:8082`
|
||||
: isElectron()
|
||||
? (() => {
|
||||
const baseUrl =
|
||||
|
||||
@@ -376,7 +376,10 @@ if (isElectron()) {
|
||||
|
||||
function getApiUrl(path: string, defaultPort: number): string {
|
||||
if (isDev()) {
|
||||
return `http://${apiHost}:${defaultPort}${path}`;
|
||||
// Auto-detect HTTPS in development
|
||||
const protocol = window.location.protocol === "https:" ? "https" : "http";
|
||||
const sslPort = protocol === "https" ? 8443 : defaultPort;
|
||||
return `${protocol}://${apiHost}:${sslPort}${path}`;
|
||||
} else if (isElectron()) {
|
||||
if (configuredServerUrl) {
|
||||
const baseUrl = configuredServerUrl.replace(/\/$/, "");
|
||||
|
||||
Reference in New Issue
Block a user