From 9a5aba73135a6b930992ca7b335acf6ac57e1e7d Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 8 Feb 2020 18:29:48 +0100 Subject: [PATCH] disable config interface unless explicitly enables in the config --- owrx/connection.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/owrx/connection.py b/owrx/connection.py index 7aa6fc6..6884f69 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -247,10 +247,14 @@ class OpenWebRxReceiverClient(Client): self.sdr.removeSpectrumClient(self) def setParams(self, params): + # allow direct configuration only if enabled in the config + keys = PropertyManager.getSharedInstance()["configurable_keys"] + if not keys: + return # only the keys in the protected property manager can be overridden from the web protected = ( self.sdr.getProps() - .collect("samp_rate", "center_freq", "rf_gain", "type") + .collect(*keys) .defaults(PropertyManager.getSharedInstance()) ) for key, value in params.items():