nightscout / Trio

Trio - an automated insulin delivery system for iOS based on the OpenAPS algorithm with adaptations.
https://docs.diy-trio.org/en/latest/
MIT License
80 stars 414 forks source link

Toggle option to Disable Fetching of Nightscout Carbs in Trio #198

Closed Sjoerd-Bo3 closed 4 months ago

Sjoerd-Bo3 commented 4 months ago

Is your feature request related to a problem? Please describe. Currently, even if remote commands are disabled in Trio, carbs saved to Nightscout by anyone with Careportal access are still pulled into Trio and used in dosing decisions. This creates a security vulnerability, as it is not possible to fully disable remote control over carb data input. This issue was highlighted by Dylan Sutton, who noted that simply disabling remote commands does not prevent carb data from being fetched and used, making the system potentially unsafe.

Describe the solution you'd like Introduce a toggle option in Trio settings to enable or disable the fetching of carb data from Nightscout. This setting should default to not allow fetching treatments to ensure better security. This would involve adding a basic toggle and the necessary logic to respect this setting, ensuring that when disabled, Trio does not fetch carb data from Nightscout.

Describe alternatives you've considered

Additional context This issue was discussed in detail, and it was noted that the most dangerous remote command is the announcement for bolusing, which can be disabled with the remote control toggle. However, to completely block unwanted entries and ensure higher security, a specific setting to disable fetching treatments from Nightscout is necessary. Daniel provided a temporary solution by commenting out the fetch code, and Sjoerd offered to implement the toggle feature, seeking guidance from Daniel's commit.


Note: This request aligns with the need to enhance the security of Trio by giving users more control over the data inputs used in dosing decisions, ultimately making the system safer and more reliable.

Sjoerd-Bo3 commented 4 months ago

Comment from Daniel: I added an "allow NS download toggle" to my personal iAPS build a couple of weeks ago. Just made a commit to a fresh Trio dev testing branch with the same changes. Feel free to use and improve this as you like (Super simple code implementation, but it works) https://github.com/dsnallfot/Trio/commit/b8d9a3160a31a417561c602e9e38915777853f35

dsnallfot commented 4 months ago

I will make a PR based on the commit posted