fix: restore /public/ console in 2.0.0 (regression from 1.15.2)#1662
Open
stochastic-sisyphus wants to merge 1 commit into
Open
fix: restore /public/ console in 2.0.0 (regression from 1.15.2)#1662stochastic-sisyphus wants to merge 1 commit into
stochastic-sisyphus wants to merge 1 commit into
Conversation
v1.15.2 shipped a self-contained ~75 KB HTML console at
build/public/index.html, served by the gateway at /public/.
2.0.0 silently dropped it in three places:
1. src/public/index.html — deleted from source
2. src/start-server.ts — /public/ route handlers removed
3. rollup.config.js — rollup-plugin-copy step removed
Linux Docker builds of 2.0.0 therefore produce an image with no
gateway console, regressing the OSS deployment story vs 1.15.2.
Restore by:
- Re-adding src/public/index.html (copied verbatim from v1.15.2)
- Re-adding the three app.get('/public[/logs]'...) handlers in
src/start-server.ts
- Adding `cp -r src/public build/public` to the Dockerfile build
step (avoids reintroducing the rollup-plugin-copy devDep —
smaller change than restoring the rollup plugin)
Verified: rebuilt image, /public/ returns 200 with the 75 KB
console (Content-Type: text/html, <title>Portkey AI Gateway</title>).
/v1/chat/completions inference unaffected.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR restores a lightweight /public/ console by serving a bundled index.html from the server and ensuring the static assets are shipped into the Docker image.
Changes:
- Add server routes for
/public/,/public, and/public/logsthat render a bundledindex.html. - Add a large
src/public/index.htmlconsole page (Gateway + Logs UI). - Update Docker build to copy
src/publicinto the build output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| src/start-server.ts | Adds runtime loading of public/index.html and registers /public/* routes (with a fallback if missing). |
| src/public/index.html | Introduces the restored console UI (styles + client-side logic + logs via SSE). |
| Dockerfile | Copies src/public into build/public as part of the image build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Build the application and clean up | ||
| RUN npm run build \ | ||
| && cp -r src/public build/public \ |
Comment on lines
+44
to
+45
| } catch { | ||
| console.warn('Console asset missing — /public/ disabled'); |
| <!-- End Google Tag Manager --> | ||
|
|
||
| <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css"> --> | ||
| <link rel="stylesheet" href="https://unpkg.com/highlightjs@9.16.2/styles/atom-one-light.css"> |
Comment on lines
+856
to
+863
| <!-- Google Tag Manager --> | ||
| <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
| new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
| j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
| 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
| })(window,document,'script','dataLayer','GTM-KX3PMNVR');</script> | ||
| <!-- End Google Tag Manager --> | ||
|
|
| </div> --> | ||
| </div> | ||
|
|
||
| <script src="https://unpkg.com/lucide@latest"></script> |
Comment on lines
+1983
to
+1994
| tr.innerHTML = ` | ||
| <td class="log-time">${time}</td> | ||
| <td class="log-method"><span class="log-method-value">${method}</span></td> | ||
| <td class="log-endpoint">${endpoint}</td> | ||
| <td class="log-status"><span class="${status>=200 && status<300 ? 'success' : 'error'}">${status}</span></td> | ||
| <td class="log-duration">${duration}ms</td> | ||
| <td><button class="btn-view-details">View Details</button></td> | ||
| `; | ||
|
|
||
| const viewDetailsBtn = tr.querySelector('.btn-view-details'); | ||
| viewDetailsBtn.addEventListener('click', () => showLogDetails(time, method, endpoint, status, duration, requestOptions)); | ||
|
|
Comment on lines
+2028
to
+2037
| logDetailsContent.innerHTML = ` | ||
| <h3>Request Details</h3> | ||
| <p><strong>Time:</strong> ${time}</p> | ||
| <p><strong>Method:</strong> ${method}</p> | ||
| <p><strong>Endpoint:</strong> ${endpoint}</p> | ||
| <p><strong>Status:</strong> ${status}</p> | ||
| <p><strong>Duration:</strong> ${duration}ms</p> | ||
| <p><strong>Request:</strong> <pre>${JSON.stringify(requestOptions[0].requestParams, null, 2)}</pre></p> | ||
| <p><strong>Response:</strong> <pre>${JSON.stringify(requestOptions[0].response, null, 2)}</pre></p> | ||
| `; |
Comment on lines
+1954
to
+1957
| logSource.onerror = (error) => { | ||
| console.error('SSE error (logs):', error); | ||
| reconnectLogSource(); | ||
| }; |
Comment on lines
+577
to
+589
| .main-content { | ||
| max-width: 1200px; | ||
| margin: 1rem auto; | ||
| padding: 0 1rem; | ||
| } | ||
|
|
||
| /* Main content styles */ | ||
| .main-content { | ||
| max-width: 1200px; | ||
| margin: 0 auto; | ||
| padding: 1rem; | ||
| transition: margin-bottom 0.3s ease; | ||
| } |
| incrementLogCounter(); | ||
|
|
||
| setTimeout(() => { | ||
| tr.className = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/public/index.html(verbatim copy from v1.15.2)/public/,/public/logs, and/publicredirect handlers insrc/start-server.tscp -r src/public build/publicto the Dockerfile build step so the asset lands in the imageWhy
v1.15.2 shipped a self-contained ~75 KB HTML console at
build/public/index.html, served at/public/. 2.0.0 silently removed it in three places:src/public/index.htmldeleted from source.src/start-server.tsroute handlers removed (the v1.15.2setupStaticServing()block).rollup.config.jsrollup-plugin-copystep removed.Linux Docker builds of 2.0.0 therefore produce a console-less image, regressing the OSS deployment story vs 1.15.2. Self-hosters lose the only built-in UI shipped with the gateway.
Approach
The minimal fix is one-line in the Dockerfile (
cp -r src/public build/public) rather than reintroducing therollup-plugin-copydevDep. Same artifact in the image, fewer dependencies.Test plan
docker build -t portkeyai/gateway:2.0.0 .succeeds on Linux.docker run portkeyai/gateway:2.0.0starts;curl http://localhost:8787/public/returns HTTP 200 with the 75,930-byte console (<title>Portkey AI Gateway</title>)./v1/chat/completionsinference unaffected.Companion PRs: #1660 (realtimeLLMEventParser case-rename), #1661 (akto/zscaler plugin path move) — together with this one, the 2.0.0 branch builds cleanly on Linux Docker.