diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 28844f3..1f42a4c 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -50,8 +50,10 @@ const port = parseInt(process.env.API_PORT || process.env.PORT || '3333', 10); const app = express(); -// Trust proxy for rate limiting behind reverse proxy -app.set('trust proxy', 1); +// Cloud Run sits behind Google Front End (and often an HTTPS LB), which +// appends an extra X-Forwarded-For hop. Trusting only 1 hop makes req.ip +// the shared load-balancer address. Self-hosted nginx is a single hop. +app.set('trust proxy', process.env.K_SERVICE ? 2 : 1); // Request logging (skip health checks) app.use(RequestLoggerWithSkip(['/api/health'])); diff --git a/apps/cli/package.json b/apps/cli/package.json index eb13e5b..228ac54 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@zoneless/cli", - "version": "0.1.9", + "version": "0.2.0", "description": "Provision and manage an agent-operated Zoneless store", "license": "Apache-2.0", "repository": {