open-notebook/frontend/next.config.ts
Augusto Sandim bbc7d110f6
refactor: rename "API Keys" settings page to "Models" (#1313)
* refactor: rename "API Keys" settings page to "Models" (#1199)

Rename the provider credentials settings area from "API Keys" to "Models":

- Route: /settings/api-keys -> /settings/models with a permanent redirect
- UI copy: page title, description, and learn-more now use "Models" wording
- i18n: updated display values across all 14 locales (key names unchanged)
- Internal links: sidebar, setup banner, and command palette point to /settings/models
- Docs: "Settings → API Keys" references updated to "Settings → Models"

* docs(quick-start): update model settings navigation to Manage → Models

* fix(frontend): highlight only the active sidebar item on nested routes

Use longest-prefix matching so parent items like Settings don't also
highlight when viewing a child page such as Models. Add test coverage
for the Models page active state.

---------

Co-authored-by: Luis Novo <lfnovo@gmail.com>
2026-09-05 13:20:20 -03:00

57 lines
2.1 KiB
TypeScript

import type { NextConfig } from "next";
// Next.js dev server blocks cross-origin requests (including the HMR
// websocket) from any host not in this list, to guard against DNS
// rebinding. Set NEXT_ALLOWED_DEV_ORIGINS (comma-separated hostnames, no
// protocol/port) to access the dev server from a LAN IP or custom hostname.
const allowedDevOrigins = process.env.NEXT_ALLOWED_DEV_ORIGINS
? process.env.NEXT_ALLOWED_DEV_ORIGINS.split(",").map((s) => s.trim()).filter(Boolean)
: undefined;
const nextConfig: NextConfig = {
// Enable standalone output for optimized Docker deployment
output: "standalone",
...(allowedDevOrigins && allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}),
// Experimental features
// Type assertion needed: proxyClientMaxBodySize is valid in Next.js 15 but types lag behind
experimental: {
// Increase proxy body size limit for file uploads (default is 10MB)
// This allows larger files to be uploaded through the /api/* rewrite proxy to FastAPI
proxyClientMaxBodySize: '100mb',
} as NextConfig['experimental'],
// API Rewrites: Proxy /api/* requests to FastAPI backend
// This simplifies reverse proxy configuration - users only need to proxy to port 8502
// Next.js handles internal routing to the API backend on port 5055
async rewrites() {
// INTERNAL_API_URL: Where Next.js server-side should proxy API requests
// Default: http://localhost:5055 (single-container deployment)
// Override for multi-container: INTERNAL_API_URL=http://api-service:5055
const internalApiUrl = process.env.INTERNAL_API_URL || 'http://localhost:5055'
console.log(`[Next.js Rewrites] Proxying /api/* to ${internalApiUrl}/api/*`)
return [
{
source: '/api/:path*',
destination: `${internalApiUrl}/api/:path*`,
},
]
},
// Redirect the legacy credentials route to the canonical "Models" route so
// existing bookmarks and links keep working.
async redirects() {
return [
{
source: '/settings/api-keys',
destination: '/settings/models',
permanent: true,
},
]
},
};
export default nextConfig;