Closed leigh-johnson closed 1 year ago
LGTM :shipit:
Nov 08 06:00:42 camelPi systemd[1]: Started PrintNanny NATS worker.
Nov 08 06:00:42 camelPi printnanny-edge-nats[654]: [2022-11-08T14:00:42Z INFO printnanny_nats::subscriber] Attempting to initialize NATS connection to nats://localhost:4223
Nov 08 06:00:42 camelPi printnanny-edge-nats[654]: [2022-11-08T14:00:42Z INFO async_nats::options] event: connected
Nov 08 06:00:42 camelPi printnanny-edge-nats[654]: [2022-11-08T14:00:42Z WARN printnanny_nats::subscriber] Subscribing to subect pi.camelpi.> with nats client Some(Client { info: Receiver { shared: Shared { v>
Nov 08 06:00:42 camelPi printnanny-edge-nats[654]: [2022-11-08T14:00:42Z WARN printnanny_nats::subscriber] Listening on nats://localhost:4223 where subject=pi.camelpi.>
Describe the bug
Naming your Raspberry Pi with a mixed-case hostname (e.g.
raspberryPi
) will result in 503 errors from the `printnanny-edge-nats.service.This is because the NATS subscriber will attempt to subscribe on the hostname with exact casing:
But the front-end UI code publishes messages to
window.location.hostname
, which is always lowercase: https://github.com/bitsy-ai/printnanny-os-dash/blob/main/src/types/nats.ts#LL36C33-L36C33To Reproduce
What are the steps to reproduce the issue?
raspberryPi
systemctl status printnanny-edge-nats.service
pi.raspberryPi.>
pi.raspberrypi
Expected behavior
Hostname case should not impact PrintNanny OS services
Issue.txt