diff --git a/.github/workflows/publish-backend.yml b/.github/workflows/publish-backend.yml deleted file mode 100644 index 814560dd..00000000 --- a/.github/workflows/publish-backend.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: 后端部署(API,IdentityServer4,Gateways) -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install Dotnet 6.x - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "6.0" - include-prerelease: True - - name: 编译 - run: dotnet build aspnet-core/Lion.AbpPro.sln - - - name: 单元测试 - run: dotnet test aspnet-core/services/test/Lion.AbpPro.Domain.Tests/Lion.AbpPro.Domain.Tests.csproj - - - name: 发布->Lion.AbpPro.HttpApi.Host - run: dotnet publish aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Lion.AbpPro.HttpApi.Host.csproj -o Lion.AbpPro.HttpApi.Host - - - name: 发布->Lion.AbpPro.WebGateway - run: dotnet publish aspnet-core/gateways/Lion.AbpPro.WebGateway/Lion.AbpPro.WebGateway.csproj -o Lion.AbpPro.WebGateway - - - name: 部署->Lion.AbpPro.HttpApi.Host - uses: easingthemes/ssh-deploy@v2.2.11 - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - ARGS: "-avzr --delete --exclude 'appsettings.json'" - SOURCE: "Lion.AbpPro.HttpApi.Host" - REMOTE_HOST: ${{ secrets.REMOTE_HOST }} - REMOTE_USER: ${{ secrets.REMOTE_USER }} - TARGET: "/root/wwwroot" - - - name: 部署->Lion.AbpPro.WebGateway - uses: easingthemes/ssh-deploy@v2.2.11 - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - ARGS: "-avzr --delete --exclude 'appsettings.json'" - SOURCE: "Lion.AbpPro.WebGateway" - REMOTE_HOST: ${{ secrets.REMOTE_HOST }} - REMOTE_USER: ${{ secrets.REMOTE_USER }} - TARGET: "/root/wwwroot" diff --git a/.github/workflows/publish-frontend.yml b/.github/workflows/publish-frontend.yml deleted file mode 100644 index 0e20195d..00000000 --- a/.github/workflows/publish-frontend.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: 前端部署(vue) -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.3.1 - with: - persist-credentials: false - - - name: Install pnpm - uses: pnpm/action-setup@v2.2.2 - with: - version: 6.0.2 - - - name: 编译|发布 - run: | - cd vben28 - pnpm install - npm run build - - - name: 部署->Vue - uses: easingthemes/ssh-deploy@v2.2.11 - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - ARGS: "-avzr --delete" - SOURCE: "vben28/dist" - REMOTE_HOST: ${{ secrets.REMOTE_HOST }} - REMOTE_USER: ${{ secrets.REMOTE_USER }} - TARGET: "/root/wwwroot" diff --git a/Readme.md b/Readme.md index 17d0c060..15c8b5ea 100644 --- a/Readme.md +++ b/Readme.md @@ -6,53 +6,18 @@

Abp Vnext Pro

-
- -Abp Vnext Vue 实现版本 - - - - - - - - - - - - - - - -
- -
+ ## 🔗 链接 - [文档地址](http://doc.cncore.club/) -- [演示地址 ](http://120.24.194.14:8012/) - -## ✨ 系统功能 +- [演示地址 ](http://abp.cncore.club/) +- [视频教程 ](https://www.bilibili.com/video/BV1pt4y1E7aZ) -- [x] 用户管理 -- [x] 角色管理 -- [x] 审计日志 -- [x] 后台任务 -- [x] 集成事件 -- [x] SinglaR 消息通知(站内信) -- [x] 多语言 -- [x] 数据字典 -- [x] 容器化部署 -- [x] 单元测试 -- [x] ES 日志 -- [x] Setting 管理 -- [x] 多租户 -- [x] 文件管理 -## 📦 安装 +## 📦 快速开始 -- 安装Cli,Git 仓库(https://github.com/WangJunZzz/Lion.AbpPro.Cli) +- 安装Cli,[Git 仓库](https://github.com/WangJunZzz/Lion.AbpPro.Cli) ```bash dotnet tool install Lion.AbpPro.Cli -g ``` @@ -74,9 +39,25 @@ lion.abp new abp-vnext-pro-basic -c 公司名称 -p 项目名称 -v 版本(默 lion.abp new abp-vnext-pro-basic-no-ocelot -c 公司名称 -p 项目名称 -v 版本(默认LastRelease) -o 项目输出路径(可选). ``` -## 🗺 开发路线 -查看[开发路线](https://github.com/WangJunZzz/abp-vnext-pro/projects)来了解我们的开发计划。 + +## ✨ 系统功能 + +- [x] 用户管理 +- [x] 角色管理 +- [x] 审计日志 +- [x] 后台任务 +- [x] 集成事件 +- [x] SinglaR 消息通知(站内信) +- [x] 多语言 +- [x] 数据字典 +- [x] 容器化部署 +- [x] 单元测试 +- [x] ES 日志 +- [x] Setting 管理 +- [x] 多租户 +- [x] 文件管理 + ## 🤝 如何贡献 diff --git a/aspnet-core/gateways/Lion.AbpPro.WebGateway/appsettings.Production.json b/aspnet-core/gateways/Lion.AbpPro.WebGateway/appsettings.Production.json new file mode 100644 index 00000000..a11d0236 --- /dev/null +++ b/aspnet-core/gateways/Lion.AbpPro.WebGateway/appsettings.Production.json @@ -0,0 +1,52 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*", + "App": { + "SelfUrl": "http://localhost:44314", + "CorsOrigins": "http://120.24.194.14:8012,http://localhost:4200,http://localhost:80" + }, + "GlobalConfiguration": { + }, + "Routes": [ + { + "DownstreamPathTemplate": "/{url}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "lion.abp.pro", + "Port": 8080 + } + ], + "UpstreamPathTemplate": "/gateway/{url}", + "UpstreamHttpMethod": [ + "Get", + "Post", + "Put", + "Delete" + ] + }, + { + "DownstreamPathTemplate": "/{url}", + "DownstreamScheme": "ws", + "DownstreamHostAndPorts": [ + { + "Host": "lion.abp.pro", + "Port": 8080 + } + ], + "UpstreamPathTemplate": "/ws/{url}", + "UpstreamHttpMethod": [ + "Get", + "Post", + "Put", + "Delete" + ] + } + ] +} \ No newline at end of file diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs index 00c96160..8904e1a2 100644 --- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/AbpProHttpApiHostModule.cs @@ -33,7 +33,6 @@ namespace Lion.AbpPro ConfigureSwaggerServices(context); ConfigureJwtAuthentication(context, configuration); ConfigureHangfireMysql(context); - ConfigureHttpClient(context); ConfigureMiniProfiler(context); ConfigureAbpExceptions(context); ConfigureIdentity(context); @@ -215,33 +214,6 @@ namespace Lion.AbpPro .PersistKeysToStackExchangeRedis(redis, "AbpPro-Protection-Keys"); } - - private void ConfigureHttpClient(ServiceConfigurationContext context) - { - context.Services.AddHttpClient(context.Services.GetConfiguration().GetSection("HttpClient:Sts:Name").Value, - options => - { - options.BaseAddress = - new Uri(context.Services.GetConfiguration().GetSection("HttpClient:Sts:Url") - .Value); - }); - context.Services.AddHttpClient(context.Services.GetConfiguration().GetSection("HttpClient:Github:Name").Value, - options => - { - options.BaseAddress = - new Uri(context.Services.GetConfiguration().GetSection("HttpClient:Github:Url") - .Value); - }); - context.Services.AddHttpClient(context.Services.GetConfiguration().GetSection("HttpClient:GithubApi:Name").Value, - options => - { - options.BaseAddress = - new Uri(context.Services.GetConfiguration().GetSection("HttpClient:GithubApi:Url") - .Value); - }); - - } - /// /// 配置Identity /// diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.Production.json b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.Production.json new file mode 100644 index 00000000..2078d998 --- /dev/null +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.Production.json @@ -0,0 +1,81 @@ +{ + "Serilog": { + "Using": [ + "Serilog.Sinks.Console", + "Serilog.Sinks.File" + ], + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Information", + "Volo.Abp": "Information", + "Hangfire": "Information", + "DotNetCore.CAP": "Information", + "Serilog.AspNetCore": "Information", + "Microsoft.EntityFrameworkCore": "Warning", + "Microsoft.AspNetCore": "Information" + } + }, + "WriteTo": [ + { + "Name": "Console" + }, + { + "Name": "File", + "Args": { + "path": "logs/logs-.txt", + "rollingInterval": "Day" + } + } + ] + }, + "App": { + "SelfUrl": "http://localhost:44315", + "CorsOrigins": "http://*:*,https://*,http://*,http://localhost,http://116.205.176.173" + }, + "ConnectionStrings": { + "Default": "Data Source=mysql;Port=3306;Database=LionAbpProDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" + }, + "Redis": { + "Configuration": "redis,password=1q2w3E*,defaultdatabase=1" + }, + "Jwt": { + "Audience": "Lion.AbpPro", + "SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", + "Issuer": "Lion.AbpPro", + "ExpirationTime": 2 + }, + "Cap": { + "Enabled": true, + "RabbitMq": { + "HostName": "rabbitmq", + "Port": 5672, + "UserName": "admin", + "Password": "1q2w3E*" + } + }, + "ElasticSearch": { + "Enabled": "false", + "Url": "http://es.cn", + "IndexFormat": "Lion.AbpPro.development.{0:yyyy.MM.dd}", + "UserName": "elastic", + "Password": "aVVhjQ95RP7nbwNy", + "SearchIndexFormat": "Lion.AbpPro.development*" + }, + "Consul": { + "Enabled": false, + "Host": "http://localhost:8500", + "Service": "Project-Service" + }, + "AliYun": { + "OSS": { + // https://help.aliyun.com/document_detail/100624.html + "AccessKeyId": "AccessKeyId", + "AccessKeySecret": "AccessKeySecret", + "Endpoint": "oss-cn-shenzhen.aliyuncs.com", + "ContainerName": "ContainerName", + "RegionId": "RegionId", + "RoleArn": "RoleArn" + } + } +} \ No newline at end of file diff --git a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json index 230ebeb8..320f8054 100644 --- a/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.json @@ -43,7 +43,7 @@ "Audience": "Lion.AbpPro", "SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", "Issuer": "Lion.AbpPro", - "ExpirationTime": 30 + "ExpirationTime": 2 }, "Cap": { "Enabled": "false", @@ -61,23 +61,6 @@ "Password": "aVVhjQ95RP7nbwNy", "SearchIndexFormat": "Lion.AbpPro.development*" }, - "HttpClient": { - "Sts": { - "Name": "Sts", - "Url": "http://localhost:44354" - }, - "Github": { - "Name": "Github", - "Url": "https://github.com", - "ClientId": "127fc528f611879fba03", - "ClientSecret": "fd0914e9e8e28b51dd5efe381121429279e43973" - }, - "GithubApi": { - "Name": "GithubApi", - "Url": "https://api.github.com", - "ClientName": "AbpPro" - } - }, "Consul": { "Enabled": false, "Host": "http://localhost:8500", @@ -85,12 +68,13 @@ }, "AliYun": { "OSS": { - "AccessKeyId": "LTAI5tLkt3vvScGPVZ5qKJDc1S", - "AccessKeySecret": "BixV8vP5uPrbsdwjYzzsEXOPjkxPST2S", + // https://help.aliyun.com/document_detail/100624.html + "AccessKeyId": "AccessKeyId", + "AccessKeySecret": "AccessKeySecret", "Endpoint": "oss-cn-shenzhen.aliyuncs.com", - "ContainerName": "lion-abp-pro", - "RegionId": "oss-cn-shenzhen", - "RoleArn": "acs:ram::1846393972471789:role/ramosstestst" + "ContainerName": "ContainerName", + "RegionId": "RegionId", + "RoleArn": "RoleArn" } } } \ No newline at end of file diff --git a/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Dockerfile b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Dockerfile new file mode 100644 index 00000000..29ec3dde --- /dev/null +++ b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 + +# 创建目录 +RUN mkdir /app + +COPY publish /app + +# 设置工作目录 +WORKDIR /app + +# 设置时区 .net6 才有这个问题 +ENV TZ=Asia/Shanghai + +# 设置环境变量 +ENV ASPNETCORE_ENVIRONMENT=Production + +ENTRYPOINT ["dotnet", "Lion.AbpPro.DbMigrator.dll"] + + diff --git a/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Lion.AbpPro.DbMigrator.csproj b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Lion.AbpPro.DbMigrator.csproj index 4e687438..1f4c9fea 100644 --- a/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Lion.AbpPro.DbMigrator.csproj +++ b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/Lion.AbpPro.DbMigrator.csproj @@ -13,7 +13,7 @@ - + @@ -30,6 +30,9 @@ Always + + Always + diff --git a/aspnet-core/services/src/Lion.AbpPro.DbMigrator/appsettings.Production.json b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/appsettings.Production.json new file mode 100644 index 00000000..e711c4f8 --- /dev/null +++ b/aspnet-core/services/src/Lion.AbpPro.DbMigrator/appsettings.Production.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "Default": "Data Source=localhost;Port=3306;Database=LionAbpProDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" + } +} \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..4363e452 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,80 @@ +version: '3' +services: + mysql: + image: bitnami/mysql:8.0.30 + container_name: mysql + restart: always + environment: + MYSQL_ROOT_USER: "root" # 管理员账户名 + MYSQL_ROOT_PASSWORD: "1q2w3E*" # 管理员密码 + MYSQL_AUTHENTICATION_PLUGIN: "mysql_native_password" # 认证插件 + MYSQL_CHARACTER_SET: utf8mb4 # 默认字符集(服务器级别) + MYSQL_COLLATE: utf8mb4_unicode_ci # 默认排序规则(服务器级别) + MYSQL_ENABLE_SLOW_QUERY: 0 # 是否开启慢查询,0:不开启 1:开启 + MYSQL_LONG_QUERY_TIME: 5.0 # 慢查询超时时间 + ports: + - "3306:3306" + + redis: + image: redis:6.2.6 + container_name: redis + restart: always + ports: + - 6379:6379 + command: ["redis-server", "--appendonly", "yes", "--requirepass","1q2w3E*"] + + rabbitmq: + image: rabbitmq:3.8-management + container_name: rabbitmq + restart: always + ports: + - "5672:5672" + - "15672:15672" + environment: + - RABBITMQ_DEFAULT_USER=admin + - RABBITMQ_DEFAULT_PASS=1q2w3E* + + lion.abp.pro: + build: ../aspnet-core/services/host/Lion.AbpPro.HttpApi.Host + container_name: lion.abp.pro + restart: always + ports: + - "8080:80" + depends_on: + - mysql + - rabbitmq + - redis + - lion.abp.pro.migrator + links: + - mysql + - redis + - rabbitmq + + lion.abp.pro.migrator: + build: ../aspnet-core/services/src/Lion.AbpPro.DbMigrator + container_name: lion.abp.pro.migrator + depends_on: + - mysql + links: + - mysql + + lion.abp.pro.gateway: + build: ../aspnet-core/gateways/Lion.AbpPro.WebGateway + container_name: lion.abp.pro.gateway + ports: + - "8081:80" + depends_on: + - lion.abp.pro + links: + - lion.abp.pro + + lion.abp.pro.vben28: + build: ../vben28 + container_name: lion.abp.pro.vben28 + ports: + - "80:80" + depends_on: + - lion.abp.pro.gateway + links: + - lion.abp.pro.gateway + diff --git a/vben28/.env.development b/vben28/.env.development index 587a2ccf..0c2799ee 100644 --- a/vben28/.env.development +++ b/vben28/.env.development @@ -21,9 +21,6 @@ VITE_GLOB_UPLOAD_URL=/upload # Interface prefix VITE_GLOB_API_URL_PREFIX= -# 认证授权服务器地址 -VITE_AUTH_URL= http://localhost:44354 - # 接口地址 VITE_API_URL= http://localhost:44314/gateway diff --git a/vben28/.env.production b/vben28/.env.production index af0ad1eb..f98cd49d 100644 --- a/vben28/.env.production +++ b/vben28/.env.production @@ -34,13 +34,10 @@ VITE_USE_PWA = false # Is it compatible with older browsers VITE_LEGACY = false -# 认证授权服务器地址 -VITE_AUTH_URL= http://120.24.194.14:8013 # 接口地址 - -VITE_API_URL= http://120.24.194.14:8014/gateway +VITE_API_URL= http://abp.cncore.club:8080 # WEBSOCKE 地址 -VITE_WEBSOCKE_URL= http://120.24.194.14:8014/ws +VITE_WEBSOCKE_URL= http://abp.cncore.club:8080