Update server and API hostnames and ports

This commit is contained in:
Simon Larsen 2023-12-28 16:56:05 +00:00
parent 4d2afa7cf4
commit 456516c7f2
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
21 changed files with 57 additions and 62 deletions

View File

@ -79,8 +79,8 @@ export const WorkflowHostname: Hostname = Hostname.fromString(
);
export const DashboardApiHostname: Hostname = Hostname.fromString(
`${process.env['SERVER_DASHBOARD_API_HOSTNAME'] || 'localhost'}:${
process.env['DASHBOARD_API_PORT'] || 80
`${process.env['SERVER_APP_HOSTNAME'] || 'localhost'}:${
process.env['APP_PORT'] || 80
}`
);

View File

@ -41,7 +41,7 @@ export const BILLING_PUBLIC_KEY: string = env('BILLING_PUBLIC_KEY') || '';
export const VERSION: Version = new Version(env('VERSION') || '1.0.0');
export const DASHBOARD_API_HOSTNAME: Hostname = Hostname.fromString(HOST);
export const APP_HOSTNAME: Hostname = Hostname.fromString(HOST);
export const IDENTITY_HOSTNAME: Hostname = Hostname.fromString(HOST);
@ -70,9 +70,9 @@ export const HOME_HOSTNAME: Hostname = Hostname.fromString(HOST);
export const FILE_HOSTNAME: Hostname = Hostname.fromString(HOST);
export const DASHBOARD_API_URL: URL = new URL(
export const APP_URL: URL = new URL(
HTTP_PROTOCOL,
DASHBOARD_API_HOSTNAME,
APP_HOSTNAME,
DashboardApiRoute
);

View File

@ -1,10 +1,10 @@
import { DASHBOARD_API_HOSTNAME, HTTP_PROTOCOL } from '../../Config';
import { APP_HOSTNAME, HTTP_PROTOCOL } from '../../Config';
import { DashboardApiRoute } from 'Common/ServiceRoute';
import BaseAPI from './API';
class BackendAPI extends BaseAPI {
public constructor() {
super(HTTP_PROTOCOL, DASHBOARD_API_HOSTNAME, DashboardApiRoute);
super(HTTP_PROTOCOL, APP_HOSTNAME, DashboardApiRoute);
}
}

View File

@ -6,7 +6,7 @@ import API from '../API/API';
import Route from 'Common/Types/API/Route';
import URL from 'Common/Types/API/URL';
import BadDataException from 'Common/Types/Exception/BadDataException';
import { DASHBOARD_API_URL } from '../../Config';
import { APP_URL } from '../../Config';
import HTTPResponse from 'Common/Types/API/HTTPResponse';
import HTTPMethod from 'Common/Types/API/HTTPMethod';
import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse';
@ -95,7 +95,7 @@ export default class ModelAPI {
);
}
apiUrl = URL.fromURL(DASHBOARD_API_URL).addRoute(apiPath);
apiUrl = URL.fromURL(APP_URL).addRoute(apiPath);
}
apiUrl = apiUrl.addRoute(`/${id.toString()}`);
@ -147,7 +147,7 @@ export default class ModelAPI {
);
}
apiUrl = URL.fromURL(DASHBOARD_API_URL).addRoute(apiPath);
apiUrl = URL.fromURL(APP_URL).addRoute(apiPath);
}
const httpMethod: HTTPMethod =
@ -207,7 +207,7 @@ export default class ModelAPI {
);
}
let apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
let apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/get-list');
@ -273,7 +273,7 @@ export default class ModelAPI {
);
}
let apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
let apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/count');
@ -346,7 +346,7 @@ export default class ModelAPI {
);
}
let apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
let apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/' + id.toString())
.addRoute('/get-item');
@ -411,7 +411,7 @@ export default class ModelAPI {
);
}
const apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
const apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/' + id.toString());

View File

@ -6,7 +6,7 @@ import API from '../../Utils/API/API';
import Route from 'Common/Types/API/Route';
import URL from 'Common/Types/API/URL';
import BadDataException from 'Common/Types/Exception/BadDataException';
import { DASHBOARD_API_URL } from '../../Config';
import { APP_URL } from '../../Config';
import HTTPResponse from 'Common/Types/API/HTTPResponse';
import HTTPMethod from 'Common/Types/API/HTTPMethod';
import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse';
@ -88,7 +88,7 @@ export default class ModelAPI {
);
}
apiUrl = URL.fromURL(DASHBOARD_API_URL).addRoute(apiPath);
apiUrl = URL.fromURL(APP_URL).addRoute(apiPath);
}
apiUrl = apiUrl.addRoute(`/${data.id.toString()}`);
@ -133,7 +133,7 @@ export default class ModelAPI {
);
}
apiUrl = URL.fromURL(DASHBOARD_API_URL).addRoute(apiPath);
apiUrl = URL.fromURL(APP_URL).addRoute(apiPath);
}
const httpMethod: HTTPMethod =
@ -202,7 +202,7 @@ export default class ModelAPI {
);
}
let apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
let apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/get-list');
@ -271,7 +271,7 @@ export default class ModelAPI {
);
}
let apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
let apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/count');
@ -356,7 +356,7 @@ export default class ModelAPI {
);
}
let apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
let apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/' + data.id.toString())
.addRoute('/get-item');
@ -421,7 +421,7 @@ export default class ModelAPI {
);
}
const apiUrl: URL = URL.fromURL(DASHBOARD_API_URL)
const apiUrl: URL = URL.fromURL(APP_URL)
.addRoute(apiPath)
.addRoute('/' + data.id.toString());

View File

@ -22,7 +22,7 @@ import PageMap from './Utils/PageMap';
import {
ACCOUNTS_URL,
BILLING_ENABLED,
DASHBOARD_API_URL,
APP_URL,
} from 'CommonUI/src/Config';
import ActiveIncidents from './Pages/Global/ActiveIncidents';
@ -180,7 +180,7 @@ const App: () => JSX.Element = () => {
requestOptions: {
isMultiTenantRequest: true,
overrideRequestUrl: URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/project/list-user-projects'),
},
}

View File

@ -5,7 +5,7 @@ import ErrorMessage from 'CommonUI/src/Components/ErrorMessage/ErrorMessage';
import ModelAPI from 'CommonUI/src/Utils/ModelAPI/ModelAPI';
import MonitorStatus from 'Model/Models/MonitorStatus';
import URL from 'Common/Types/API/URL';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import BadDataException from 'Common/Types/Exception/BadDataException';
import Statusbubble from 'CommonUI/src/Components/StatusBubble/StatusBubble';
import Color from 'Common/Types/Color';
@ -33,7 +33,7 @@ const CurrentStatusElement: FunctionComponent<ComponentProps> = (
const currentStatus: MonitorStatus | null =
await ModelAPI.post<MonitorStatus>({
modelType: MonitorStatus,
apiUrl: URL.fromString(DASHBOARD_API_URL.toString())
apiUrl: URL.fromString(APP_URL.toString())
.addRoute(new MonitorGroup().getCrudApiPath()!)
.addRoute('/current-status/')
.addRoute(`/${props.monitorGroupId.toString()}`),

View File

@ -12,7 +12,7 @@ import URL from 'Common/Types/API/URL';
import BasicFormModal from 'CommonUI/src/Components/FormModal/BasicFormModal';
import HTTPResponse from 'Common/Types/API/HTTPResponse';
import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import API from 'CommonUI/src/Utils/API/API';
import ConfirmModal from 'CommonUI/src/Components/Modal/ConfirmModal';
@ -170,7 +170,7 @@ const Call: () => JSX.Element = (): ReactElement => {
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/user-call/verify'),
{
code: item['code'],
@ -237,7 +237,7 @@ const Call: () => JSX.Element = (): ReactElement => {
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute(
'/user-call/resend-verification-code'
),

View File

@ -12,7 +12,7 @@ import URL from 'Common/Types/API/URL';
import BasicFormModal from 'CommonUI/src/Components/FormModal/BasicFormModal';
import HTTPResponse from 'Common/Types/API/HTTPResponse';
import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import API from 'CommonUI/src/Utils/API/API';
import ConfirmModal from 'CommonUI/src/Components/Modal/ConfirmModal';
@ -170,7 +170,7 @@ const Email: () => JSX.Element = (): ReactElement => {
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/user-email/verify'),
{
code: item['code'],
@ -237,7 +237,7 @@ const Email: () => JSX.Element = (): ReactElement => {
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute(
'/user-email/resend-verification-code'
),

View File

@ -12,7 +12,7 @@ import URL from 'Common/Types/API/URL';
import BasicFormModal from 'CommonUI/src/Components/FormModal/BasicFormModal';
import HTTPResponse from 'Common/Types/API/HTTPResponse';
import HTTPErrorResponse from 'Common/Types/API/HTTPErrorResponse';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import API from 'CommonUI/src/Utils/API/API';
import ConfirmModal from 'CommonUI/src/Components/Modal/ConfirmModal';
@ -170,7 +170,7 @@ const SMS: () => JSX.Element = (): ReactElement => {
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/user-sms/verify'),
{
code: item['code'],
@ -237,7 +237,7 @@ const SMS: () => JSX.Element = (): ReactElement => {
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute(
'/user-sms/resend-verification-code'
),

View File

@ -25,7 +25,7 @@ import FieldType from 'CommonUI/src/Components/Types/FieldType';
import ProbeElement from 'CommonUI/src/Components/Probe/Probe';
import { LIMIT_PER_PROJECT } from 'Common/Types/Database/LimitMax';
import URL from 'Common/Types/API/URL';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import DisabledWarning from '../../../Components/Monitor/DisabledWarning';
import { ButtonStyleType } from 'CommonUI/src/Components/Button/Button';
import Modal, { ModalWidth } from 'CommonUI/src/Components/Modal/Modal';
@ -91,7 +91,7 @@ const MonitorProbes: FunctionComponent<PageComponentProps> = (
sort: {},
requestOptions: {
overrideRequestUrl: URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/probe/global-probes'),
},
});

View File

@ -22,7 +22,7 @@ import ModelAPI, { ListResult } from 'CommonUI/src/Utils/ModelAPI/ModelAPI';
import MonitorStatusTimeline from 'Model/Models/MonitorStatusTimeline';
import { LIMIT_PER_PROJECT } from 'Common/Types/Database/LimitMax';
import URL from 'Common/Types/API/URL';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import API from 'CommonUI/src/Utils/API/API';
import OneUptimeDate from 'Common/Types/Date';
import UptimeUtil from 'CommonUI/src/Components/MonitorGraphs/UptimeUtil';
@ -111,7 +111,7 @@ const MonitorGroupView: FunctionComponent<PageComponentProps> = (
sort: {},
requestOptions: {
overrideRequestUrl: URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
)
.addRoute(new MonitorGroup().getCrudApiPath()!)
.addRoute('/timeline/')
@ -142,7 +142,7 @@ const MonitorGroupView: FunctionComponent<PageComponentProps> = (
const currentStatus: MonitorStatus | null =
await ModelAPI.post<MonitorStatus>({
modelType: MonitorStatus,
apiUrl: URL.fromString(DASHBOARD_API_URL.toString())
apiUrl: URL.fromString(APP_URL.toString())
.addRoute(new MonitorGroup().getCrudApiPath()!)
.addRoute('/current-status/')
.addRoute(`/${modelId.toString()}`),

View File

@ -7,7 +7,7 @@ import ProjectSSO from 'Model/Models/ProjectSso';
import DashboardNavigation from '../../Utils/Navigation';
import Navigation from 'CommonUI/src/Utils/Navigation';
import URL from 'Common/Types/API/URL';
import { DASHBOARD_API_URL, IDENTITY_URL } from 'CommonUI/src/Config';
import { APP_URL, IDENTITY_URL } from 'CommonUI/src/Config';
import Route from 'Common/Types/API/Route';
import PageLoader from 'CommonUI/src/Components/Loader/PageLoader';
@ -31,7 +31,7 @@ const SSO: FunctionComponent<PageComponentProps> = (
<ModelList<ProjectSSO>
id="sso-list"
overrideFetchApiUrl={URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
)
.addRoute('/project-sso')
.addRoute(

View File

@ -31,7 +31,7 @@ import URL from 'Common/Types/API/URL';
import {
BILLING_ENABLED,
BILLING_PUBLIC_KEY,
DASHBOARD_API_URL,
APP_URL,
getAllEnvVars,
} from 'CommonUI/src/Config';
import { Elements } from '@stripe/react-stripe-js';
@ -124,7 +124,7 @@ const Settings: FunctionComponent<ComponentProps> = (
const response: HTTPResponse<JSONObject> =
await BaseAPI.post<JSONObject>(
URL.fromString(DASHBOARD_API_URL.toString()).addRoute(
URL.fromString(APP_URL.toString()).addRoute(
`/billing-payment-methods/setup`
),
{},

View File

@ -16,7 +16,7 @@ import FieldType from 'CommonUI/src/Components/Types/FieldType';
import URL from 'Common/Types/API/URL';
import Pill from 'CommonUI/src/Components/Pill/Pill';
import { Green, Yellow } from 'Common/Types/BrandColors';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import BaseAPI from 'CommonUI/src/Utils/API/API';
import ModelAPI from 'CommonUI/src/Utils/ModelAPI/ModelAPI';
import ConfirmModal from 'CommonUI/src/Components/Modal/ConfirmModal';
@ -41,7 +41,7 @@ const Settings: FunctionComponent<ComponentProps> = (
const result: HTTPResponse<JSONObject> =
await BaseAPI.post<JSONObject>(
URL.fromString(DASHBOARD_API_URL.toString()).addRoute(
URL.fromString(APP_URL.toString()).addRoute(
`/billing-invoices/pay`
),
{

View File

@ -11,7 +11,7 @@ import PageComponentProps from '../PageComponentProps';
import DashboardSideMenu from './SideMenu';
import FieldType from 'CommonUI/src/Components/Types/FieldType';
import FormFieldSchemaType from 'CommonUI/src/Components/Forms/Types/FormFieldSchemaType';
import { BILLING_ENABLED, DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { BILLING_ENABLED, APP_URL } from 'CommonUI/src/Config';
import BasicFormModal from 'CommonUI/src/Components/FormModal/BasicFormModal';
import { JSONObject } from 'Common/Types/JSON';
import API from 'CommonUI/src/Utils/API/API';
@ -344,7 +344,7 @@ const Settings: FunctionComponent<PageComponentProps> = (
| HTTPResponse<JSONObject>
| HTTPErrorResponse = await API.post(
URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/notification/recharge'),
{
amount: item['amount'],

View File

@ -19,7 +19,7 @@ import Statusbubble from 'CommonUI/src/Components/StatusBubble/StatusBubble';
import { Green, Red } from 'Common/Types/BrandColors';
import OneUptimeDate from 'Common/Types/Date';
import URL from 'Common/Types/API/URL';
import { DASHBOARD_API_URL } from 'CommonUI/src/Config';
import { APP_URL } from 'CommonUI/src/Config';
import Banner from 'CommonUI/src/Components/Banner/Banner';
import ProbeStatusElement from '../../Components/Probe/ProbeStatus';
@ -70,7 +70,7 @@ const ProbePage: FunctionComponent<PageComponentProps> = (
}}
fetchRequestOptions={{
overrideRequestUrl: URL.fromString(
DASHBOARD_API_URL.toString()
APP_URL.toString()
).addRoute('/probe/global-probes'),
}}
noItemsMessage={'No probes found.'}

View File

@ -23,7 +23,7 @@
value: {{ $.Values.analytics.host }}
- name: SERVER_ACCOUNTS_HOSTNAME
value: {{ $.Release.Name }}-accounts.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
- name: SERVER_DASHBOARD_API_HOSTNAME
- name: SERVER_APP_HOSTNAME
value: {{ $.Release.Name }}-app.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
- name: SERVER_WORKFLOW_HOSTNAME
value: {{ $.Release.Name }}-workflow.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
@ -43,10 +43,8 @@
value: {{ $.Release.Name }}-dashboard.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
- name: SERVER_ADMIN_DASHBOARD_HOSTNAME
value: {{ $.Release.Name }}-admin-dashboard.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
- name: SERVER_API_REFERENCE_HOSTNAME
value: {{ $.Release.Name }}-api-reference.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
- name: DASHBOARD_API_PORT
- name: APP_PORT
value: {{ $.Values.port.dashboardApi | squote }}
- name: API_REFERENCE_PORT
value: {{ $.Values.port.apiReference | squote }}

View File

@ -4,7 +4,7 @@ upstream accounts {
upstream app {
server ${SERVER_DASHBOARD_API_HOSTNAME}:${DASHBOARD_API_PORT} weight=10 max_fails=3 fail_timeout=30s;
server ${SERVER_APP_HOSTNAME}:${APP_PORT} weight=10 max_fails=3 fail_timeout=30s;
}
upstream workflow {

View File

@ -76,22 +76,20 @@ INGESTOR_HOSTNAME=ingestor:3400
SERVER_ACCOUNTS_HOSTNAME=accounts
SERVER_REALTIME_HOSTNAME=realtime
SERVER_DASHBOARD_API_HOSTNAME=app
SERVER_APP_HOSTNAME=app
SERVER_WORKFLOW_HOSTNAME=workflow
SERVER_ALERT_HOSTNAME=alert
SERVER_INGESTOR_HOSTNAME=ingestor
SERVER_TEST_SERVER_HOSTNAME=test-server
SERVER_HOME_HOSTNAME=home
SERVER_WORKERS_HOSTNAME=workers
SERVER_STATUS_PAGE_HOSTNAME=status-page
SERVER_DASHBOARD_HOSTNAME=dashboard
SERVER_ADMIN_DASHBOARD_HOSTNAME=admin-dashboard
SERVER_API_REFERENCE_HOSTNAME=api-reference
OTEL_COLLECTOR_HOSTNAME=otel-collector
#Ports. Usually they don't need to change.
DASHBOARD_API_PORT=3002
APP_PORT=3002
API_REFERENCE_PORT=1445
WORKFLOW_PORT=3099
ALERT_PORT=3088

View File

@ -17,7 +17,7 @@ x-common-variables: &common-variables
SERVER_ACCOUNTS_HOSTNAME: accounts
SERVER_REALTIME_HOSTNAME: realtime
SERVER_DASHBOARD_API_HOSTNAME: app
SERVER_APP_HOSTNAME: app
SERVER_WORKFLOW_HOSTNAME: workflow
SERVER_ALERT_HOSTNAME: alert
SERVER_INGESTOR_HOSTNAME: ingestor
@ -27,12 +27,11 @@ x-common-variables: &common-variables
SERVER_STATUS_PAGE_HOSTNAME: status-page
SERVER_DASHBOARD_HOSTNAME: dashboard
SERVER_ADMIN_DASHBOARD_HOSTNAME: admin-dashboard
SERVER_API_REFERENCE_HOSTNAME: api-reference
OTEL_COLLECTOR_HOSTNAME: otel-collector
#Ports. Usually they don't need to change.
DASHBOARD_API_PORT: ${DASHBOARD_API_PORT}
APP_PORT: ${APP_PORT}
API_REFERENCE_PORT: ${API_REFERENCE_PORT}
WORKFLOW_PORT: ${WORKFLOW_PORT}
ALERT_PORT: ${ALERT_PORT}
@ -198,7 +197,7 @@ services:
restart: always
environment:
<<: *common-server-variables
PORT: ${DASHBOARD_API_PORT}
PORT: ${APP_PORT}
SMS_DEFAULT_COST_IN_CENTS: ${SMS_DEFAULT_COST_IN_CENTS}
CALL_DEFAULT_COST_IN_CENTS_PER_MINUTE: ${CALL_DEFAULT_COST_IN_CENTS_PER_MINUTE}
SMS_HIGH_RISK_COST_IN_CENTS: ${SMS_HIGH_RISK_COST_IN_CENTS}