forked from tsai/budibase
20 changed files with 156 additions and 50 deletions
@ -1,3 +1,13 @@ |
|||
FROM nginx:latest |
|||
COPY .generated-nginx.prod.conf /etc/nginx/nginx.conf |
|||
COPY error.html /usr/share/nginx/html/error.html |
|||
|
|||
# nginx.conf |
|||
# use the default nginx behaviour for *.template files which are processed with envsubst |
|||
# override the output dir to output directly to /etc/nginx instead of /etc/nginx/conf.d |
|||
ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx |
|||
COPY .generated-nginx.prod.conf /etc/nginx/templates/nginx.conf.template |
|||
|
|||
# Error handling |
|||
COPY error.html /usr/share/nginx/html/error.html |
|||
|
|||
# Default environment |
|||
ENV PROXY_RATE_LIMIT_WEBHOOKS_PER_SECOND=10 |
|||
@ -0,0 +1,27 @@ |
|||
import { EventEmitter } from "events" |
|||
import * as context from "../../context" |
|||
import { Identity, Event } from "@budibase/types" |
|||
|
|||
export interface EmittedEvent { |
|||
tenantId: string |
|||
identity: Identity |
|||
appId: string | undefined |
|||
properties: any |
|||
} |
|||
|
|||
class BBEventEmitter extends EventEmitter { |
|||
emitEvent(event: Event, properties: any, identity: Identity) { |
|||
const tenantId = context.getTenantId() |
|||
const appId = context.getAppId() |
|||
|
|||
const emittedEvent: EmittedEvent = { |
|||
tenantId, |
|||
identity, |
|||
appId, |
|||
properties, |
|||
} |
|||
this.emit(event, emittedEvent) |
|||
} |
|||
} |
|||
|
|||
export const emitter = new BBEventEmitter() |
|||
@ -0,0 +1 @@ |
|||
export * from "./BBEventEmitter" |
|||
Loading…
Reference in new issue