Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
fix: change amqconfig printing format
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki committed Jun 17, 2020
1 parent 3785a4c commit b09bf81
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/forms/TaskForm.js
Original file line number Diff line number Diff line change
@@ -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}) {
Expand All @@ -11,7 +11,7 @@ export function TaskForm({model, handleSubmit}) {
>
<ErrorsField />
<AutoFields />
<HiddenField name="version" value={model.version ?? 1} />

<SubmitField />
</AutoForm>
)
Expand Down
19 changes: 19 additions & 0 deletions server/integrations/mqtt/configureAMQ.js
Original file line number Diff line number Diff line change
@@ -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);
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit b09bf81

Please sign in to comment.