From 19a03f1d0adfc115ba7d6666b9f9207528225318 Mon Sep 17 00:00:00 2001 From: MoonRide303 Date: Tue, 24 Oct 2023 21:55:29 +0200 Subject: [PATCH] Blocked remote access to auth.json --- modules/auth.py | 3 ++- modules/constants.py | 2 ++ webui.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/auth.py b/modules/auth.py index e609806fb..3ba111424 100644 --- a/modules/auth.py +++ b/modules/auth.py @@ -1,5 +1,6 @@ import json import hashlib +import modules.constants as constants from os.path import exists @@ -28,7 +29,7 @@ def load_auth_data(filename=None): return auth_dict -auth_dict = load_auth_data('auth.json') +auth_dict = load_auth_data(constants.AUTH_FILENAME) auth_enabled = auth_dict != None diff --git a/modules/constants.py b/modules/constants.py index 47c268f32..667fa8682 100644 --- a/modules/constants.py +++ b/modules/constants.py @@ -1,3 +1,5 @@ # as in k-diffusion (sampling.py) MIN_SEED = 0 MAX_SEED = 2**63 - 1 + +AUTH_FILENAME = 'auth.json' diff --git a/webui.py b/webui.py index 01bfa04ce..180825d84 100644 --- a/webui.py +++ b/webui.py @@ -378,5 +378,6 @@ def dump_default_english_config(): server_name=args_manager.args.listen, server_port=args_manager.args.port, share=args_manager.args.share, - auth=check_auth if args_manager.args.share and auth_enabled else None + auth=check_auth if args_manager.args.share and auth_enabled else None, + blocked_paths=[constants.AUTH_FILENAME] )