Skip to content

Commit ccd73fc

Browse files
Merge pull request #4717 from papuSpartan/security
Add --server-name to the list of arguments considered insecure
2 parents 3271883 + 3405acc commit ccd73fc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

modules/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"outdir_save",
108108
}
109109

110-
cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen) and not cmd_opts.enable_insecure_extension_access
110+
cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen or cmd_opts.server_name) and not cmd_opts.enable_insecure_extension_access
111111

112112
devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_swinir, devices.device_esrgan, devices.device_scunet, devices.device_codeformer = \
113113
(devices.cpu if any(y in cmd_opts.use_cpu for y in [x, 'all']) else devices.get_optimal_device() for x in ['sd', 'interrogate', 'gfpgan', 'swinir', 'esrgan', 'scunet', 'codeformer'])

webui.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
import modules.hypernetworks.hypernetwork
3434

3535
queue_lock = threading.Lock()
36-
server_name = "0.0.0.0" if cmd_opts.listen else cmd_opts.server_name
36+
if cmd_opts.server_name:
37+
server_name = cmd_opts.server_name
38+
else:
39+
server_name = "0.0.0.0" if cmd_opts.listen else None
3740

3841
def wrap_queued_call(func):
3942
def f(*args, **kwargs):

0 commit comments

Comments
 (0)