diff --git a/packages/backend-core/src/features/features.ts b/packages/backend-core/src/features/features.ts index efe6495cb5..cb095e792c 100644 --- a/packages/backend-core/src/features/features.ts +++ b/packages/backend-core/src/features/features.ts @@ -198,6 +198,8 @@ export class FlagSet, T extends { [key: string]: V }> { let userId = identity?._id if (!userId) { const ip = context.getIP() + // TODO; REMOVE THIS + tags["userIP"] = ip if (ip) { userId = crypto.createHash("sha512").update(ip).digest("hex") } diff --git a/packages/server/src/koa.ts b/packages/server/src/koa.ts index dd8063795d..acae433cc3 100644 --- a/packages/server/src/koa.ts +++ b/packages/server/src/koa.ts @@ -12,6 +12,7 @@ import { userAgent } from "koa-useragent" export default function createKoaApp() { const app = new Koa() + app.proxy = true let mbNumber = parseInt(env.HTTP_MB_LIMIT || "10") if (!mbNumber || isNaN(mbNumber)) { diff --git a/packages/worker/src/index.ts b/packages/worker/src/index.ts index 9c3c053baf..fb6a97a844 100644 --- a/packages/worker/src/index.ts +++ b/packages/worker/src/index.ts @@ -46,6 +46,7 @@ bootstrap() const app: Application = new Application() app.keys = ["secret", "key"] +app.proxy = true // set up top level koa middleware app.use(handleScimBody)