mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
refactor(opencode): consolidate v2 migration helpers and harden install, proxy, and session flows
- extract shared semver and model-ref utilities, reuse across version checks - share the OpenCode release download script across Docker, entrypoint, dev setup - unify install/upgrade failure recovery and guard externally managed OPENCODE_BIN - scope the repo proxy location rewrite and surface ocm proxy errors - rework frontend session projection, permission lookup, and cache invalidation
This commit is contained in:
1 parent
f5d0f0c27e
commit
5593163099
115 files changed
+3027
-1204
No files matched your search
@@ -7,7 +7,7 @@ import { randomBytes } from 'crypto'
|
||||
import os from 'os'
|
||||
import path from 'path'
|
||||
import { buildOpenCodeBasicAuth, isSupportedOpenCodeVersion } from '@opencode-manager/shared/opencode'
|
||||
import { OPENCODE_SERVICE_SERVE_ARGS, prepareOpenCodeServiceLaunch } from '../../src/services/opencode-service-mode'
|
||||
import { OPENCODE_SERVICE_SERVE_ARGS, getOpenCodeServiceRegistrationPath, writeOpenCodeServiceSettings } from '../../src/services/opencode-service-mode'
|
||||
|
||||
const VERSION_TIMEOUT_MS = 5000
|
||||
const SERVE_READY_TIMEOUT_MS = 60000
|
||||
@@ -169,7 +169,8 @@ export async function startOpenCodeServe(options: OpenCodeServeOptions = {}): Pr
|
||||
OPENCODE_SERVER_PASSWORD: password,
|
||||
}
|
||||
if (options.service) {
|
||||
await prepareOpenCodeServiceLaunch({ XDG_CONFIG_HOME: directories.configHome, XDG_STATE_HOME: directories.stateHome, OPENCODE_CONFIG_DIR: env.OPENCODE_CONFIG_DIR }, password)
|
||||
await rm(getOpenCodeServiceRegistrationPath({ XDG_CONFIG_HOME: directories.configHome, XDG_STATE_HOME: directories.stateHome }), { force: true })
|
||||
await writeOpenCodeServiceSettings(path.join(directories.configHome, 'opencode'), password)
|
||||
}
|
||||
|
||||
const port = options.port ?? await getFreePort()
|
||||
|
||||
Reference in new issue
Block a user