First Push

This commit is contained in:
喆OvO
2026-08-06 11:11:11 +08:00
commit 0fef309972
551 changed files with 15793 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from backend.app import create_app
from backend.scheduler import start_scheduler
from backend.models import _EMITTED_PASSWORDS, get_auth_config
db_path = os.environ.get("FLASK_DB_PATH", os.path.join(os.path.dirname(__file__), "data.db"))
app = create_app(db_path=db_path)
start_scheduler(app)
# Print temp password if it wasn't already emitted during DB init
with app.app_context():
if not _EMITTED_PASSWORDS:
cfg = get_auth_config()
pw = cfg.get("temp_password", "")
if pw and cfg.get("must_configure_mfa"):
print(f"\n{'='*50}", file=sys.stderr)
print(f" 🔐 临时密码 (重启后仍有效): {pw}", file=sys.stderr)
print(f" ⚠️ 请使用此密码登录并配置双因素认证", file=sys.stderr)
print(f"{'='*50}\n", file=sys.stderr)
bind_host = os.environ.get("FLASK_BIND", "127.0.0.1")
app.run(host=bind_host, port=5000, debug=False, threaded=True)