Skip to content

v4.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 19:17
v4.1.0

This release adds dhcp/domains and dhcp/cnames, the cause of a failed
reload in recent_errors, and the output of apk in the answer to a failed
package write. It also keeps the output of commands and the messages of
interpreter errors out of syslog and the diagnostics ring, because they can
quote config values. A write of dhcp/hosts now refuses a name that ends
with a dot, because unbound does not start with the record that it makes from
it, and its instance carries x-uapi-clear-on-omit, so that a client can
remove it. On OpenWrt main, a write that restarts unbound no longer fails
while procd restarts it. Upgrade every 4.0.x install. uapi-mcp shows the new
fields from 4.0.1.

From this release, a minor ships on the first Monday of a month, and a fix
ships as a patch when it is ready.

Added

  • recent_errors of /uapi/diagnostics keeps the cause of a failed
    reload
    : each entry carries reload_error and restore_error, null for a
    code that has none. A reload_failed_restored or reload_failed_unrecovered
    also logs a uapi-reload-failure syslog line with the request id and both
    fields. Before, the cause was only in the response, so nothing told why a
    reload failed once a client dropped the field or lost the response. The ring
    and the line keep the text that uapi writes, such as dnsmasq exited with code 1, and not the output of the daemon after it, which stays in the response.
    (#489)
  • dhcp/domains models the local DNS records of config domain, LuCI's
    Hostnames: name, ip and instance. A write reloads dnsmasq and unbound
    while procd runs them. The scope is dhcp:domains. (#487) (#498) (#500)
  • dhcp/cnames models the aliases of config cname, LuCI's CNAME tab:
    cname, target and instance. A write reloads dnsmasq and unbound while
    procd runs them. It refuses a wildcard cname, which dnsmasq answers only in
    an auth-zone, and a final dot, from which unbound makes a name that it
    refuses. It also refuses a name that is too long, an alias that points to
    itself, and an alias that another section gives to the same dnsmasq instance,
    because dnsmasq does not start with them. The scope is dhcp:cnames. (#499)
  • A failed apk add or apk del answers the output of apk in
    command_output
    , a new extension field of internal_error, and a feed
    create whose apk update fails answers it in update_output, without the
    lines that name another feed. Each holds the end of the output that fits in
    4096 bytes.
    The message and update_status keep only the text of uapi, such as apk add failed (exit 1), and no longer point to syslog. Neither does the message of a
    failed password set, whose syslog line holds only the user name and the exit
    code. (#491) (#498)

Fixed

  • A write that restarts unbound no longer fails while procd restarts it.
    On OpenWrt main, procd lists the instance that it restarts as stopped, with
    the exit code 0 of the old process, until the cgroup of that process drains.
    uapi read that as a stop, restored the previous config and answered 500 reload_failed_restored with unbound stopped after the reload, with exit code 0, for a write that worked. A stop with exit code 0 no longer counts: procd
    stops unbound with SIGTERM, on which it exits 0, and unbound exits 1 on a
    config that it refuses. Such an instance must run again in the 2 s of the
    watch, else the write keeps its commit and answers X-Reload-Status: unverified. An instance that procd restarts when the write starts is watched
    too. (#502)
  • instance of dhcp/hosts carries x-uapi-clear-on-omit, as it does on
    dhcp/domains and dhcp/cnames. Without the flag, the Terraform provider
    kept an instance that the user removed from the configuration, so the
    record stayed bound to one dnsmasq instance. A client that reads the flag
    removes a stored instance that its configuration does not set, and the
    record goes to every instance again, as when a LuCI user empties the field.
    The server does not change: a PUT that leaves instance out removes it, and
    a PATCH that leaves it out keeps it. (#501) (#503)
  • A stored list in instance of dhcp/hosts reads as one string, its
    values joined with spaces, as dnsmasq.init reads it and as dhcp/domains and
    dhcp/cnames read it. It read as an array, which the schema does not allow,
    and a write of the section then failed with 422 conflict. A write still
    answers 422 conflict for such a section, because no dnsmasq instance has
    that name and dnsmasq.init gives the host to none. (#503)
  • A write of dhcp/hosts refuses a name that ends with a dot, with 422 invalid_format on name. unbound's dnsmasq.sh adds a dot to the name of
    the record that add_extra_dns makes from a host with dns set, without
    removing the one that is there, and unbound does not start with a name that
    ends with two. A client drops the final dot, which dnsmasq ignores in a
    dhcp-host line. A stored name with a final dot still reads, and a write of
    another field keeps it. This tightening uses the carve-out of
    docs/versioning.md for a payload that produced broken state. (#500)
  • A request that hits an exception that uapi does not catch keeps the
    X-Request-Id that its client sent
    in the 500, the uapi-internal syslog
    line and the ERROR audit line, and the audit line names its token once uapi
    resolved it. Before, all three carried a new id, and the audit line the token
    -, so a search of syslog for the id of the client did not find them. Its
    entry in recent_errors now gives the method and the path,
    uapi_requests_total counts it under the token_id of its token, the ACCESS
    and uapi-insecure-bypass lines log it as any other request, and the read of
    what is left of its body keeps the deadline of config limits. (#494)
  • The request process no longer reads the whole output of apk add, apk del, apk update, dnsmasq --test or a failed init script into memory. It
    keeps the end that fits in 4096 bytes, after a line ... when the command
    printed more, which command_output, update_output and reload_error
    quote. A package script that printed megabytes made the request process hold
    all of it, on a router with little RAM. The refusal of dnsmasq --test now
    quotes the last line of its output, where dnsmasq prints the error that it
    stops on. (#495) (#498)

Security

  • The output that a failed reload, restore or recovery quotes no longer
    reaches the diagnostics ring or syslog.
    After a stop or a start that
    failed, the message of recover_failed in recent_errors, and the note of
    the uapi-dnsmasq-recovery syslog line, held the output of the init script.
    That output can quote any value of the config, and the ring reaches every
    token with uapi:diagnostics:ro. The response to the client that sent the
    request keeps it. (#489)
  • The uapi-pkg-failure syslog line no longer holds the output of apk,
    which quotes what the scripts of a package print. It keeps the action, the
    name and the exit code. (#491)
  • The uapi-internal syslog line, /uapi/diagnostics and recent_errors
    no longer hold the message of an error of the interpreter
    , which can quote
    the value that it failed on, a write-only key among them. They give its type
    and the place where it was raised. The message of an error that uapi raises
    with its own text stays. Before, a write turned each error into one of the
    second kind with the same message. (#491)