openwisp / openwisp-config

OpenWRT configuration agent for OpenWISP Controller
https://openwisp.io/docs/stable/openwrt-config-agent/
GNU General Public License v3.0
374 stars 59 forks source link

[bug] The openwisp-config UCI configuration should not be restored completely #195

Open nemesifier opened 1 year ago

nemesifier commented 1 year ago

If a device is switched from one instance to another, it may happen that the agent stores a backup of the full /etc/config/openwisp file, which will contain URL, UUID, key and in some cases shared secret. In some cases this causes the backup to be restored after registering to a different server, which basically causes a rollback and makes the device go back to the old server.

A possible solution could be to treat this file differently and avoid storing URL, UUID, key or shared secret but before proceeding with this we have to verify there's no other downsides to this approach.