diff options
author | Ju1-js <40339350+Ju1-js@users.noreply.github.com> | 2023-01-28 06:43:10 +0000 |
---|---|---|
committer | Ju1-js <40339350+Ju1-js@users.noreply.github.com> | 2023-01-28 06:43:10 +0000 |
commit | dc25a31d1a3816a7fb0cd5ef186559b3c085db43 (patch) | |
tree | ac3af27c921fa11545fe78d4c71c0b089a57583f /webui.py | |
parent | ce72af87d3b05c946bc82033786fc340f1c20512 (diff) | |
download | stable-diffusion-webui-gfx803-dc25a31d1a3816a7fb0cd5ef186559b3c085db43.tar.gz stable-diffusion-webui-gfx803-dc25a31d1a3816a7fb0cd5ef186559b3c085db43.tar.bz2 stable-diffusion-webui-gfx803-dc25a31d1a3816a7fb0cd5ef186559b3c085db43.zip |
Gradio Auth Read from External File
Usage: `--gradio-auth-path {PATH}`
It adds the credentials to the already existing `--gradio-auth` credentials. It can also handle line breaks.
The file should look like:
`{u1}:{p1},{u2}:{p2}`
or
```
{u1}:{p1},
{u2}:{p2}
```
Will gradio handle duplicate credentials if it happens?
Diffstat (limited to 'webui.py')
-rw-r--r-- | webui.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -205,7 +205,7 @@ def webui(): ssl_keyfile=cmd_opts.tls_keyfile,
ssl_certfile=cmd_opts.tls_certfile,
debug=cmd_opts.gradio_debug,
- auth=[tuple(cred.split(':')) for cred in cmd_opts.gradio_auth.strip('"').split(',')] if cmd_opts.gradio_auth else None,
+ auth=[tuple(cred.split(':')) for cred in (cmd_opts.gradio_auth.strip('"').replace('\n','').split(',') + (open(cmd_opts.gradio_auth_path, 'r').read().strip().replace('\n','').split(',') if cmd_opts.gradio_auth_path and os.path.exists(cmd_opts.gradio_auth_path) else None))] if cmd_opts.gradio_auth or (cmd_opts.gradio_auth_path and os.path.exists(cmd_opts.gradio_auth_path)) else None,
inbrowser=cmd_opts.autolaunch,
prevent_thread_lock=True
)
|