Compare commits

...

10 Commits

Author SHA1 Message Date
Anton Roslund
1ee526caf7 Collect is_unmessagable, and public_key. 2025-08-06 19:48:26 +02:00
Anton Roslund
a7b99c3027 Merge pull request #21 from Roslund/use-protobuf-submodule
Load protobufs from submodule
2025-08-04 12:29:40 +02:00
Anton Roslund
b668892248 Merge pull request #18 from Roslund/dependabot/npm_and_yarn/prisma/client-6.13.0
Bump @prisma/client from 6.12.0 to 6.13.0
2025-08-04 07:39:14 +02:00
Anton Roslund
0053b9f774 Merge pull request #19 from Roslund/dependabot/npm_and_yarn/prisma-6.13.0
Bump prisma from 6.12.0 to 6.13.0
2025-08-04 07:39:01 +02:00
dependabot[bot]
435c122c21 Bump prisma from 6.12.0 to 6.13.0
Bumps [prisma](https://github.com/prisma/prisma/tree/HEAD/packages/cli) from 6.12.0 to 6.13.0.
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/6.13.0/packages/cli)

---
updated-dependencies:
- dependency-name: prisma
  dependency-version: 6.13.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-04 05:36:35 +00:00
Anton Roslund
c5028f911f Merge pull request #20 from Roslund/dependabot/npm_and_yarn/mqtt-5.14.0
Bump mqtt from 5.13.2 to 5.14.0
2025-08-04 07:36:04 +02:00
Anton Roslund
7fee84de77 Merge pull request #17 from Roslund/dependabot/npm_and_yarn/jest-30.0.5
Bump jest from 30.0.4 to 30.0.5
2025-08-04 07:35:11 +02:00
dependabot[bot]
ca9d1d9de0 Bump mqtt from 5.13.2 to 5.14.0
Bumps [mqtt](https://github.com/mqttjs/MQTT.js) from 5.13.2 to 5.14.0.
- [Release notes](https://github.com/mqttjs/MQTT.js/releases)
- [Changelog](https://github.com/mqttjs/MQTT.js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mqttjs/MQTT.js/compare/v5.13.2...v5.14.0)

---
updated-dependencies:
- dependency-name: mqtt
  dependency-version: 5.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-30 21:20:37 +00:00
dependabot[bot]
8eb5c695f0 Bump @prisma/client from 6.12.0 to 6.13.0
Bumps [@prisma/client](https://github.com/prisma/prisma/tree/HEAD/packages/client) from 6.12.0 to 6.13.0.
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/6.13.0/packages/client)

---
updated-dependencies:
- dependency-name: "@prisma/client"
  dependency-version: 6.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-29 20:45:41 +00:00
dependabot[bot]
e27f92d5c6 Bump jest from 30.0.4 to 30.0.5
Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 30.0.4 to 30.0.5.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.0.5/packages/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-version: 30.0.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22 20:51:12 +00:00
5 changed files with 946 additions and 403 deletions

1296
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,17 +9,17 @@
"author": "",
"license": "ISC",
"dependencies": {
"@prisma/client": "^6.12.0",
"@prisma/client": "^6.13.0",
"command-line-args": "^6.0.1",
"command-line-usage": "^7.0.3",
"compression": "^1.8.1",
"cors": "^2.8.5",
"express": "^5.0.0",
"mqtt": "^5.13.2",
"mqtt": "^5.14.0",
"protobufjs": "^7.5.3"
},
"devDependencies": {
"jest": "^30.0.4",
"prisma": "^6.12.0"
"jest": "^30.0.5",
"prisma": "^6.13.0"
}
}

View File

@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE `nodes` ADD COLUMN `is_unmessagable` BOOLEAN NULL,
ADD COLUMN `public_key` VARCHAR(191) NULL;

View File

@@ -21,6 +21,8 @@ model Node {
hardware_model Int
role Int
is_licensed Boolean?
public_key String?
is_unmessagable Boolean?
firmware_version String?
region Int?

View File

@@ -917,7 +917,6 @@ client.on("message", async (topic, message) => {
else if(portnum === 4) {
const user = User.decode(envelope.packet.decoded.payload);
let isOkToMqtt = null
if(logKnownPacketTypes) {
console.log("NODEINFO_APP", {
@@ -926,7 +925,9 @@ client.on("message", async (topic, message) => {
});
}
// check if bitfield is available, then check if ok-to-mqtt
// check if bitfield is available, then set ok-to-mqtt
// else leave undefined to let Prisma ignore it.
let isOkToMqtt
if(bitfield != null){
isOkToMqtt = Boolean(bitfield & BITFIELD_OK_TO_MQTT_MASK);
}
@@ -944,15 +945,17 @@ client.on("message", async (topic, message) => {
hardware_model: user.hwModel,
is_licensed: user.isLicensed === true,
role: user.role,
// Since packages beeing forwarded by older firmwars dropps the bitfield
// We only want to set form nodes that have the bitfield set.
// That way we can get a more correct reading firmware status in the mesh.
// This works since we had the old code:
// firmware_version: (bitfield != null) ? '2.5.0 or newer' : '2.4.3 or older',
...(bitfield != null && {
firmware_version: '2.5.0 or newer',
ok_to_mqtt: isOkToMqtt,
}),
is_unmessagable: user.isUnmessagable,
ok_to_mqtt: isOkToMqtt,
firmware_version: '<2.5.0',
...(user.publicKey != '' && {
firmware_version: '>2.5.0',
public_key: user.publicKey?.toString("base64"),
}),
...(user.isUnmessagable != null && {
firmware_version: '>2.6.8',
}),
},
update: {
long_name: user.longName,
@@ -960,9 +963,16 @@ client.on("message", async (topic, message) => {
hardware_model: user.hwModel,
is_licensed: user.isLicensed === true,
role: user.role,
...(bitfield != null && {
firmware_version: '2.5.0 or newer',
ok_to_mqtt: isOkToMqtt,
is_unmessagable: user.isUnmessagable,
ok_to_mqtt: isOkToMqtt,
firmware_version: '<2.5.0',
...(user.publicKey != '' && {
firmware_version: '>2.5.0',
public_key: user.publicKey?.toString("base64"),
}),
...(user.isUnmessagable != null && {
firmware_version: '>2.6.8',
}),
},
});
@@ -1429,6 +1439,6 @@ client.on("message", async (topic, message) => {
}
} catch(e) {
// ignore errors
console.log("error", e);
}
});