lib/data/index.ts guards on the search env vars but then ignores NEXT_PUBLIC_ORAMA_API_KEY and uses a hard-coded c1_… key:
// lib/data/index.ts
if (!process.env.NEXT_PUBLIC_ORAMA_PROJECT_ID || !process.env.NEXT_PUBLIC_ORAMA_API_KEY) {
throw new Error('Orama project ID and API key must be set in environment variables.')
}
const config = {
projectId: process.env.NEXT_PUBLIC_ORAMA_PROJECT_ID,
apiKey: 'c1_… (hard-coded — value redacted here)', // <- should be process.env.NEXT_PUBLIC_ORAMA_API_KEY
}
Impact
- The key is a read-only, client-embedded public search key (it ships in the browser bundle by design), so this is not a security leak — but the code checks the env var and then doesn't use it, which is inconsistent and a maintainability smell (rotating the key means a code change, not an env change).
How it surfaced
Building a Docker image of the docs site for the orama-cloud-v1-operator self-host — the build needs NEXT_PUBLIC_ORAMA_* at prerender, and NEXT_PUBLIC_ORAMA_API_KEY is checked-but-unused.
Fix
Use process.env.NEXT_PUBLIC_ORAMA_API_KEY for config.apiKey (keep the guard).
lib/data/index.tsguards on the search env vars but then ignoresNEXT_PUBLIC_ORAMA_API_KEYand uses a hard-codedc1_…key:Impact
How it surfaced
Building a Docker image of the docs site for the
orama-cloud-v1-operatorself-host — the build needsNEXT_PUBLIC_ORAMA_*at prerender, andNEXT_PUBLIC_ORAMA_API_KEYis checked-but-unused.Fix
Use
process.env.NEXT_PUBLIC_ORAMA_API_KEYforconfig.apiKey(keep the guard).