fixing typos

This commit is contained in:
cheetah 2025-04-05 03:59:53 +02:00
parent 42b2d359ae
commit 7ea860b79c
5 changed files with 147 additions and 42 deletions

86
config.default.json Normal file
View file

@ -0,0 +1,86 @@
{
"general": {
"port": 3000,
"configPort": 3001,
"configWebInterfaceEnabled": true
},
"connectors": {
"dummy": {
"enabled": true,
"duplexTimeout": 300
},
"pocsag": {
"enabled": false,
"duplexTimeout": 300,
"mqttserver": "mqtt://host:1883",
"username": "",
"password": "",
"topic": "pocsagtx/transmit"
},
"pagernetzAT": {
"enabled": false,
"duplexTimeout": 300
},
"ecityruf": {
"enabled": false,
"duplexTimeout": 180
},
"emPuppettering": {
"enabled": false,
"duplexTimeout": "250"
},
"emessage": {
"enabled": false,
"username": "",
"password": "",
"duplexTimeout": 180,
"responseTimeout": 320,
"startInterval": 5,
"2wayS_BackChannel": true
},
"lorawan": {
"enabled": false,
"duplexTimeout": 1800,
"mqttserver": "mqtt://eu1.cloud.thethings.network:1883",
"username": "",
"password": ""
},
"dapnet": {
"enabled": false,
"endpoint": "http://<DAPNETCore>:8080/calls",
"username": "test",
"password": "testsucks",
"duplexTimeout": 300
},
"pnet": {
"enabled": false,
"duplexTimeout": 10
},
"tetracontrol": {
"enabled": false,
"endpoint": "<TC_IP>:80",
"username": "user",
"password": "password",
"duplexTimeout": 300
}
},
"pagers": {
"birdyslim": {
"enabled": false,
"rxchain": {
"lorawan": false,
"events": {
"webhook": false,
"mqtt": false
}
}
}
},
"boskrypt": {
"enabled": false,
"keys": {
}
},
"deliveryPresets": {
}
}

View file

@ -153,7 +153,7 @@
</v-list-item-action>
</v-list-item-content>
</v-list-item>
<v-list-item> <!-- TETRACONTROL-->
<v-list-item v-if="configData.connectors.tetracontrol"> <!-- TETRACONTROL-->
<v-list-item-content>
<v-list-item-title>TETRACONTROL</v-list-item-title>
<v-list-item-action>
@ -177,7 +177,7 @@
</v-list-item-action>
</v-list-item-content>
</v-list-item>
<v-list-item> <!-- LoRaWAN-->
<v-list-item v-if="configData.connectors.lorawan"> <!-- LoRaWAN-->
<v-list-item-content>
<v-list-item-title>LoRaWAN</v-list-item-title>
<v-list-item-action>
@ -202,7 +202,7 @@
</v-list-item-content>
</v-list-item>
<v-divider></v-divider>
<v-list-item> <!-- e*Cityruf (inetgw) -->
<v-list-item v-if="configData.connectors.ecityruf"> <!-- e*Cityruf (inetgw) -->
<v-list-item-content>
<v-list-item-title>e*Cityruf (inetgw)</v-list-item-title>
<v-list-item-action>
@ -218,7 +218,7 @@
</v-list-item-content>
</v-list-item>
<v-divider></v-divider>
<v-list-item> <!-- e*Message Puppeteering -->
<v-list-item v-if="configData.connectors.emPuppettering"> <!-- e*Message Puppeteering -->
<v-list-item-content>
<v-list-item-title>e*Message Puppeteering</v-list-item-title>
<v-list-item-action>
@ -234,7 +234,7 @@
</v-list-item-content>
</v-list-item>
<v-divider></v-divider>
<v-list-item> <!-- e*Message alertManager -->
<v-list-item v-if="configData.connectors.emessage"> <!-- e*Message alertManager -->
<v-list-item-content>
<v-list-item-title>e*Message alertManager</v-list-item-title>
<v-list-item-action>
@ -265,7 +265,7 @@
</v-list-item-content>
</v-list-item>
<v-divider></v-divider>
<v-list-item> <!-- pagernetz.at -->
<v-list-item v-if="configData.connectors.pagernetzAT"> <!-- pagernetz.at -->
<v-list-item-content>
<v-list-item-title>pagernetz.at</v-list-item-title>
<v-list-item-action>
@ -387,9 +387,9 @@
},
pagers: {
birdyslim: {
enabled: true,
enabled: false,
rxchain: {
lorawan: true,
lorawan: false,
events: {
webhook: false,
mqtt: false
@ -399,24 +399,36 @@
},
connectors: {
dummy: {
enabled: null, duplexTimeout: null,
enabled: false, duplexTimeout: null,
},
pocsag: {
enabled: null, duplexTimeout: null,
enabled: false, duplexTimeout: null, mqttserver: "", username: "", password: "", topic: "",
},
dapnet: {
enabled: null, duplexTimeout: null,
enabled: false, duplexTimeout: null, endpoint: "", username: "", password: "",
},
lorawan: {
enabled: false, duplexTimeout: null, mqttserver: "", username: "", password: "",
},
tetracontrol: {
enabled: null, duplexTimeout: null,
enabled: false, duplexTimeout: null, endpoint: "", username: "", password: "",
},
pnet: {
enabled: false, duplexTimeout: null,
},
pagernetzAT: {
enabled: false, duplexTimeout: null,
},
emessage: {
enabled: false, duplexTimeout: null,
},
ecityruf: {
enabled: null, duplexTimeout: null,
enabled: false, duplexTimeout: null,
},
emPuppettering: {
enabled: null, duplexTimeout: null,
enabled: false, duplexTimeout: null,
},
}
},

View file

@ -1,12 +1,13 @@
// const amqp = require('amqp-connection-manager')
const fs = require('fs')
const config = require('./config.json')
const actualConfig = require('./config.json')
const defaultConfig = require('./config.default.json')
const config = defaultConfig
Object.assign(config.deliveryPresets, actualConfig.deliveryPresets)
Object.assign(config.boskrypt, actualConfig.boskrypt)
Object.assign(config.general, actualConfig.general)
Object.assign(config.pagers, actualConfig.pagers)
Object.assign(config.connectors, actualConfig.connectors)
// Create a connetion manager
// const connection = amqp.connect(config.general.amqp)
// connection.on('connect', () => console.log('Connected to AMQP.'))
// connection.on('disconnect', err => console.log('Disconnected from AMQP.', err.stack))
const connection = null
const types = require('./types') // also initializes the registries, if they havent been loaded
@ -181,24 +182,31 @@ types.DeviceRegistry.events.on('event', (deviceType, deviceId, eventData) => {
/** CONFIG Routes */
appConfig.get('/config', async (req, res) => {
const parsedConfig = JSON.parse(fs.readFileSync('config.json'))
parsedConfig.deliveryPresets = parsedConfig.deliveryPresets || {
'example': {
"name": "Normal",
"params": {
"type": "duplex",
"routing": {
"device": "generic",
"connectors": [
[
"dummy",
"1234"
]
]
}
},
}
}
const actualConfig = JSON.parse(fs.readFileSync('./config.json'))
const defaultConfig = JSON.parse(fs.readFileSync('./config.default.json'))
const parsedConfig = defaultConfig
Object.assign(parsedConfig.deliveryPresets, actualConfig.deliveryPresets)
Object.assign(parsedConfig.boskrypt, actualConfig.boskrypt)
Object.assign(parsedConfig.general, actualConfig.general)
Object.assign(parsedConfig.pagers, actualConfig.pagers)
Object.assign(parsedConfig.connectors, actualConfig.connectors)
// parsedConfig.deliveryPresets = parsedConfig.deliveryPresets || {
// 'example': {
// "name": "Normal",
// "params": {
// "type": "duplex",
// "routing": {
// "device": "generic",
// "connectors": [
// [
// "dummy",
// "1234"
// ]
// ]
// }
// },
// }
// }
return res.json(parsedConfig)
})
appConfig.post('/config', async (req, res) => {

View file

@ -17,7 +17,7 @@ class POCSAGConnector extends Connector {
password: config.connectors.pocsag.password,
connectTimeout: 10,
})
this.client.on('error', (x) => console.error(e))
this.client.on('error', (e) => console.error(e))
this.client.on('connect', this.onMQTTConnect.bind(this))
this.client.on('message', this.onMQTTMessage.bind(this))
console.log("pocsag connector initalized",

View file

@ -1,8 +1,6 @@
const Connector = require("./Connector")
const config = require('../../config.json')
const md5 = require('md5')
const axios = require('axios')
const { io } = require("socket.io-client")
class pNetConnector extends Connector {
@ -15,6 +13,7 @@ class pNetConnector extends Connector {
async transmitMessage(msg, params) {
console.log('pnet socket=',this.managementSocket)
if (!this.managementSocket) {
const { io } = require("socket.io-client")
console.log('starting pnet socket')
this.managementSocket = io("wss://<pnet url>")
this.managementSocket.on('smartpager:ingress:event', (evt) => {