diff --git a/client/src/forms/TaskForm.js b/client/src/forms/TaskForm.js index 4be7dcce..38a5e5af 100644 --- a/client/src/forms/TaskForm.js +++ b/client/src/forms/TaskForm.js @@ -1,5 +1,5 @@ import React from 'react'; -import {AutoForm, AutoFields, HiddenField, SubmitField, ErrorsField} from 'uniforms-ionic'; +import {AutoForm, AutoFields, SubmitField, ErrorsField} from 'uniforms-ionic'; import {schema} from './schema'; export function TaskForm({model, handleSubmit}) { @@ -11,7 +11,7 @@ export function TaskForm({model, handleSubmit}) { > - + ) diff --git a/server/integrations/mqtt/configureAMQ.js b/server/integrations/mqtt/configureAMQ.js new file mode 100644 index 00000000..a0aa2dfc --- /dev/null +++ b/server/integrations/mqtt/configureAMQ.js @@ -0,0 +1,19 @@ +const execSync = require("child_process").execSync; + +const AMQURL = execSync( + `oc get addressspace datasync -o jsonpath='{.status.endpointStatuses[?(@.name=="messaging")].externalHost}'`, + { encoding: "utf8" } +); + + +const message = ` +Obtained your credentials from the AMQ server. +Please update your .env file with following config: + +MQTT_HOST = ${AMQURL} +MQTT_PORT = 443; +MQTT_PASSWORD = Password1; +MQTT_USERNAME = messaging - user; +MQTT_PROTOCOL = tls; +` +console.log(message); \ No newline at end of file diff --git a/server/package.json b/server/package.json index c5da4b5f..dcb4bd11 100644 --- a/server/package.json +++ b/server/package.json @@ -7,8 +7,9 @@ "startMQTT": "MQTT_HOST=127.0.0.1:1883 ts-node src/index.ts", "build": "tsc", "keycloak": "docker-compose -f ./integrations/keycloak/docker-compose.yml up", + "keycloak:init": "node ./integrations/keycloak/initKeycloak.js", "mqtt": "docker-compose -f ./integrations/mqtt/docker-compose.yml up", - "keycloak:init": "node ./integrations/keycloak/initKeycloak.js" + "amq:config": "node ./integrations/mqtt/configureAMQ.js" }, "license": "MIT", "devDependencies": {