Skip to content

Commit

Permalink
Merge pull request lllyasviel#779 from MoonRide303/auth-file-access
Browse files Browse the repository at this point in the history
Blocked remote access to auth.json
  • Loading branch information
MoonRide303 authored Oct 24, 2023
2 parents 5d32c20 + 19a03f1 commit 486568a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import hashlib
import modules.constants as constants

from os.path import exists

Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions modules/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# as in k-diffusion (sampling.py)
MIN_SEED = 0
MAX_SEED = 2**63 - 1

AUTH_FILENAME = 'auth.json'
3 changes: 2 additions & 1 deletion webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
)

0 comments on commit 486568a

Please sign in to comment.