Repository navigation
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_errorsof/uapi/diagnosticskeeps the cause of a failed
reload: each entry carriesreload_errorandrestore_error, null for a
code that has none. Areload_failed_restoredorreload_failed_unrecovered
also logs auapi-reload-failuresyslog 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 asdnsmasq exited with code 1, and not the output of the daemon after it, which stays in the response.
(#489)dhcp/domainsmodels the local DNS records ofconfig domain, LuCI's
Hostnames:name,ipandinstance. A write reloads dnsmasq and unbound
while procd runs them. The scope isdhcp:domains. (#487) (#498) (#500)dhcp/cnamesmodels the aliases ofconfig cname, LuCI's CNAME tab:
cname,targetandinstance. A write reloads dnsmasq and unbound while
procd runs them. It refuses a wildcardcname, which dnsmasq answers only in
anauth-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 isdhcp:cnames. (#499)- A failed
apk addorapk delanswers the output of apk in
command_output, a new extension field ofinternal_error, and a feed
create whoseapk updatefails answers it inupdate_output, without the
lines that name another feed. Each holds the end of the output that fits in
4096 bytes.
The message andupdate_statuskeep only the text of uapi, such asapk 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 answered500 reload_failed_restoredwithunbound 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 answersX-Reload-Status: unverified. An instance that procd restarts when the write starts is watched
too. (#502) instanceofdhcp/hostscarriesx-uapi-clear-on-omit, as it does on
dhcp/domainsanddhcp/cnames. Without the flag, the Terraform provider
kept aninstancethat the user removed from the configuration, so the
record stayed bound to one dnsmasq instance. A client that reads the flag
removes a storedinstancethat 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 leavesinstanceout removes it, and
a PATCH that leaves it out keeps it. (#501) (#503)- A stored list in
instanceofdhcp/hostsreads as one string, its
values joined with spaces, as dnsmasq.init reads it and asdhcp/domainsand
dhcp/cnamesread it. It read as an array, which the schema does not allow,
and a write of the section then failed with422 conflict. A write still
answers422 conflictfor such a section, because no dnsmasq instance has
that name and dnsmasq.init gives the host to none. (#503) - A write of
dhcp/hostsrefuses anamethat ends with a dot, with422 invalid_formatonname. unbound'sdnsmasq.shadds a dot to the name of
the record thatadd_extra_dnsmakes from a host withdnsset, 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-hostline. 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.mdfor a payload that produced broken state. (#500) - A request that hits an exception that uapi does not catch keeps the
X-Request-Idthat its client sent in the 500, theuapi-internalsyslog
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 inrecent_errorsnow gives the method and the path,
uapi_requests_totalcounts it under thetoken_idof its token, the ACCESS
anduapi-insecure-bypasslines log it as any other request, and the read of
what is left of its body keeps the deadline ofconfig limits. (#494) - The request process no longer reads the whole output of
apk add,apk del,apk update,dnsmasq --testor a failed init script into memory. It
keeps the end that fits in 4096 bytes, after a line...when the command
printed more, whichcommand_output,update_outputandreload_error
quote. A package script that printed megabytes made the request process hold
all of it, on a router with little RAM. The refusal ofdnsmasq --testnow
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 ofrecover_failedinrecent_errors, and the note of
theuapi-dnsmasq-recoverysyslog line, held the output of the init script.
That output can quote any value of the config, and the ring reaches every
token withuapi:diagnostics:ro. The response to the client that sent the
request keeps it. (#489) - The
uapi-pkg-failuresyslog 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-internalsyslog line,/uapi/diagnosticsandrecent_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)