fix: quote API key header in nginx-demo.conf to prevent empty-value crash
- Wrap ${ANTHROPIC_API_KEY} in quotes so envsubst produces valid nginx
directive even when the variable is empty
- Skip Docker container polling when runtime is unavailable (stops
log spam in demo/Portainer deployments)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -77,7 +77,7 @@ http {
|
||||
proxy_pass https://api.anthropic.com;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_set_header Host api.anthropic.com;
|
||||
proxy_set_header x-api-key ${ANTHROPIC_API_KEY};
|
||||
proxy_set_header x-api-key "${ANTHROPIC_API_KEY}";
|
||||
proxy_set_header anthropic-version "2023-06-01";
|
||||
proxy_set_header Content-Type "application/json";
|
||||
|
||||
|
||||
@@ -1006,19 +1006,22 @@ server.listen(PORT, '0.0.0.0', async () => {
|
||||
console.log('Mock backend is running. Press Ctrl+C to stop.\n')
|
||||
|
||||
// Periodically update package data from Docker (merge with static dev apps)
|
||||
setInterval(async () => {
|
||||
const dockerApps = await getDockerContainers()
|
||||
mockData['package-data'] = mergePackageData(dockerApps)
|
||||
|
||||
// Broadcast update to connected clients
|
||||
broadcastUpdate([
|
||||
{
|
||||
op: 'replace',
|
||||
path: '/package-data',
|
||||
value: mockData['package-data']
|
||||
}
|
||||
])
|
||||
}, 5000) // Update every 5 seconds
|
||||
// Only poll if container runtime is available (avoids log spam in demo/Docker deployments)
|
||||
if (runtime.available) {
|
||||
setInterval(async () => {
|
||||
const dockerApps = await getDockerContainers()
|
||||
mockData['package-data'] = mergePackageData(dockerApps)
|
||||
|
||||
// Broadcast update to connected clients
|
||||
broadcastUpdate([
|
||||
{
|
||||
op: 'replace',
|
||||
path: '/package-data',
|
||||
value: mockData['package-data']
|
||||
}
|
||||
])
|
||||
}, 5000) // Update every 5 seconds
|
||||
}
|
||||
})
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
|
||||
Reference in New Issue
Block a user