diff --git a/packages/backend/src/controllers/internal/api/v1/automatisch/notifications.js b/packages/backend/src/controllers/internal/api/v1/automatisch/notifications.js index 567f12f0..95f523d7 100644 --- a/packages/backend/src/controllers/internal/api/v1/automatisch/notifications.js +++ b/packages/backend/src/controllers/internal/api/v1/automatisch/notifications.js @@ -1,10 +1,18 @@ import { renderObject } from '../../../../../helpers/renderer.js'; import axios from '../../../../../helpers/axios-with-proxy.js'; import logger from '../../../../../helpers/logger.js'; +import appConfig from '../../../../../config/app.js'; -const NOTIFICATIONS_URL = +const AUTOMATISCH_NOTIFICATIONS_URL = 'https://notifications.automatisch.io/notifications.json'; +const MATION_NOTIFICATIONS_URL = + 'https://notifications.mation.work/notifications.json'; + +const NOTIFICATIONS_URL = appConfig.isMation + ? MATION_NOTIFICATIONS_URL + : AUTOMATISCH_NOTIFICATIONS_URL; + export default async (request, response) => { let notifications = []; diff --git a/packages/backend/src/helpers/license.ee.js b/packages/backend/src/helpers/license.ee.js index d3ae30c0..4b69425d 100644 --- a/packages/backend/src/helpers/license.ee.js +++ b/packages/backend/src/helpers/license.ee.js @@ -4,6 +4,12 @@ import axios from './axios-with-proxy.js'; const CACHE_DURATION = 1000 * 60 * 60 * 24; // 24 hours in milliseconds +const AUTOMATISCH_LICENSE_VERIFY_URL = + 'https://license.automatisch.io/api/v1/licenses/verify'; + +const MATION_LICENSE_VERIFY_URL = + 'https://license.mation.work/api/v1/licenses/verify'; + const hasValidLicense = async () => { const license = await getLicense(); @@ -17,7 +23,10 @@ const getLicense = async () => { return false; } - const url = 'https://license.automatisch.io/api/v1/licenses/verify'; + const url = appConfig.isMation + ? MATION_LICENSE_VERIFY_URL + : AUTOMATISCH_LICENSE_VERIFY_URL; + const cachedResponse = memoryCache.get(url); if (cachedResponse) { diff --git a/packages/backend/src/helpers/telemetry/index.js b/packages/backend/src/helpers/telemetry/index.js index 7791aec6..221843ae 100644 --- a/packages/backend/src/helpers/telemetry/index.js +++ b/packages/backend/src/helpers/telemetry/index.js @@ -5,9 +5,13 @@ import appConfig from '../../config/app.js'; import os from 'os'; const WRITE_KEY = '284Py4VgK2MsNYV7xlKzyrALx0v'; -const DATA_PLANE_URL = 'https://telemetry.automatisch.io/v1/batch'; const CPUS = os.cpus(); const SIX_HOURS_IN_MILLISECONDS = 21600000; +const AUTOMATISCH_DATA_PLANE_URL = 'https://telemetry.automatisch.io/v1/batch'; +const MATION_DATA_PLANE_URL = 'https://telemetry.mation.work/v1/batch'; +const DATA_PLANE_URL = appConfig.isMation + ? MATION_DATA_PLANE_URL + : AUTOMATISCH_DATA_PLANE_URL; class Telemetry { constructor() {