Repository navigation
Remove unused additional sections/configs machinery, tzctl/wifictl and pushConfigReboot - #3466
Conversation
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
MichaIng
left a comment
There was a problem hiding this comment.
Remove some related newlines and adjust description of enable_reboot setting. The buttons still work well, and were never tied into the "additional" configs path.
Remove some related newlines and adjust description of enable_reboot setting. The buttons still work well, and were never tied into the "additional" configs path. Also remove a now unused import and redundant `return`. Signed-off-by: MichaIng <micha@dietpi.com> Co-Authored-By: MichaIng <micha@dietpi.com>
d02eced to
fffd0cf
Compare
|
Finally removing all this whole "additional" system admin stuff, now that To actually make use of this, source code changes would be required, to load the modules, and call their I am sure those features were implemented in motionEyeOS. Code on Git(Hub) is never lost, it can always be recovered from the commit and PR history, just in case anyone every wants to work with it. But I do not see this coming, nor do I think it is reasonable to expand the scope of motionEye in such way. For reboot/shutdown button, which is what the Regarding the points to review:
This is fine, as
After another review iteration,
I did that => all works still perfectly fine: No missing sections, no errors, shutdown/reboot buttons work as before. Reboot after restore works as well, though its check loop fails because the config handler returns 403 after the reboot, as of the reset session. I just updated it to use the |
This is not about "additional configs", but about hiding configs which depend on other config choices, like the media upload service choice and credentials depend on the main media upload toggle. Signed-off-by: MichaIng <micha@dietpi.com> Co-Authored-By: MichaIng <micha@dietpi.com>
The config API requires authentication. After reboot, however, sessions are invalidated, hence the request throws a 403. The reboot button just checks at the base URL, which works, but returns a large HTML. The manifest.json is a very small document, better suited. It is not exactly a status API, but very close. Signed-off-by: MichaIng <micha@dietpi.com> Co-Authored-By: MichaIng <micha@dietpi.com>
zagrim
left a comment
There was a problem hiding this comment.
👍 If this indeed didn't break any "normal" functionality, great! Let's hope this also reduces some of the confusion the settings handling code tends to cause in me due to the "additional sections"...
Marijn0
left a comment
There was a problem hiding this comment.
I am sure those features were implemented in motionEyeOS. Code on Git(Hub) is never lost, it can always be recovered from the commit and PR history, just in case anyone every wants to work with it. But I do not see this coming, nor do I think it is reasonable to expand the scope of motionEye in such way.
Yeah, I don’t see anyone reviving motionEyeOS either. The last substantial activity was over six years ago. If I remember correctly, we’ve already removed some other code that was probably related to motionEyeOS. So IMO, it makes sense to clean up these remaining bits as well.
The
tzctlandwifictlmodules were never imported, so the@additional_section/@additional_configregistries were always empty. As a result,WPA_SUPPLICANT_CONFandLOCAL_TIME_FILEhad no effect, and everything built on those registries was dead code. This PR removes it, including the JSpushConfigRebootflag, which could no longer becometrue.controls/tzctl.pyandcontrols/wifictl.py.WPA_SUPPLICANT_CONFandLOCAL_TIME_FILEfromsettings.pyandmotioneye.conf.sample.ENABLE_REBOOTcomment that referred to wifi/time zone.config.pyadditional_section,additional_config,get_additional_structure,_get_additional_configand_set_additional_config.get_main,set_main,get_cameraandset_camera.# additional configs_-key ↔@_-key copy loops in the*_ui_to_dict/*_dict_to_uiconverters, and the@_skip when writing config lines.MainHandlerno longer builds or passesmain_sections/camera_sections.ConfigHandler.set_configno longer returns and computes a reboot-needed flag from additional configs.ENABLE_REBOOTis still honoured by the explicit reboot/shutdown buttons and by config restore.main.htmlconfig_itemmacro, all*_sections.get(...)loops and the "Additional Main/Camera Sections" blocks.main.jsadditional-sectionhide-logic calls.pushConfigRebootand therebootparameter ofpushMainConfig()/pushCameraConfig(), and update all callers.applyConfig, which was unreachable.Notes for review
ui['_client_secret']inmain_dict_to_uiis unrelated to this feature and is kept. The UI still posts it back as_client_secret, whichmain_ui_to_dictno longer copies to@_client_secret, so it is ignored on save.data.reboothandling after a config save in the UI is kept because the restore path still uses it.