Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
1482c893
Commit
1482c893
authored
May 19, 2023
by
Aarni Koskela
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor validate_tls_options out, fix typo (keyfile was there twice)
parent
4897e527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
webui.py
webui.py
+18
-15
No files found.
webui.py
View file @
1482c893
...
@@ -161,9 +161,26 @@ def restore_config_state_file():
...
@@ -161,9 +161,26 @@ def restore_config_state_file():
print
(
f
"!!! Config state backup not found: {config_state_file}"
)
print
(
f
"!!! Config state backup not found: {config_state_file}"
)
def
validate_tls_options
():
if
not
(
cmd_opts
.
tls_keyfile
and
cmd_opts
.
tls_certfile
):
return
try
:
if
not
os
.
path
.
exists
(
cmd_opts
.
tls_keyfile
):
print
(
"Invalid path to TLS keyfile given"
)
if
not
os
.
path
.
exists
(
cmd_opts
.
tls_certfile
):
print
(
f
"Invalid path to TLS certfile: '{cmd_opts.tls_certfile}'"
)
except
TypeError
:
cmd_opts
.
tls_keyfile
=
cmd_opts
.
tls_certfile
=
None
print
(
"TLS setup invalid, running webui without TLS"
)
else
:
print
(
"Running with TLS"
)
startup_timer
.
record
(
"TLS"
)
def
initialize
():
def
initialize
():
fix_asyncio_event_loop_policy
()
fix_asyncio_event_loop_policy
()
validate_tls_options
()
check_versions
()
check_versions
()
extensions
.
list_extensions
()
extensions
.
list_extensions
()
...
@@ -220,20 +237,6 @@ def initialize():
...
@@ -220,20 +237,6 @@ def initialize():
startup_timer
.
record
(
"extra networks"
)
startup_timer
.
record
(
"extra networks"
)
if
cmd_opts
.
tls_keyfile
is
not
None
and
cmd_opts
.
tls_keyfile
is
not
None
:
try
:
if
not
os
.
path
.
exists
(
cmd_opts
.
tls_keyfile
):
print
(
"Invalid path to TLS keyfile given"
)
if
not
os
.
path
.
exists
(
cmd_opts
.
tls_certfile
):
print
(
f
"Invalid path to TLS certfile: '{cmd_opts.tls_certfile}'"
)
except
TypeError
:
cmd_opts
.
tls_keyfile
=
cmd_opts
.
tls_certfile
=
None
print
(
"TLS setup invalid, running webui without TLS"
)
else
:
print
(
"Running with TLS"
)
startup_timer
.
record
(
"TLS"
)
# make the program just exit at ctrl+c without waiting for anything
# make the program just exit at ctrl+c without waiting for anything
def
sigint_handler
(
sig
,
frame
):
def
sigint_handler
(
sig
,
frame
):
print
(
f
'Interrupted with signal {sig} in {frame}'
)
print
(
f
'Interrupted with signal {sig} in {frame}'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment