修复数据库迁移问题、新增环境变量读写

This commit is contained in:
2025-07-15 17:32:00 +08:00
parent dc522a8e93
commit 33cca4e271
10 changed files with 432 additions and 39 deletions

View File

@@ -1,3 +1,9 @@
import os
from dotenv import load_dotenv
from pkg.log import log
load_dotenv()
APP_NAME = 'DiskNext Server'
summary = '一款基于 FastAPI 的可公私兼备的网盘系统'
description = 'DiskNext Server 是一款基于 FastAPI 的网盘系统,支持个人和企业使用。它提供了高性能的文件存储和管理功能,支持多种认证方式。'
@@ -7,6 +13,18 @@ BackendVersion = "0.0.1"
IsPro = False
debug: bool = os.getenv("DEBUG", "false").lower() in ("true", "1", "yes")
if debug:
log.info("Debug mode is enabled. This is not recommended for production use.")
host: str = os.getenv("HOST", "0.0.0.0")
port: int = int(os.getenv("PORT", 5213))
log.info(f"Starting DiskNext Server {BackendVersion} on {host}:{port}")
database_url: str = os.getenv("DATABASE_URL", "sqlite+aiosqlite:///disknext.db")
tags_meta = [
{
"name": "site",