MikaylaFischler / cc-mek-scada

Configurable ComputerCraft SCADA system for multi-reactor control of Mekanism fission reactors with a GUI, automatic safety features, waste processing control, and more! Please be sure to take a look at the Wiki tab, this project has lots of docs!
https://youtube.com/playlist?list=PLPTRLQjcSlD2s6HsPe3COlfaULQZogWKK
MIT License
284 stars 11 forks source link

Investigate Pocket/Supervisor Initiated Remote Updates #407

Open MikaylaFischler opened 6 months ago

MikaylaFischler commented 6 months ago

Initiate either via the Supervisor front panel or the Pocket a remote routine on any device (that isn't the host device) that will perform an update. This will require changing how ccmsi executes or duplicating functionality (former is preferred). Providing functions the main apps can include from ccmsi would be beneficial, though ccmsi is currently treated as an optional stand-alone application to keep its size as small as possible.

The initiator, Pocket or Supervisor, could also have a page where it can trigger its own update without needing to run ccmsi manually.

Remote update commands must absolutely require MACs to be used, otherwise devices can effectively be remotely rebooted by unauthorized parties. However, denying update requests on devices already updated could possibly be enough of a security against that, assuming the user opt's-in to this feature.

Opt-in is preferred, as this will:

In the case where a perfectly minimal amount of disk usage is present, even a single file mode update may fail and require user intervention. Automatic deletion of a log file followed by a retry could work, assuming it fails at a time where actions can still be taken. That would yet be another action that is not ideal without user confirmation.

Procedure would be:

  1. Re-check for an update
  2. Bring the system into a safe state (supervisor would close connections, PLC would SCRAM reactor)
  3. Yield out of the main code, switching to solely running the update routine
  4. Complete the update routine
  5. Reboot with os.reboot()

Other Considerations