mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
feat(servers): harden pairing and run linked-server sessions in the UI
Replace the plaintext pairing exchange with a nonce and HMAC proof plus AES-256-GCM encrypted credentials, bumping links to v2. Track session ownership per linked server so activity, session picker, transcript, MCP and skills views work against remote servers. Share encrypted secret access, event routing and URL helpers across backend, shared and CLI.
This commit is contained in:
1 parent
c591c15743
commit
f566556fd6
77 files changed
+3170
-702
No files matched your search
@@ -4,8 +4,10 @@ import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { z } from 'zod'
|
||||
import { AlertTriangle, CheckCircle2, Loader2, ScanLine, XCircle } from 'lucide-react'
|
||||
import {
|
||||
OPENCODE_SERVER_DEFAULT_USERNAME,
|
||||
OPENCODE_SERVER_LINK_VERSION,
|
||||
OPENCODE_SERVER_USERNAME,
|
||||
parseOpenCodeServerLink,
|
||||
readOpenCodeServerLinkVersion,
|
||||
type OpenCodeServer,
|
||||
type OpenCodeServerLink,
|
||||
type OpenCodeServerTestResult,
|
||||
@@ -110,7 +112,7 @@ function buildDefaultValues(server?: OpenCodeServer | null): ServerFormValues {
|
||||
return {
|
||||
name: server?.name ?? '',
|
||||
baseUrl: server?.baseUrl ?? '',
|
||||
username: server?.username ?? OPENCODE_SERVER_DEFAULT_USERNAME,
|
||||
username: server?.username ?? OPENCODE_SERVER_USERNAME,
|
||||
password: '',
|
||||
enabled: server?.enabled ?? true,
|
||||
}
|
||||
@@ -177,7 +179,10 @@ export function OpenCodeServerDialog({
|
||||
const applyPairingLink = (text: string) => {
|
||||
const link = parseOpenCodeServerLink(text)
|
||||
if (!link) {
|
||||
setLinkError('That is not a valid OpenCode pairing link.')
|
||||
const version = readOpenCodeServerLinkVersion(text)
|
||||
setLinkError(version !== null && version !== OPENCODE_SERVER_LINK_VERSION
|
||||
? `This pairing link uses link version ${version}, but this Manager expects version ${OPENCODE_SERVER_LINK_VERSION}. Update the Manager or the ocm CLI and generate a new QR code.`
|
||||
: 'That is not a valid OpenCode pairing link.')
|
||||
return
|
||||
}
|
||||
setPairingLink(link)
|
||||
@@ -264,7 +269,7 @@ export function OpenCodeServerDialog({
|
||||
setLinkInput(event.target.value)
|
||||
setLinkError(null)
|
||||
}}
|
||||
placeholder="ocm://link?v=1&kind=opencode&..."
|
||||
placeholder={`ocm://link?v=${OPENCODE_SERVER_LINK_VERSION}&kind=opencode&...`}
|
||||
rows={2}
|
||||
className="font-mono"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user