mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
Add non-gui setting for gRPC server max_message_length.
This commit is contained in:
parent
102b65e6c3
commit
f6623fad95
2 changed files with 18 additions and 1 deletions
|
@ -99,11 +99,11 @@ Examples:
|
||||||
thm.load_theme(app)
|
thm.load_theme(app)
|
||||||
|
|
||||||
Utils.create_socket_dirs()
|
Utils.create_socket_dirs()
|
||||||
|
cfg = Config.get()
|
||||||
if args.socket == None:
|
if args.socket == None:
|
||||||
# default
|
# default
|
||||||
args.socket = "unix:///tmp/osui.sock"
|
args.socket = "unix:///tmp/osui.sock"
|
||||||
|
|
||||||
cfg = Config.get()
|
|
||||||
addr = cfg.getSettings(Config.DEFAULT_SERVER_ADDR)
|
addr = cfg.getSettings(Config.DEFAULT_SERVER_ADDR)
|
||||||
if addr != None and addr != "":
|
if addr != None and addr != "":
|
||||||
if addr.startswith("unix://"):
|
if addr.startswith("unix://"):
|
||||||
|
@ -116,6 +116,20 @@ Examples:
|
||||||
|
|
||||||
print("Using server address:", args.socket)
|
print("Using server address:", args.socket)
|
||||||
|
|
||||||
|
maxmsglencfg = cfg.getSettings(Config.DEFAULT_SERVER_MAX_MESSAGE_LENGTH)
|
||||||
|
match maxmsglencfg:
|
||||||
|
case '4MiB':
|
||||||
|
maxmsglen = 4194304
|
||||||
|
case '8MiB':
|
||||||
|
maxmsglen = 8388608
|
||||||
|
case '16MiB':
|
||||||
|
maxmsglen = 16777216
|
||||||
|
case _:
|
||||||
|
maxmsglen = 4194304
|
||||||
|
|
||||||
|
print("gRPC Max Message Length:", maxmsglencfg)
|
||||||
|
print(" Bytes:", maxmsglen)
|
||||||
|
|
||||||
service = UIService(app, on_exit)
|
service = UIService(app, on_exit)
|
||||||
# @doc: https://grpc.github.io/grpc/python/grpc.html#server-object
|
# @doc: https://grpc.github.io/grpc/python/grpc.html#server-object
|
||||||
server = grpc.server(futures.ThreadPoolExecutor(),
|
server = grpc.server(futures.ThreadPoolExecutor(),
|
||||||
|
@ -128,6 +142,8 @@ Examples:
|
||||||
# there's no response.
|
# there's no response.
|
||||||
('grpc.keepalive_timeout_ms', 20000),
|
('grpc.keepalive_timeout_ms', 20000),
|
||||||
('grpc.keepalive_permit_without_calls', True),
|
('grpc.keepalive_permit_without_calls', True),
|
||||||
|
('grpc.max_send_message_length', maxmsglen),
|
||||||
|
('grpc.max_receive_message_length', maxmsglen),
|
||||||
))
|
))
|
||||||
|
|
||||||
add_UIServicer_to_server(service, server)
|
add_UIServicer_to_server(service, server)
|
||||||
|
|
|
@ -102,6 +102,7 @@ class Config:
|
||||||
DEFAULT_POPUP_ADVANCED_DSTPORT = "global/default_popup_advanced_dstport"
|
DEFAULT_POPUP_ADVANCED_DSTPORT = "global/default_popup_advanced_dstport"
|
||||||
DEFAULT_POPUP_ADVANCED_UID = "global/default_popup_advanced_uid"
|
DEFAULT_POPUP_ADVANCED_UID = "global/default_popup_advanced_uid"
|
||||||
DEFAULT_SERVER_ADDR = "global/server_address"
|
DEFAULT_SERVER_ADDR = "global/server_address"
|
||||||
|
DEFAULT_SERVER_MAX_MESSAGE_LENGTH = "global/server_max_message_length"
|
||||||
DEFAULT_HIDE_SYSTRAY_WARN = "global/hide_systray_warning"
|
DEFAULT_HIDE_SYSTRAY_WARN = "global/hide_systray_warning"
|
||||||
DEFAULT_DB_TYPE_KEY = "database/type"
|
DEFAULT_DB_TYPE_KEY = "database/type"
|
||||||
DEFAULT_DB_FILE_KEY = "database/file"
|
DEFAULT_DB_FILE_KEY = "database/file"
|
||||||
|
|
Loading…
Add table
Reference in a new issue