Skip to content

Commit

Permalink
v1.4.0-beta.75
Browse files Browse the repository at this point in the history
- improved *MQTT Network* security with randomly generated client ID
  • Loading branch information
genemars committed Dec 26, 2024
1 parent 8be4232 commit caab2f0
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@
<ParentId>0</ParentId>
<UpdateTime>2022-12-28T17:03:34.1777588Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>ConfigureOptions.Encryption</Name>
<Value>On</Value>
<Description>3. End-to-end message encryption (E2EE)</Description>
<FieldType>checkbox</FieldType>
<ParentId>0</ParentId>
<UpdateTime>2024-12-04T17:32:17.7906451Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>ConfigureOptions.EncryptionKey</Name>
<Value />
<Description>0. End-to-end encryption key</Description>
<FieldType>hidden</FieldType>
<ParentId>0</ParentId>
<UpdateTime>2024-12-04T17:32:17.7906451Z</UpdateTime>
</ModuleParameter>
<ModuleParameter>
<Name>ConfigureOptions.TLS</Name>
<Value />
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"repository":"homegenie","id":"homegenie-base","version":"1.0.2","description":"HomeGenie base package. This should always be installed.","programs":[{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"111","id":"client-configs","required":true,"version":"1.0.2","checksum":"0BE01D06C8342351AC31E74439BA6022","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"570","id":"stats-data-monitor","required":true,"version":"1.0.3","checksum":"C43D945F1D855C164EA2FECB6927A093","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"142","id":"e-mail-account","required":true,"version":"1.0.1","checksum":"DEFD8C14DEA9489EB027AB9C3C7CFAEF","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"571","id":"energy-use-statistics","required":false,"version":"1.0.4","checksum":"38005DD51B26530999D8A2E85FD69B92","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"95","id":"events-logging","required":true,"version":"1.0.1","checksum":"45CFE6FF025BD92488BBDBE491C4C98D","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"77","id":"mqtt-network","required":true,"version":"1.0.5","checksum":"8179F946BCC55D8E2F8BB8F920A1BB00","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"34","id":"openweathermap","required":true,"version":"1.0.1","checksum":"F93D3B0AEC9971C1C79D70FDE007888B","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"572","id":"pie-chart-stats-example","required":false,"version":"1.0.1","checksum":"8B4B14BE32EBB0547A142489DF72CF43","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"505","id":"remote-control","required":true,"version":"1.0.1","checksum":"BDF7FC5E982D8A588267A989636AA6B6","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"900","id":"sine-wave-signal","required":false,"version":"1.0.1","checksum":"7FB7ADAF989FC6DCE596C8218E10A80A","installed":false}],"modules":null,"groups":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"Dashboard","id":"0","required":false,"version":"0","checksum":null,"installed":false}],"schedules":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"System.UpdateCheck","id":"0","required":false,"version":"0","checksum":null,"installed":false}]}
{"repository":"homegenie","id":"homegenie-base","version":"1.0.2","description":"HomeGenie base package. This should always be installed.","programs":[{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"111","id":"client-configs","required":true,"version":"1.0.2","checksum":"0BE01D06C8342351AC31E74439BA6022","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"570","id":"stats-data-monitor","required":true,"version":"1.0.3","checksum":"C43D945F1D855C164EA2FECB6927A093","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"142","id":"e-mail-account","required":true,"version":"1.0.1","checksum":"D5ED1400F10DBDA875BE6EDCE779EB46","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"571","id":"energy-use-statistics","required":false,"version":"1.0.4","checksum":"38005DD51B26530999D8A2E85FD69B92","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"95","id":"events-logging","required":true,"version":"1.0.1","checksum":"45CFE6FF025BD92488BBDBE491C4C98D","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"77","id":"mqtt-network","required":true,"version":"1.0.6","checksum":"F094BE66EB6D274C53A9BF53E20C1D62","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"34","id":"openweathermap","required":true,"version":"1.0.1","checksum":"4B044176D2110D4A1DC97E6B00B5442C","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"572","id":"pie-chart-stats-example","required":false,"version":"1.0.1","checksum":"8B4B14BE32EBB0547A142489DF72CF43","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"505","id":"remote-control","required":true,"version":"1.0.1","checksum":"BDF7FC5E982D8A588267A989636AA6B6","installed":false},{"repository":"homegenie","packageId":"homegenie-base","packageVersion":"1.0.2","hid":"900","id":"sine-wave-signal","required":false,"version":"1.0.1","checksum":"7FB7ADAF989FC6DCE596C8218E10A80A","installed":false}],"modules":null,"groups":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"Dashboard","id":"0","required":false,"version":"0","checksum":null,"installed":false}],"schedules":[{"repository":null,"packageId":null,"packageVersion":null,"hid":"System.UpdateCheck","id":"0","required":false,"version":"0","checksum":null,"installed":false}]}
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ ValueStatistics ApplyFilter(NWaves.Filters.Base.IFilter filter, ModuleParameter
</ScriptSetup>
<ScriptSource>// detect when an option of this program is changed and store the new value to system settings
When.ModuleParameterChanged((module, parameter)=&gt;{
if (module.Instance.Equals(Program.Module) &amp;&amp; parameter.Name.StartsWith("ConfigureOptions.")) {
if (module.Instance == Program.Module &amp;&amp; parameter.Name.StartsWith("ConfigureOptions.")) {
var settingName = parameter.Name.Substring(17); // skip "ConfigureOptions." part
Settings.Parameter("Messaging."+settingName).Value = parameter.Value;
}
Expand All @@ -282,7 +282,7 @@ Program.GoBackground();
<Id>e-mail-account</Id>
<Version>1.0.1</Version>
<Required>true</Required>
<Checksum>DEFD8C14DEA9489EB027AB9C3C7CFAEF</Checksum>
<Checksum>D5ED1400F10DBDA875BE6EDCE779EB46</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>142</Address>
Expand Down Expand Up @@ -601,7 +601,7 @@ Program.GoBackground();
.AddOption("ClientId", Program.SystemId, "0. Enter unique ID for this client", "text")
.AddOption("ServerAddress", "", "1. MQTT server address", "text")
.AddOption("ServerPort", "1883", "2. MQTT server port", "text")
.AddOption("Encryption", "On", "3. End 11 to end messge encryption (E2EE)", "checkbox")
.AddOption("Encryption", "On", "3. End-to-end message encryption (E2EE)", "checkbox")
.AddOption("EncryptionKey", "", "Encryption key", "hidden")
.AddOption("WebSockets", "", "4. Connect using WebSockets", "checkbox")
.AddOption("TLS", "", "5. Connect using TLS/SSL", "checkbox")
Expand Down Expand Up @@ -788,7 +788,7 @@ Api.Handle("MQTT:", ( args ) =&gt; {
});

When.ModuleParameterChanged( (module, property) =&gt; {
if (module.Get().Instance == Program.Module &amp;&amp; property.Name.StartsWith("ConfigureOptions.")) {
if (module.Instance == Program.Module &amp;&amp; property.Name.StartsWith("ConfigureOptions.")) {
if (Program.IsRunning) Program.Restart();
return true;
}
Expand Down Expand Up @@ -838,7 +838,7 @@ while (Program.IsRunning) {
.Service(server)
.UsingWebSockets(useWebSockets)
.WithTls(useTls)
.Connect(port, clientid, (connected)=&gt;{
.Connect(port, Guid.NewGuid().ToString(), (connected)=&gt; {
MqttIsConnected = connected;
if (connected) {
Program.Notify("Connected!");
Expand Down Expand Up @@ -914,16 +914,16 @@ static byte[] andFilter(byte[] payload, byte[] clientKey) {
return payload;
}
</ScriptContext>
<ScriptErrors>[]</ScriptErrors>
<ScriptErrors />
<Data />
<PackageInfo>
<Repository>homegenie</Repository>
<PackageId>homegenie-base</PackageId>
<PackageVersion>1.0.2</PackageVersion>
<Id>mqtt-network</Id>
<Version>1.0.5</Version>
<Version>1.0.6</Version>
<Required>true</Required>
<Checksum>8179F946BCC55D8E2F8BB8F920A1BB00</Checksum>
<Checksum>F094BE66EB6D274C53A9BF53E20C1D62</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>77</Address>
Expand Down Expand Up @@ -1106,7 +1106,7 @@ Func&lt;dynamic, dynamic&gt; CollectWeatherData = (weatherData) =&gt; {

bool reconfigureRequired = false;
When.ModuleParameterChanged((module, parameter) =&gt; {
if (module.Get().Instance == Program.Module &amp;&amp; parameter.Name.StartsWith("ConfigureOptions.")) {
if (module.Instance == Program.Module &amp;&amp; parameter.Name.StartsWith("ConfigureOptions.")) {
reconfigureRequired = true;
}
return true;
Expand Down Expand Up @@ -1187,7 +1187,7 @@ while (Program.IsRunning)
<Id>openweathermap</Id>
<Version>1.0.1</Version>
<Required>true</Required>
<Checksum>F93D3B0AEC9971C1C79D70FDE007888B</Checksum>
<Checksum>4B044176D2110D4A1DC97E6B00B5442C</Checksum>
</PackageInfo>
<Domain>HomeAutomation.HomeGenie.Automation</Domain>
<Address>34</Address>
Expand Down
Loading

0 comments on commit caab2f0

Please sign in to comment.