mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
msb caches images by reference and pull without --force never contacts the registry, while attestation compares the reference string. A floating tag therefore keeps a stale guest image forever and still passes attestation. Pinning the default to the published index digest makes IfMissing pull the new image and forces the running microVM to be recreated on deploy.
98 lines
2.0 KiB
TypeScript
98 lines
2.0 KiB
TypeScript
export const DEFAULTS = {
|
|
SERVER: {
|
|
PORT: 5003,
|
|
HOST: '0.0.0.0',
|
|
CORS_ORIGIN: 'http://localhost:5173',
|
|
},
|
|
|
|
FRONTEND: {
|
|
PORT: 5173,
|
|
HOST: '0.0.0.0',
|
|
},
|
|
|
|
OPENCODE: {
|
|
PORT: 5551,
|
|
HOST: '127.0.0.1',
|
|
PUBLIC_URL: '', // Optional: public URL for OAuth callbacks (e.g., https://mydomain.com)
|
|
HEALTH_WATCH_ENABLED: true,
|
|
HEALTH_POLL_MS: 30000,
|
|
HEALTH_FAILURE_THRESHOLD: 2,
|
|
},
|
|
|
|
DATABASE: {
|
|
PATH: './data/opencode.db',
|
|
},
|
|
|
|
WORKSPACE: {
|
|
BASE_PATH: './workspace',
|
|
REPOS_DIR: 'repos',
|
|
SCHEDULE_WORKTREES_DIR: 'schedule-worktrees',
|
|
CONFIG_DIR: '.config/opencode',
|
|
AUTH_FILE: '.opencode/state/opencode/auth.json',
|
|
},
|
|
|
|
SANDBOX: {
|
|
MSB_PATH: 'msb',
|
|
IMAGE: 'docker.io/cstechdev/ocm-sandbox@sha256:74a9f12e1c1768e36bc159c4c7efb70ab9c47da5f46f93763ddb282dd58ad79c',
|
|
MEMORY: '4G',
|
|
CPUS: 2,
|
|
EXEC_USER: 'node',
|
|
NET: 'public',
|
|
START_TIMEOUT_MS: 300000,
|
|
EXEC_TIMEOUT_MS: 600000,
|
|
},
|
|
|
|
TIMEOUTS: {
|
|
PROCESS_START_WAIT_MS: 2000,
|
|
PROCESS_VERIFY_WAIT_MS: 1000,
|
|
HEALTH_CHECK_TIMEOUT_MS: 30000,
|
|
},
|
|
|
|
FILE_LIMITS: {
|
|
MAX_SIZE_MB: 50,
|
|
MAX_UPLOAD_SIZE_MB: 50,
|
|
},
|
|
|
|
LOGGING: {
|
|
DEBUG: false,
|
|
LOG_LEVEL: 'info',
|
|
},
|
|
|
|
SSE: {
|
|
RECONNECT_DELAY_MS: 1000,
|
|
MAX_RECONNECT_DELAY_MS: 30000,
|
|
CONNECT_TIMEOUT_MS: 10000,
|
|
IDLE_GRACE_PERIOD_MS: 5000,
|
|
HEARTBEAT_INTERVAL_MS: 30000,
|
|
STALL_THRESHOLD_MS: 90000,
|
|
WATCHDOG_TICK_MS: 15000,
|
|
},
|
|
} as const
|
|
|
|
export const ALLOWED_MIME_TYPES = [
|
|
'text/plain',
|
|
'text/html',
|
|
'text/css',
|
|
'text/javascript',
|
|
'text/typescript',
|
|
'application/json',
|
|
'application/xml',
|
|
'image/png',
|
|
'image/jpeg',
|
|
'image/gif',
|
|
'image/svg+xml',
|
|
'application/pdf',
|
|
'application/zip',
|
|
'text/markdown',
|
|
] as const
|
|
|
|
export const GIT_PROVIDERS = {
|
|
GITHUB: 'github.com',
|
|
GITLAB: 'gitlab.com',
|
|
BITBUCKET: 'bitbucket.org',
|
|
} as const
|
|
|
|
export type Config = typeof DEFAULTS
|
|
export type AllowedMimeType = (typeof ALLOWED_MIME_TYPES)[number]
|
|
export type GitProvider = (typeof GIT_PROVIDERS)[keyof typeof GIT_PROVIDERS]
|