diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad719d..933e035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.9] - 2026-04-20 + +### Fixed + +- **Open Terminal API Key Persistence.** The Open Terminal API key is now saved in config.json and reused across restarts instead of being regenerated on every startup, which was breaking existing integrations. + ## [0.0.8] - 2026-04-11 ### Added diff --git a/package.json b/package.json index f16de65..385e703 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.0.8", + "version": "0.0.9", "license": "AGPL-3.0", "description": "Open WebUI Desktop", "main": "./out/main/index.js", diff --git a/src/main/utils/index.ts b/src/main/utils/index.ts index 511fc8d..86fd436 100644 --- a/src/main/utils/index.ts +++ b/src/main/utils/index.ts @@ -817,6 +817,7 @@ export interface AppConfig { enabled: boolean port: number cwd: string + apiKey: string } llamaCpp: { enabled: boolean @@ -850,7 +851,8 @@ const DEFAULT_CONFIG: AppConfig = { }, openTerminal: { enabled: false, - cwd: '' + cwd: '', + apiKey: '' }, llamaCpp: { enabled: false, diff --git a/src/main/utils/open-terminal.ts b/src/main/utils/open-terminal.ts index 69f0232..6156832 100644 --- a/src/main/utils/open-terminal.ts +++ b/src/main/utils/open-terminal.ts @@ -6,6 +6,7 @@ import * as pty from 'node-pty' import { getPythonPath, getConfig, + setConfig, installPackage, isPackageInstalled, isPythonInstalled, @@ -63,8 +64,14 @@ export const startOpenTerminal = async ( const config = await getConfig() const configEnvVars = config.envVars ?? {} - // Auto-generate API key - const generatedKey = crypto.randomBytes(24).toString('base64url') + // Use persisted API key or generate and save a new one + let generatedKey = config.openTerminal?.apiKey + if (!generatedKey) { + generatedKey = crypto.randomBytes(24).toString('base64url') + await setConfig({ + openTerminal: { ...config.openTerminal, apiKey: generatedKey } + }) + } // Find available port let desiredPort = port || 39284