Spaces:
Sleeping
Sleeping
fix: 支持全部环境变量
Browse files- modules/config.py +0 -2
- modules/utils.py +3 -5
modules/config.py
CHANGED
@@ -59,8 +59,6 @@ def load_environ_to_config():
|
|
59 |
pass
|
60 |
finally:
|
61 |
logging.info(f"加载环境变量{key.lower()},值:{config[key.lower()]}...")
|
62 |
-
if key == 'users':
|
63 |
-
logging.info(config['users'][0][1])
|
64 |
|
65 |
|
66 |
hide_history_when_not_logged_in = config.get(
|
|
|
59 |
pass
|
60 |
finally:
|
61 |
logging.info(f"加载环境变量{key.lower()},值:{config[key.lower()]}...")
|
|
|
|
|
62 |
|
63 |
|
64 |
hide_history_when_not_logged_in = config.get(
|
modules/utils.py
CHANGED
@@ -23,7 +23,7 @@ import pandas as pd
|
|
23 |
|
24 |
from modules.presets import *
|
25 |
from . import shared
|
26 |
-
from modules.config import retrieve_proxy, hide_history_when_not_logged_in
|
27 |
|
28 |
if TYPE_CHECKING:
|
29 |
from typing import TypedDict
|
@@ -822,10 +822,8 @@ def beautify_err_msg(err_msg):
|
|
822 |
|
823 |
def auth_from_conf(username, password):
|
824 |
try:
|
825 |
-
|
826 |
-
|
827 |
-
usernames, passwords = [i[0] for i in conf["users"]], [
|
828 |
-
i[1] for i in conf["users"]
|
829 |
]
|
830 |
if username in usernames:
|
831 |
if passwords[usernames.index(username)] == password:
|
|
|
23 |
|
24 |
from modules.presets import *
|
25 |
from . import shared
|
26 |
+
from modules.config import retrieve_proxy, hide_history_when_not_logged_in, config
|
27 |
|
28 |
if TYPE_CHECKING:
|
29 |
from typing import TypedDict
|
|
|
822 |
|
823 |
def auth_from_conf(username, password):
|
824 |
try:
|
825 |
+
usernames, passwords = [i[0] for i in config["users"]], [
|
826 |
+
i[1] for i in config["users"]
|
|
|
|
|
827 |
]
|
828 |
if username in usernames:
|
829 |
if passwords[usernames.index(username)] == password:
|