mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-12 15:20:44 +08:00
🐛 修复环境变量账号密码生效逻辑 #42
Some checks are pending
Docker Publish / build-and-push (push) Waiting to run
Some checks are pending
Docker Publish / build-and-push (push) Waiting to run
- 修复首次部署管理账号密码环境变量不生效 - 使用环境变量优先设置用户名和密码
This commit is contained in:
parent
26060f0dd7
commit
9d599b5e64
16
app/run.py
16
app/run.py
@ -288,16 +288,12 @@ def init():
|
||||
dest.write(src.read())
|
||||
data = read_json()
|
||||
# 默认管理账号
|
||||
if not data.get("webui"):
|
||||
data["webui"] = {
|
||||
"username": "admin",
|
||||
"password": "admin123",
|
||||
}
|
||||
elif os.environ.get("WEBUI_USERNAME") and os.environ.get("WEBUI_PASSWORD"):
|
||||
data["webui"] = {
|
||||
"username": os.environ.get("WEBUI_USERNAME"),
|
||||
"password": os.environ.get("WEBUI_PASSWORD"),
|
||||
}
|
||||
data["webui"] = {
|
||||
"username": os.environ.get("WEBUI_USERNAME")
|
||||
or data.get("webui", {}).get("username", "admin"),
|
||||
"password": os.environ.get("WEBUI_PASSWORD")
|
||||
or data.get("webui", {}).get("password", "admin123"),
|
||||
}
|
||||
# 默认定时规则
|
||||
if not data.get("crontab"):
|
||||
data["crontab"] = "0 8,18,20 * * *"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user