diff --git a/.env b/.env deleted file mode 100644 index 2c32f73..0000000 --- a/.env +++ /dev/null @@ -1,15 +0,0 @@ -# 数据库配置 -MYSQL_ROOT_PASSWORD=root -MYSQL_DATABASE=comcms -MYSQL_USER=comcms -MYSQL_PASSWORD=comcms123 - -# Redis 配置 -REDIS_PASSWORD= - -# ASP.NET Core 环境 -ASPNETCORE_ENVIRONMENT=Production - -# 数据库连接字符串(会被覆盖,但保留作为参考) -# ConnectionStrings__dbconn__ConnectionString=Server=mysql;Port=3306;Database=comcms;Uid=comcms;Pwd=comcms123;charset=utf8mb4; -# ConnectionStrings__dbconn__providerName=MySql.Data.MySqlClient \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..9ebc5be --- /dev/null +++ b/.env.example @@ -0,0 +1,21 @@ +# MySQL 配置 +MYSQL_HOST=localhost +MYSQL_PORT=3306 +MYSQL_DATABASE=comcms +MYSQL_USER=root +MYSQL_PASSWORD=your_password_here + +# Redis 配置 +REDIS_HOST=127.0.0.1 +REDIS_PORT=6379 +REDIS_PASSWORD=your_redis_password_here +REDIS_DB=2 + +# JWT 配置 +JWT_SECRET=your_jwt_secret_here + +# 系统配置 +SIGN_SALT=your_salt_here + +# ASP.NET Core 环境 +ASPNETCORE_ENVIRONMENT=Development diff --git a/.gitignore b/.gitignore index d6b5635..b3a4088 100644 --- a/.gitignore +++ b/.gitignore @@ -313,3 +313,9 @@ COMCMS.Web/wwwroot/install.lock # others .cursorrules + +# 环境变量文件(包含敏感信息) +.env + +# 环境变量文件(包含敏感信息) +.env diff --git a/COMCMS.API/COMCMS.API.csproj b/COMCMS.API/COMCMS.API.csproj index df10349..e382306 100644 --- a/COMCMS.API/COMCMS.API.csproj +++ b/COMCMS.API/COMCMS.API.csproj @@ -1,7 +1,7 @@  - net10.0 + net9.0 diff --git a/COMCMS.Common/COMCMS.Common.csproj b/COMCMS.Common/COMCMS.Common.csproj index 5c223ea..3cace83 100644 --- a/COMCMS.Common/COMCMS.Common.csproj +++ b/COMCMS.Common/COMCMS.Common.csproj @@ -1,7 +1,7 @@  - net10.0 + net9.0 diff --git a/COMCMS.Core/COMCMS.Core.csproj b/COMCMS.Core/COMCMS.Core.csproj index f9d7152..0de11a2 100644 --- a/COMCMS.Core/COMCMS.Core.csproj +++ b/COMCMS.Core/COMCMS.Core.csproj @@ -1,7 +1,7 @@  - net10.0 + net9.0 diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj index 732e763..830f41f 100644 --- a/COMCMS.Web/COMCMS.Web.csproj +++ b/COMCMS.Web/COMCMS.Web.csproj @@ -1,15 +1,15 @@  - net10.0 + net9.0 Linux - - - + + + diff --git a/COMCMS.Web/Dockerfile b/COMCMS.Web/Dockerfile index 712dec2..ac1fb3b 100644 --- a/COMCMS.Web/Dockerfile +++ b/COMCMS.Web/Dockerfile @@ -1,7 +1,7 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. # 构建阶段 -FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src # 复制项目文件 @@ -27,7 +27,7 @@ FROM build AS publish RUN dotnet publish "COMCMS.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false # 运行时阶段 -FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base # 安装 curl 用于健康检查 USER root diff --git a/COMCMS.Web/appsettings.json b/COMCMS.Web/appsettings.json index 5d180eb..a21ed03 100644 --- a/COMCMS.Web/appsettings.json +++ b/COMCMS.Web/appsettings.json @@ -38,7 +38,7 @@ }, "connectionStrings": { "dbconn": { - "connectionString": "Server=.;Port=3306;Database=comcms;Uid=root;Pwd=root;charset=utf8mb4", + "connectionString": "Server=localhost;Port=3306;Database=comcms;Uid=root;Pwd=root;charset=utf8mb4", "providerName": "MySql.Data.MySqlClient" }, "mssqlconnon": { diff --git a/Lib.Core/Lib.Core.csproj b/Lib.Core/Lib.Core.csproj index 0273809..c2366f2 100644 --- a/Lib.Core/Lib.Core.csproj +++ b/Lib.Core/Lib.Core.csproj @@ -1,7 +1,7 @@ - net10.0 + net9.0