remove remote filter lists
This commit is contained in:
parent
45921a4487
commit
a0beb42e89
@ -198,12 +198,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -208,12 +208,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -209,12 +209,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -154,12 +154,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -208,12 +208,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -138,14 +138,9 @@ class remoteManager():
|
|||||||
def handleCommandExecution(self, commandText):
|
def handleCommandExecution(self, commandText):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enableCommandRemote'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enableCommandRemote'):
|
||||||
return
|
return
|
||||||
allowCommands = self.env['runtime']['settingsManager'].getSetting('remote', 'allowCommands').upper().split(',')
|
|
||||||
upperCommandText = commandText.upper()
|
upperCommandText = commandText.upper()
|
||||||
allowed = False
|
|
||||||
for a in allowCommands:
|
|
||||||
if upperCommandText.startswith(a):
|
|
||||||
allowed = True
|
|
||||||
if not allowed:
|
|
||||||
return
|
|
||||||
# say
|
# say
|
||||||
if upperCommandText.startswith(self.sayConst):
|
if upperCommandText.startswith(self.sayConst):
|
||||||
parameterText = commandText[len(self.sayConst):]
|
parameterText = commandText[len(self.sayConst):]
|
||||||
@ -184,9 +179,7 @@ class remoteManager():
|
|||||||
def resetSettings(self):
|
def resetSettings(self):
|
||||||
self.env['runtime']['settingsManager'].resetSettingArgDict()
|
self.env['runtime']['settingsManager'].resetSettingArgDict()
|
||||||
def setSettings(self, settingsArgs):
|
def setSettings(self, settingsArgs):
|
||||||
allowSettings = self.env['runtime']['settingsManager'].getSetting('remote', 'allowSettings').upper().split(',')
|
self.env['runtime']['settingsManager'].parseSettingArgs(settingsArgs)
|
||||||
|
|
||||||
self.env['runtime']['settingsManager'].parseSettingArgs(settingsArgs, allowSettings)
|
|
||||||
def handleRemoteIncomming(self, eventData):
|
def handleRemoteIncomming(self, eventData):
|
||||||
if not eventData:
|
if not eventData:
|
||||||
return
|
return
|
||||||
|
@ -86,9 +86,7 @@ settingsData = {
|
|||||||
'port': 22447,
|
'port': 22447,
|
||||||
'socketpath':'/tmp/',
|
'socketpath':'/tmp/',
|
||||||
'enableSettingsRemote': True,
|
'enableSettingsRemote': True,
|
||||||
'allowSettings': 'barrier#enabled',
|
|
||||||
'enableCommandRemote': True,
|
'enableCommandRemote': True,
|
||||||
'allowCommands': 'say,interrupt,window,resetwindow',
|
|
||||||
},
|
},
|
||||||
'barrier':{
|
'barrier':{
|
||||||
'enabled': True,
|
'enabled': True,
|
||||||
|
@ -186,19 +186,12 @@ class settingsManager():
|
|||||||
self.settingArgDict[section] = {}
|
self.settingArgDict[section] = {}
|
||||||
self.settingArgDict[section][option] = str(value)
|
self.settingArgDict[section][option] = str(value)
|
||||||
|
|
||||||
def parseSettingArgs(self, settingArgs, allowSettings = None):
|
def parseSettingArgs(self, settingArgs):
|
||||||
for optionElem in settingArgs.split(';'):
|
for optionElem in settingArgs.split(';'):
|
||||||
if len(optionElem.split('#',1)) != 2:
|
if len(optionElem.split('#',1)) != 2:
|
||||||
continue
|
continue
|
||||||
if len(optionElem.split('#',1)[1].split('=',1)) != 2:
|
if len(optionElem.split('#',1)[1].split('=',1)) != 2:
|
||||||
continue
|
continue
|
||||||
allowed = False
|
|
||||||
if allowSettings:
|
|
||||||
for a in allowSettings:
|
|
||||||
if a in optionElem:
|
|
||||||
allowed = True
|
|
||||||
if not allowed:
|
|
||||||
continue
|
|
||||||
|
|
||||||
section = str(optionElem.split('#',1)[0]).lower()
|
section = str(optionElem.split('#',1)[0]).lower()
|
||||||
option = str(optionElem.split('#',1)[1].split('=',1)[0]).lower()
|
option = str(optionElem.split('#',1)[1].split('=',1)[0]).lower()
|
||||||
|
Loading…
Reference in New Issue
Block a user