feat: log BACKEND_URL at frontend startup and include target URL in proxy errors

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/131238a2-437c-4a85-b98b-fcb3d80e69e0
This commit is contained in:
copilot-swe-agent[bot]
2026-03-24 01:51:50 +00:00
parent 2cd0b0c6a7
commit 88b7afb195
4 changed files with 7 additions and 1 deletions
+1
View File
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `sqlalchemy` from `2.0.25` to `2.0.48` to fix `AssertionError: Class ... directly inherits TypingOnly but has additional attributes` on Python 3.14 (`__static_attributes__`, `__firstlineno__`) - Upgraded `sqlalchemy` from `2.0.25` to `2.0.48` to fix `AssertionError: Class ... directly inherits TypingOnly but has additional attributes` on Python 3.14 (`__static_attributes__`, `__firstlineno__`)
### Added ### Added
- **Backend URL logged at startup**: The Next.js server now logs the resolved `BACKEND_URL` (e.g. `[proxy] BACKEND_URL = http://backend:8000`) via `src/instrumentation.ts` when the server starts, making it easy to diagnose `ECONNREFUSED` proxy errors. The per-request error log now also includes the full target URL.
- **Dual-registry Docker deployment**: CI now builds separate backend and frontend images and pushes to both GHCR (`ghcr.io`) and private registry (`registry.cklnet.com`) using a matrix strategy - **Dual-registry Docker deployment**: CI now builds separate backend and frontend images and pushes to both GHCR (`ghcr.io`) and private registry (`registry.cklnet.com`) using a matrix strategy
- **Database-backed configuration**: `AppSetting` model and `ConfigService` for hybrid config (DB-first, env-var fallback) - **Database-backed configuration**: `AppSetting` model and `ConfigService` for hybrid config (DB-first, env-var fallback)
- Admin API endpoints for managing settings (`GET/PUT/DELETE /api/v1/settings`) - Admin API endpoints for managing settings (`GET/PUT/DELETE /api/v1/settings`)
+1
View File
@@ -99,6 +99,7 @@ Comprehensive task breakdown for repository improvements and production readines
- [x] Upgrade SQLAlchemy to 2.0.48 to fix Python 3.14 test failures - [x] Upgrade SQLAlchemy to 2.0.48 to fix Python 3.14 test failures
- [x] Fix Docker build failure: wrap `useSearchParams()` in Suspense boundary in `/auth/callback` page - [x] Fix Docker build failure: wrap `useSearchParams()` in Suspense boundary in `/auth/callback` page
- [x] Fix frontend API URL hardcoded to `localhost:8000` in production: replaced build-time `NEXT_PUBLIC_API_URL` with a runtime Next.js Route Handler proxy (`/api/v1/[...path]`) reading `BACKEND_URL` at server startup - [x] Fix frontend API URL hardcoded to `localhost:8000` in production: replaced build-time `NEXT_PUBLIC_API_URL` with a runtime Next.js Route Handler proxy (`/api/v1/[...path]`) reading `BACKEND_URL` at server startup
- [x] Log `BACKEND_URL` at frontend server startup and include target URL in per-request proxy error messages
### In Progress 🔨 ### In Progress 🔨
- [ ] Configure branch protection rules - [ ] Configure branch protection rules
+1 -1
View File
@@ -29,7 +29,7 @@ async function handler(request: NextRequest, context: RouteContext) {
headers: upstream.headers, headers: upstream.headers,
}); });
} catch (error) { } catch (error) {
console.error("Proxy error forwarding to backend:", error); console.error(`Proxy error forwarding to backend (target: ${targetUrl}):`, error);
return NextResponse.json({ detail: "Backend unavailable" }, { status: 502 }); return NextResponse.json({ detail: "Backend unavailable" }, { status: 502 });
} }
} }
+4
View File
@@ -0,0 +1,4 @@
export async function register() {
const backendUrl = process.env.BACKEND_URL ?? "http://localhost:8000";
console.log(`[proxy] BACKEND_URL = ${backendUrl}`);
}