From 3f51ed5f0fa11bdc0ff33345a6e6ab8c8c789cb5 Mon Sep 17 00:00:00 2001 From: -Puter <22245429+puterhimself@users.noreply.github.com> Date: Mon, 1 Jun 2026 18:03:18 +0530 Subject: [PATCH] updates source code (src) (3 files) --- src/config.ts | 2 +- src/docker/manager.ts | 5 ++++- src/index.ts | 11 ++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/config.ts b/src/config.ts index 3481847..c96e0fb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -66,7 +66,7 @@ export const config = { // ── Shared OpenCode runtime image (built once, changes.md §3) ── opencodeImage: - process.env.OPENCODE_IMAGE ?? "ghcr.io/anomalyco/opencode:latest", + process.env.OPENCODE_IMAGE ?? "growqr/opencode:dev", // Version tracking for rollout (changes.md §9) opencodeImageVersion: process.env.OPENCODE_IMAGE_VERSION ?? "1.0.0", migrationVersion: process.env.MIGRATION_VERSION ?? "1", diff --git a/src/docker/manager.ts b/src/docker/manager.ts index 8734a52..d8ec47a 100644 --- a/src/docker/manager.ts +++ b/src/docker/manager.ts @@ -261,12 +261,15 @@ async function startOpencodeContainer(opts: { const container = await docker.createContainer({ name, Image: config.opencodeImage, - Cmd: ["serve", "--port", "4096", "--hostname", "0.0.0.0"], + Cmd: ["opencode", "serve", "--port", "4096", "--hostname", "0.0.0.0"], Env: [ `OPENCODE_SERVER_PASSWORD=${opts.password}`, `OPENCODE_WORKSPACE=/workspace`, `GROWQR_IMAGE_VERSION=${config.opencodeImageVersion}`, `GROWQR_PROMPT_VERSION=${config.promptVersion}`, + `GROWQR_MIGRATION_VERSION=${config.migrationVersion}`, + `GROWQR_USER_ID=${opts.userId}`, + `GROWQR_GITEA_URL=${config.giteaUrl}`, ], WorkingDir: "/workspace", HostConfig: { diff --git a/src/index.ts b/src/index.ts index 1f0394e..3be6ad7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -78,15 +78,16 @@ async function main() { app.route("/git", gitRoutes()); app.route("/api/chat", chatRoutes()); - if (process.env.RIVET_RUN_ENGINE === "1") { + if (process.env.RIVET_ENDPOINT) { // Self-hosted: embedded engine runs at localhost:6420. // Proxy frontend Rivet traffic to the engine instead of using registry.handler() // (handler conflicts with startRunner — they're mutually exclusive). - delete process.env.RIVET_ENDPOINT; app.all("/api/rivet/*", async (c) => { const url = new URL(c.req.url); - url.hostname = "127.0.0.1"; - url.port = "6420"; + const target = new URL(config.rivetEndpoint); + url.protocol = target.protocol; + url.hostname = target.hostname; + url.port = target.port; url.pathname = url.pathname.replace("/api/rivet", ""); // Forward headers, stripping hop-by-hop ones @@ -96,7 +97,7 @@ async function main() { if (k.toLowerCase() === "transfer-encoding") continue; fwdHeaders.set(k, v); } - fwdHeaders.set("Host", "127.0.0.1:6420"); + fwdHeaders.set("Host", target.host); // For POST/PUT/PATCH, clone the body stream (Hono may have consumed it) const method = c.req.method.toUpperCase();