Store API changeable configuration keys in Config.py

This commit is contained in:
shortcutme 2018-07-10 03:40:56 +02:00
parent 4208885e36
commit 30134dbbc9
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 3 additions and 4 deletions

View file

@ -986,10 +986,8 @@ class UiWebsocket(object):
return self.response(to, {"error": "Not a directory"})
def actionConfigSet(self, to, key, value):
allowed_keys = ["tor", "language", "tor_use_bridges", "trackers_proxy"]
if key not in allowed_keys:
self.response(to, {"error": "Forbidden"})
if key not in config.keys_api_change_allowed:
self.response(to, {"error": "Forbidden you cannot set this config key"})
return
config.saveValue(key, value)