From 0225c64058f31ff17282da95004075efa04dead4 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Sat, 30 Dec 2023 23:11:54 +0000 Subject: [PATCH] Remove RealTimeService and ALERT_PORT --- CommonServer/EnvironmentConfig.ts | 5 --- CommonServer/Services/RealTimeService.ts | 42 ------------------- .../Public/oneuptime/templates/_helpers.tpl | 4 -- config.example.env | 2 - docker-compose.base.yml | 2 - 5 files changed, 55 deletions(-) delete mode 100755 CommonServer/Services/RealTimeService.ts diff --git a/CommonServer/EnvironmentConfig.ts b/CommonServer/EnvironmentConfig.ts index d80efa4d73..8f6d7812b4 100644 --- a/CommonServer/EnvironmentConfig.ts +++ b/CommonServer/EnvironmentConfig.ts @@ -60,11 +60,6 @@ export const ClusterKey: ObjectID = new ObjectID( export const HasClusterKey: boolean = Boolean(process.env['ONEUPTIME_SECRET']); -export const RealtimeHostname: Hostname = Hostname.fromString( - `${process.env['SERVER_REALTIME_HOSTNAME'] || 'localhost'}:${ - process.env['REALTIME_PORT'] || 80 - }` -); export const WorkerHostname: Hostname = Hostname.fromString( `${process.env['SERVER_WORKERS_HOSTNAME'] || 'localhost'}:${ diff --git a/CommonServer/Services/RealTimeService.ts b/CommonServer/Services/RealTimeService.ts deleted file mode 100755 index 64f91333fa..0000000000 --- a/CommonServer/Services/RealTimeService.ts +++ /dev/null @@ -1,42 +0,0 @@ -import API from 'Common/Utils/API'; -import { RealtimeHostname, ClusterKey } from '../EnvironmentConfig'; -import DatabaseConfig from '../DatabaseConfig'; -import { JSONObjectOrArray } from 'Common/Types/JSON'; -import Route from 'Common/Types/API/Route'; -import Headers from 'Common/Types/API/Headers'; -import ObjectID from 'Common/Types/ObjectID'; -import HTTPResponse from 'Common/Types/API/HTTPResponse'; -import EmptyResponse from 'Common/Types/API/EmptyResponse'; -import Protocol from 'Common/Types/API/Protocol'; - -class Service { - private api: API | null = null; - private headers: Headers; - - public constructor() { - this.headers = { - ONEUPTIME_SECRET: ClusterKey.toString(), - }; - } - - public async send( - projectId: ObjectID, - eventType: string, - data: JSONObjectOrArray - ): Promise> { - const httpProtocol: Protocol = await DatabaseConfig.getHttpProtocol(); - this.api = new API(httpProtocol, RealtimeHostname); - - return await this.api.post( - new Route(`/send-created-incident`), - { - projectId, - eventType, - data, - }, - this.headers - ); - } -} - -export default new Service(); diff --git a/HelmChart/Public/oneuptime/templates/_helpers.tpl b/HelmChart/Public/oneuptime/templates/_helpers.tpl index 304874d58a..575a93a9c1 100644 --- a/HelmChart/Public/oneuptime/templates/_helpers.tpl +++ b/HelmChart/Public/oneuptime/templates/_helpers.tpl @@ -48,16 +48,12 @@ value: {{ $.Values.port.app | squote }} - name: WORKFLOW_PORT value: {{ $.Values.port.workflow | squote }} -- name: ALERT_PORT - value: {{ $.Values.port.alert | squote }} - name: INGESTOR_PORT value: {{ $.Values.port.ingestor | squote }} - name: PROBE_PORT value: {{ $.Values.port.probe | squote }} - name: TEST_SERVER_PORT value: {{ $.Values.port.testServer | squote }} -- name: REALTIME_PORT - value: {{ $.Values.port.realtime | squote }} - name: WORKERS_PORT value: {{ $.Values.port.workers | squote }} - name: ACCOUNTS_PORT diff --git a/config.example.env b/config.example.env index d276326a1d..66a16db69f 100644 --- a/config.example.env +++ b/config.example.env @@ -94,11 +94,9 @@ SERVER_OTEL_COLLECTOR_HOSTNAME=otel-collector APP_PORT=3002 WORKFLOW_PORT=3099 -ALERT_PORT=3088 INGESTOR_PORT=3400 PROBE_PORT=3500 TEST_SERVER_PORT=3800 -REALTIME_PORT=3300 WORKERS_PORT=3452 ACCOUNTS_PORT=3003 STATUS_PAGE_PORT=3105 diff --git a/docker-compose.base.yml b/docker-compose.base.yml index e5d6998588..1775181357 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -33,11 +33,9 @@ x-common-variables: &common-variables #Ports. Usually they don't need to change. APP_PORT: ${APP_PORT} WORKFLOW_PORT: ${WORKFLOW_PORT} - ALERT_PORT: ${ALERT_PORT} INGESTOR_PORT: ${INGESTOR_PORT} PROBE_PORT: ${PROBE_PORT} TEST_SERVER_PORT: ${TEST_SERVER_PORT} - REALTIME_PORT: ${REALTIME_PORT} WORKERS_PORT: ${WORKERS_PORT} ACCOUNTS_PORT: ${ACCOUNTS_PORT} STATUS_PAGE_PORT: ${STATUS_PAGE_PORT}