Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
bba4c424
Commit
bba4c424
authored
Jun 07, 2024
by
Jun Siang Cheah
Browse files
feat: add WEBUI_SESSION_COOKIE_SECURE
parent
ae376ec8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
backend/config.py
backend/config.py
+5
-0
backend/main.py
backend/main.py
+2
-0
No files found.
backend/config.py
View file @
bba4c424
...
...
@@ -760,6 +760,11 @@ WEBUI_SESSION_COOKIE_SAME_SITE = os.environ.get(
os
.
environ
.
get
(
"WEBUI_SESSION_COOKIE_SAME_SITE"
,
"lax"
),
)
WEBUI_SESSION_COOKIE_SECURE
=
os
.
environ
.
get
(
"WEBUI_SESSION_COOKIE_SECURE"
,
os
.
environ
.
get
(
"WEBUI_SESSION_COOKIE_SECURE"
,
"false"
).
lower
()
==
"true"
,
)
if
WEBUI_AUTH
and
WEBUI_SECRET_KEY
==
""
:
raise
ValueError
(
ERROR_MESSAGES
.
ENV_VAR_NOT_FOUND
)
...
...
backend/main.py
View file @
bba4c424
...
...
@@ -79,6 +79,7 @@ from config import (
OAUTH_MERGE_ACCOUNTS_BY_EMAIL
,
WEBUI_SECRET_KEY
,
WEBUI_SESSION_COOKIE_SAME_SITE
,
WEBUI_SESSION_COOKIE_SECURE
,
)
from
constants
import
ERROR_MESSAGES
,
WEBHOOK_MESSAGES
from
utils.webhook
import
post_webhook
...
...
@@ -964,6 +965,7 @@ if len(OAUTH_PROVIDERS) > 0:
secret_key
=
WEBUI_SECRET_KEY
,
session_cookie
=
"oui-session"
,
same_site
=
WEBUI_SESSION_COOKIE_SAME_SITE
,
https_only
=
WEBUI_SESSION_COOKIE_SECURE
,
)
...
...
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