-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Flags #6
Comments
@th0mas thanks for opening this issue. I'm totally for feature flags in principal. Great that you're thinking ahead. 👍
My preferred approach would be a modular one where we end up with separate firmwares. If a particular piece of functionality is common to every firmware bundle it goes in the "core". LMK if this answers your question or if you need anything else. 👍 |
Being able to "flip bits" in the Erlang VM through user (external) input would be a major security flaw in Erlang, so we can be confident this would be patched. Erlang has only had one overflow vulnerability in 2016: https://www.cvedetails.com/cve/CVE-2016-10253/ so we can presume the BEAM VM is "secure" I'll look into modularising our existing firmware as there as it is currently very tightly coupled together and it would need refactoring and modularising to implement any of the above strategies. |
@th0mas yeah, totally agree. With that in mind and given that it's actually cheaper to use a Perhaps a pertinent question regarding the feature flags is: Maybe let's not modularise/refactor until we get to 4 types of device. 💭 |
@th0mas were you thinking of using the same firmware for the Welcome Display...? Does it not make more sense to have that one be as "dumb" as possible and not have any knowledge of the rest of the system? |
@nelsonic thats why I opened this issue. We could either add a "display" flag to our existing firmware, or create a new one. I agree with the firmware being as "dumb" as possible, the current firmware leaves all the "thinking" up to the hub. But it would need to have some knowledge of the rest of the system as it needs to be able to display contextual information, as described in dwyl/smart-home-security-system#12. So any display firmware would need to implement a hub client, which is 60% of the current firmware anyway. |
I don't see why the Welcome Display would need to send any data back to the hub, however ... Can you think of a scenario where we would want to send data from the Welcome Display back to the Hub? I think that if we follow occam's razor on this, we should just have a single firmware (to rule them all) |
I wasn't planning on the Welcome display sending any info back to the hub, but the hub needs to send information to the welcome display, and for that it needs to implement a hub client. However, getting a display working on any of my dev devices is currently impossible, see dwyl/smart-home-security-system#10 (comment) I can still test on |
@th0mas as noted in dwyl/smart-home-security-system#10 (comment), |
@nelsonic an RPi3 model A+ would work well :) I don't think the difference between the A and B makes too much difference to the software, just the A+ has A micro SD card of any size would also be useful :)) |
@th0mas OK Cool. order placed. 📦 ✅ |
This seems sorted, closing for now |
We need to be able to enable some features on some devices and disable them on others - e.g. The welcome display.
To do this we need some sort of feature flag system, I think we have several ways of doing this.
In How do we identify doors and other IoT devices? #2 I implemented a handshake system, we could extend this to toggling features on and off each device. E.g. We could send a keyword list of flags:
[{lock: true}, {display: true}]
to configure the device on startup. This increases our firmware complexity but allows us to have greater flexibility down the line, for example if you want to add a display later thats a checkbox.Compile time flags. We could configure the firmware features using environment variables and only run the necessary parts. This comes with some more complexity when deploying but will result in clearer firmware code. Changing the features of a device will require compiling and pushing a new firmware.
Different firmwares. Welcome Display smart-home-security-system#10 suggests we will have a separate Pi running the display, so we could create and deploy a new firmware. This would reduce filesize but would result in duplicated code, as, for example, we would have to maintain two
HubClient
s. This is the simplest option as there is no configuration to sort out@nelsonic thoughts?
The text was updated successfully, but these errors were encountered: