|
@@ -9,6 +9,7 @@ import numbers
|
|
|
import errno
|
|
|
import os
|
|
|
import logging
|
|
|
+from base64 import b64decode
|
|
|
from os.path import dirname, abspath
|
|
|
|
|
|
from searx.languages import language_codes as languages
|
|
@@ -107,6 +108,15 @@ class SettingsDirectoryValue(SettingsValue):
|
|
|
return super().__call__(value)
|
|
|
|
|
|
|
|
|
+class SettingsBytesValue(SettingsValue):
|
|
|
+ """str are base64 decoded"""
|
|
|
+
|
|
|
+ def __call__(self, value: typing.Any) -> typing.Any:
|
|
|
+ if isinstance(value, str):
|
|
|
+ value = b64decode(value)
|
|
|
+ return super().__call__(value)
|
|
|
+
|
|
|
+
|
|
|
def apply_schema(settings, schema, path_list):
|
|
|
error = False
|
|
|
for key, value in schema.items():
|
|
@@ -205,6 +215,11 @@ SCHEMA = {
|
|
|
'extra_proxy_timeout': SettingsValue(int, 0),
|
|
|
'networks': {},
|
|
|
},
|
|
|
+ 'result_proxy': {
|
|
|
+ 'url': SettingsValue((None, str), None),
|
|
|
+ 'key': SettingsBytesValue((None, bytes), None),
|
|
|
+ 'proxify_results': SettingsValue(bool, False),
|
|
|
+ },
|
|
|
'plugins': SettingsValue(list, []),
|
|
|
'enabled_plugins': SettingsValue((None, list), None),
|
|
|
'checker': {
|