Skip to content

ownbox 1.0.0-beta.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Nov 16:31
· 56 commits to main since this release

A robustness and security pass, every part tried on the Pirate Radio: a box that keeps its
settings through a power cut, its queue through a server outage and its network next to an
access point it cannot join; a broken update that puts itself back; and a setup Wi-Fi
nobody can use to take a box over.

Added

  • The box moves to a clearly stronger access point of its network. NetworkManager stays
    with the one it joined until that one is gone, so a box left beside an old router kept a
    weak signal while a new one sent the same network next to it. Checked every two minutes;
    the saved connection is not changed. An access point that refuses the box is not tried
    again until ownbox restarts.
  • The Wi-Fi chip's own roaming is switched off (/etc/modprobe.d/ownbox-brcmfmac.conf). On
    the Pirate Radio it kept moving to an access point that refused it and dropped the
    network every few seconds for an hour.

Fixed

  • Settings are written whole or not at all: prefs.json goes through a temporary file, is
    flushed to the card and renamed. A power cut mid-write used to leave a broken file, and
    then the box started from defaults — without its sign-in, sound card or paired phones. An
    unreadable file is now kept aside as prefs.json.bad instead of being overwritten.
  • config.txt (FAT, no journal) is flushed to the card before it replaces the old one and
    before the box restarts, and two runs of boot-config.sh at boot can no longer write it
    at once.
  • A few volume steps in quick succession no longer stop AirPlay and Music Assistant
    settings from ever being written again (systemd's start limit failed their path unit).
  • An update that keeps crashing after it started is put back: five failed starts in two
    minutes and ownbox-recover returns to the previous version if an update came in the
    last day, once per version, then starts ownbox again — also without an update, after a
    pause, instead of leaving the box silent. Installing an update checks each step, so a full
    card cannot leave the box without either version.
  • ownbox-boot.sh writes config.toml only when the screen setting changes, and never
    through a link put in its place.
  • A server out of reach while one song ends and the next is prepared no longer ends the
    queue and forgets it: the next entry is asked for again every 15 s, and if the box runs
    out before it arrives, the queue waits at that entry, paused. Tried on the Pirate Radio
    with the server blocked.
  • An mpv that still runs but no longer answers is killed after 30 s and started again; the
    queue waits at its last position. Before, the box stayed silent until a reboot.
  • mpv reads at most 24 MiB ahead (it was 150 MiB, on a Zero 2 W with 512 MiB in all).
  • A 400 or 403 when the sign-in is renewed (a proxy, a firewall) no longer signs the box
    out for good; only the server's 401 does.
  • A failed update check is tried again within the hour, not a day later. An nmcli that
    hangs is killed with its timeout. A setup Wi-Fi that NetworkManager dropped is opened
    again instead of being counted as open.

Changed

  • A box that knows a network waits five minutes without it before opening its setup Wi-Fi
    (a new box still a minute), so a router restarting does not open a network without a
    password.

Security

  • A phone can no longer pair over the setup Wi-Fi. It has no password (the Zero 2 W cannot
    send a WPA3 network), so anyone near a box that lost its network could have paired and
    taken over a box without a screen. Pairing works on the home network only.
  • ownbox answers only to its own names: an address, localhost, a .local name or a bare
    host name. A web page elsewhere that points its own name at the box (DNS rebinding) gets
    421, so it cannot pair itself to a new box, which pairs its first phone without a code.
  • The box's name and sound output are cleaned before they reach AirPlay's and
    Squeezelite's settings, which a root script writes from what ownbox saved: no new lines,
    quotes, backslashes or $, and the output must be an ALSA name or the best card is used.
  • Ids from the server are percent-encoded in every server path.

Documentation

  • README: why the setup Wi-Fi is open, and what home Wi-Fi the box joins: WPA2 on 2.4 GHz
    (a Zero 2 W cannot join a MikroTik ax WPA2/WPA3 network), several access points with one
    name.