Skip to content

mc-webui 2.20.0

Latest

Choose a tag to compare

@MarekWo MarekWo released this 30 Nov 07:15

This release is mostly fixes. The Security ones close several ways a password or a channel key could be seen, or an update started, by someone who should not be able to. Updating is recommended for everyone, and first of all for instances that run in demo mode or have the optional update service installed.

Security

  • The update service's own port no longer takes orders from your whole network. The optional update service (the one behind Update now, port 5050 on the host) started an update, as root, for anyone who could reach that port, and a web page open in a browser on the same network could trigger it too. The port now answers only the host itself and the containers running on it, ignores requests that come from a web page, and writes every refused request to its log with the address it came from (journalctl -u mc-webui-updater). The Update now button in the web interface works as before, for anyone who can open the interface.

  • Passwords typed into the console are no longer written to the log or the command history. A line such as login <name> <password>, set pin <pin> or cmd <name> password <new> was logged whole, which put the password into the log viewer, docker logs and any diagnostics capture, and it was saved in the console's command history and transcript. The log and the transcript now show *** in its place, and the history keeps the command without the password, so recalling it asks you to type the password again. History and transcript files written by earlier versions are cleaned the first time they are read.

  • Debug logs no longer show passwords inside raw radio frames. With MC_LOG_LEVEL=DEBUG, or while a diagnostics capture records debug logs, every frame sent to the radio is logged, and some carry a repeater password, a remote command, the device PIN, a channel key or a private key. The secret part is now replaced with ***. Frames received from the radio are still logged whole at that level, so look through a debug log before you share it. If you shared one recorded with an earlier version, change the passwords used while it was recorded.

  • A saved repeater password can no longer be read back from the server. To spare you retyping after a failed login, the login prompt under My Repeaters used to fetch the saved admin password and fill it in, which meant anyone who could reach the interface could ask the server for it too. The server no longer hands it out. After a failed login to a repeater with a saved password, leave the field empty and press Log in to try again with the saved one, or type a different password. One thing is lost with this: the eye button can no longer reveal a password you saved earlier.

  • Demo mode no longer hands channel keys to visitors or lets them use your repeater logins. On an instance running with MC_DEMO=true, a visitor who had not unlocked it could still read every channel's shared key, from the channel list and from the channel's QR code, and could query any repeater you were logged in to (status, telemetry, settings, regions, neighbours, clock), each request going out over the radio under your login. While locked, the channel list now comes without keys, and the QR code and those repeater requests are refused. Nothing changes once the instance is unlocked, or on installations that do not use demo mode.

  • Demo mode: visitors can no longer reach repeaters through direct messages. Repeaters, room servers and sensors treat some direct messages as commands when the sender has rights on them, and the radio sends with its owner's rights. A visitor may now send direct messages to chat contacts only, and the conversations with repeaters, room servers and sensors are hidden from visitors. The unlocked owner keeps full access.

Fixes

  • The contacts page is no longer empty for a minute after a restart over Bluetooth. Over BLE the app could stop waiting for the radio's contact list while the radio was still sending it, so it started with no contacts, showed an empty list for the next minute and did not refresh its stored contacts until the next restart. The app now waits for the list that is on its way, does not keep an empty list, and updates its stored contacts when the list arrives.

  • Contacts keep their type and flags. Receiving a direct message rewrote the sender's stored contact as a plain chat contact and cleared its flags, so a repeater that replied to a remote command became a chat contact. Every advert cleared a contact's flags (favourite, telemetry) in the app's list until the next contact sync, and an advert from a contact known only from earlier adverts reset its type too. Any update that does not know the type or the flags now leaves them as stored. A contact the radio adds by itself is also saved with its flags and route, and so is one that announces itself again while it is already on the radio with manual approval on. The type and flags are now taken from the radio's contact list, or kept as they were stored.

  • A direct message from a contact the radio knows but the app has not stored yet shows the sender's name. The name was looked up under the wrong field of the radio's contact list, so such a message appeared under the start of the sender's key, and the contact was saved without a name.

  • A channel no longer vanishes when the radio does not answer right after a message is sent. After each channel message the app reads the channel back from the radio. When that read timed out or came back empty, the app took it to mean the channel had been removed and deleted it from its list, and the message lost its repeater tracking. A failed read now changes nothing; channels are still pruned when the radio itself reports a slot as empty.

  • GET /api/advertisements works again. The advert history route answered 500 Internal Server Error as soon as any advert was stored. The web page does not use this route, so only API users were affected.

  • A direct message from a contact the app had not loaded yet no longer creates a nameless half-contact. The radio names a message's sender by the start of its key only. When the app did not have that contact yet, for example one the radio had just added by itself, it filed the message under a new contact keyed by that fragment, apart from the real one. The app now reloads the radio's contacts and files the message under the right contact. If even that fails, the message is kept without a contact and joins the right conversation as soon as the contact is known, on the sender's next message or the next contact sync.

  • Sending a direct message through the API answers with a status that fits the error. Every failed send used to come back as 500 Internal Server Error, including a mistake on the caller's side. Now an unknown contact is 404, a missing field or a key prefix that matches several contacts is 400, and a radio that is not connected is 503. 500 is left for a radio that refused the message or did not answer. The web page shows the same messages as before.

  • A repeater or contact command given a shortened key no longer goes to a guessed contact. Console commands that take a contact (login, cmd, req_status, change_path, remove_contact and the rest) accepted the start of a public key and used the first contact it matched. When two contacts start the same way, the command now stops and asks for a longer prefix or the full key. Names work as before.

  • A direct message the radio refused now says why. The error used to read only Device error sending DM: with nothing after it. It now names the radio's reason, for example a full table, and when the radio did not answer at all it says so.

  • A direct message addressed by the start of a public key is stored and retried. When the recipient was given as a key prefix rather than the full key (in the web UI or the API, or with the console's msg), the message went out over the radio, but the app then reported an error, kept no copy and never retried it. The prefix is now turned into the contact's full key before anything is sent. A prefix that matches more than one contact is refused before sending, and the error asks for a longer prefix, so a message can no longer go to whichever of two contacts happened to come first.

  • A channel message the radio did not take is no longer shown as sent. When the radio refused a message, or never answered, the message was still stored and displayed as sent. The same happened one step earlier with the region: if the radio did not confirm the region for the channel, the message went out anyway, under whatever region the previous message had used. Both cases now end with an error and nothing is stored, so the conversation shows what actually left the radio.

  • Channels no longer disappear after a restart when earlier channels were removed. Removing a channel leaves its slot on the radio empty. With three or more empty slots in a row, the app stopped reading the channel list there on the next connection and then forgot every channel further down, even though the radio still had them. It now reads every slot, and forgets a channel only when the radio itself reports that slot as empty.

  • A channel's history is deleted only when the channel really is removed. Removing a channel deleted its messages first and asked the radio second, so a removal the radio did not carry out, or never answered, still cost the whole history. A direct request to remove the Public channel wiped its history and then failed, because that channel cannot be removed. The radio is now asked first, the history goes only after it confirms, and the Public channel is refused before anything is touched.

  • Sent direct messages no longer move to another contact. When a contact was deleted from the cache, the direct messages you had sent it were left without an owner, and the next contact you added, whoever it was, received all of them in its conversation. Sent messages now return only to the contact they were sent to, if it is added again. Messages that lost their owner before this fix cannot be attributed to anyone and stay hidden rather than appear under the wrong name.

  • A different radio no longer takes over the previous radio's history. Each radio has its own database file. When you connected a radio the installation had not seen before, the app renamed the previous radio's file to the new radio's name, so the new radio started with the old one's messages, contacts and settings mixed into its own. A radio that is new to the installation now starts with an empty database, and the previous radio's file is left untouched for when that radio returns. The log says which file was set aside and which one was started.

  • Power off works for repeaters (My Repeaters → Actions). The confirmation asks you to type the repeater's name, and the server then compared what you typed with a name it never had, so every attempt ended with Type the repeater name to confirm this action. It now compares with the name shown on the page.

  • A repeater's neighbour list can no longer be cleared by accident. A removal request that named no neighbour, such as an empty or malformed one, was passed on to the repeater, which reads it as "remove them all". Clearing the whole list now has to be asked for explicitly, which is what Remove all does; anything else without a neighbour is refused.

  • Changing only the latitude or only the longitude no longer zeroes the other one. A settings request that carried one coordinate set the missing one to 0, moving the radio's advertised position to the equator or the prime meridian. The other coordinate is now kept as it is on the radio. The console's set lat and set lon are safer in the same way: if the current position cannot be read back from the radio, they report it instead of sending 0.

  • Contact cleanup removes exactly the contacts it listed. Cleanup deleted each matched contact by its name. With two contacts sharing a name, the wrong one could be removed, for example a companion instead of the repeater the filter had selected. Contacts are now deleted by their key.

  • The console shows the battery again. bat always answered Battery info unavailable and status showed no voltage, because the radio's reply was read the wrong way. Both now show what the radio reports.

  • The watchdog stops restarting the app every 40 seconds while a network radio is unreachable. With a radio connected over WiFi/TCP or Bluetooth, a restart cannot bring back a radio that has stopped answering, yet the watchdog kept restarting the container about every 40 seconds for as long as the radio stayed silent (71 times during one 75-minute outage), and each restart dropped repeater logins and messages still being retried. After three restarts that do not help, it now waits 2 minutes, then 4, then 8, up to 15 minutes between attempts, logging each skipped restart with the time of the next one, and goes back to normal once the radio has been connected for 5 minutes. USB radios keep the old behaviour, including the USB reset after three quick restarts.

  • The app reconnects by itself to a radio that was off when it started. If the radio did not answer during the ten connection attempts at startup, the app stopped trying, and it stayed disconnected after the radio came back, until the next restart of the container. It now keeps trying every minute, as it already did after losing a connection, so a radio over WiFi/TCP or USB is picked up within about a minute of coming back. Bluetooth radios are unchanged: they still need a container restart for a clean connection, which the watchdog does.

Deploy notes

Nothing here is needed for the app to run: after a normal update everything works, including Update now. Two services on the host keep running their old code until you restart them, and the fixes to them wait until then.

  • Update service (recommended, security). Update mc-webui first, then refresh the service. Doing it the other way round makes Update now fail until mc-webui is updated by hand.

    • Installed from source (git checkout): restart it once after updating:
      sudo systemctl restart mc-webui-updater
      From the next update on, the update script does this by itself whenever the service is older than the checkout. If you start that update from the web interface, the restart follows about 45 seconds after it finishes; do not start another update in that time.
    • Installed from Docker Hub: run the installer line from the README (Remote updates from web GUI) again. Until you do, the update window shows a reminder.
    • If Update now stops working after that, look at journalctl -u mc-webui-updater: a refused request is logged with its address, and a container on a network the service does not recognise can be allowed with UPDATER_ALLOW_NETS (see the README).
  • Watchdog. mcupdate does not restart it. To get the new restart policy:

    sudo systemctl restart mc-webui-watchdog
  • If you call the API from your own scripts: the route that returned a saved repeater password (GET /api/repeaters/<key>/password) is gone, and a failed POST /api/dm/messages now answers with 400, 404 or 503 where it used to answer 500.