treewide: rework uci apply workflow
authorJo-Philipp Wich <jo@mein.io>
Thu, 26 Apr 2018 06:52:55 +0000 (08:52 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 5 May 2018 21:11:23 +0000 (23:11 +0200)
commit8deb9495515b97898514e8ffb8f002c8afe3bfa7
tree65d4d7b831c273329c0a79a6b9e4a547e760481b
parent7cca3139591a08e62b7900115fe0bfd4a3df8f8a
treewide: rework uci apply workflow

Switch to rpcd based uci apply/rollback workflow which helps to avoid soft-
bricking devices by requiring an explicit confirmation call after config
apply.

When a user now clicks "Save & Apply", LuCI first issues a call to uci apply
which commits and reloads configuration, then goes into a polling countdown
mode where it repeatedly attempts to call uci confirm.

If the committed configuration is sane, the confirm call will go through and
cancel rpcd's pending rollback timer.

If the configuration change leads to a loss of connectivity (e.g. due to bad
firewall rules or similar), the rollback mechanism will kick in after the
timeout and revert configuration files and pending changes to the pre-apply
state.

In order to cover such rare cases where a lost of connectivity is expected
and desired, the user is offered an "unchecked" apply option after timing
out, which allows committing and applying the changes anyway, without the
extra safety checks.

As a consequence of this change, the luci-reload mechanism is now completely
unsused since rpcd uses ubus config reload signals to reload affected
services, which means that only procd-enabled services will receive proper
reload treatment with the new workflow.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
14 files changed:
applications/luci-app-radicale/luasrc/view/radicale/tabmap_nsections.htm
modules/luci-base/luasrc/cbi.lua
modules/luci-base/luasrc/controller/admin/servicectl.lua [deleted file]
modules/luci-base/luasrc/dispatcher.lua
modules/luci-base/luasrc/model/uci.lua
modules/luci-base/luasrc/model/uci.luadoc
modules/luci-base/luasrc/view/cbi/apply_widget.htm [new file with mode: 0644]
modules/luci-base/luasrc/view/cbi/apply_xhr.htm [deleted file]
modules/luci-base/luasrc/view/cbi/map.htm
modules/luci-base/root/etc/config/luci
modules/luci-mod-admin-full/luasrc/controller/admin/uci.lua
modules/luci-mod-admin-full/luasrc/view/admin_uci/apply.htm [deleted file]
modules/luci-mod-admin-full/luasrc/view/admin_uci/changes.htm
modules/luci-mod-admin-full/luasrc/view/admin_uci/revert.htm