fix(gateway): use GitHub URL for OpenClaw submodule and add token auth

- Change submodule URL from local path to https://github.com/openclaw/openclaw.git
- Checkout stable version v2026.2.3
- Add auto-generated gateway token (clawx-xxx) stored in electron-store
- Pass token via --token argument and OPENCLAW_GATEWAY_TOKEN env var
- Include token in WebSocket URL for authentication
- Add --dev and --allow-unconfigured flags for first-time setup
This commit is contained in:
Haze
2026-02-06 00:50:19 +08:00
Unverified
parent 29ee21754a
commit af76b28286
6 changed files with 158 additions and 41 deletions

View File

@@ -3,9 +3,18 @@
* Electron-store wrapper for application settings
*/
import { randomBytes } from 'crypto';
// Lazy-load electron-store (ESM module)
let settingsStoreInstance: any = null;
/**
* Generate a random token for gateway authentication
*/
function generateToken(): string {
return `clawx-${randomBytes(16).toString('hex')}`;
}
/**
* Application settings schema
*/
@@ -19,6 +28,7 @@ export interface AppSettings {
// Gateway
gatewayAutoStart: boolean;
gatewayPort: number;
gatewayToken: string;
// Update
updateChannel: 'stable' | 'beta' | 'dev';
@@ -49,6 +59,7 @@ const defaults: AppSettings = {
// Gateway
gatewayAutoStart: true,
gatewayPort: 18789,
gatewayToken: generateToken(),
// Update
updateChannel: 'stable',