Coder Social home page Coder Social logo

j2eeliao / xuxiaowei-cloud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuxiaowei-cloud/xuxiaowei-cloud

0.0 0.0 0.0 7.24 MB

基于 JDK 8/11、Spring Boot 2.7.x、OAuth 2.1、Vite 4、Vue 3、Element Plus 的微服务。支持支付宝、钉钉、码云、QQ、微信、企业微信、微博等第三方登录。包含基于 GitLab Runner 的 kubernetes(k8s)、Docker、Shell 等 CI/CD 流水线进行自动构建、制作 Docker 镜像、发布。永久免费开源

License: Apache License 2.0

Shell 0.15% JavaScript 10.53% Java 70.42% Rust 0.03% TypeScript 3.01% CSS 0.10% HTML 0.24% Batchfile 0.01% Vue 10.03% FreeMarker 4.28% Dockerfile 1.22%

xuxiaowei-cloud's Introduction

xuxiaowei-cloud

徐晓伟微服务

License-Anti Link-996 QQ群

基于 JDK 8/11、Spring Boot 2.7.x、OAuth 2.1、Vite 4、Vue 3、Element Plus 的微服务。
支持支付宝、钉钉、码云、GitHub、GitLab、QQ、微信、企业微信、微博等第三方登录。
包含基于 GitLab Runner 的 kubernetes(k8s)、Docker、Shell 等执行器执行 CI/CD 流水线进行自动构建、制作 Docker 镜像、发布。
永久免费开源。

为简化开发工作、提高生产率、解决常见问题而生

相关项目

依赖版本对比

后端

  • 更新日期:2023-09-18
依赖 本项目版本 新版 说明
spring-boot v2.7.15 限制 Spring Boot 2.x,点击查看 Spring Boot 3.x.x 的项目
spring-cloud v2021.0.8 限制 Spring Boot 2.x
spring-cloud-alibaba v2021.0.5.0 限制 Spring Boot 2.x,Spring Cloud Alibaba
spring-boot-admin v2.7.11 限制 Spring Boot 2.x
spring-authorization-server v0.4.3 限制 Spring Boot 2.x
mybatis v2.3.1 限制 Spring Boot 2.x,指 mybatis-spring-boot-starter
mybatis-plus v3.5.3.2
dynamic-datasource v3.6.1 限制 JDK 8,指 dynamic-datasource-spring-boot-starter
springdoc v1.7.0 用于生成 API doc,支持从 javadoc 中获取字段注释
guava v32.1.2-jre
fastjson v2.0.40 使用的是不带英文后缀的版本
hutool v5.8.22

前端

  • 更新日期:2023-09-18
依赖 本项目版本 新版 说明
@element-plus/icons-vue 2.1.0
@tauri-apps/api 1.4.0
@toast-ui/editor 3.2.2
@wangeditor/editor-for-vue 5.1.12
axios 1.5.0
crypto-js 4.1.1
echarts 5.4.3
element-plus 2.3.14
js-cookie 3.0.5
jsencrypt 3.3.2
pinia 2.1.6
sockjs-client 1.6.1
stompjs 2.3.3
vue 3.3.4
vue-clipboard3 2.0.0
vue-echarts 6.6.1
vue-router 4.2.4
@tauri-apps/cli 1.4.0
@types/crypto-js 4.1.2
@types/node 20.6.2
@typescript-eslint/eslint-plugin 6.7.0
@typescript-eslint/parser 6.7.0
@vitejs/plugin-vue 4.3.4
eslint 8.49.0
eslint-config-standard 17.1.0
eslint-plugin-import 2.28.1
eslint-plugin-n 16.1.0
eslint-plugin-promise 6.1.1
eslint-plugin-vue 9.17.0
lint-staged 14.0.1
terser 5.19.4
typescript 5.2.2
unocss 0.55.7
unplugin-auto-import 0.16.6
unplugin-vue-components 0.25.2
vite 4.4.9
vue-tsc 1.8.11

模块

cloud.xuxiaowei
├──xuxiaowei-cloud-starter-parent           // 微服务父模块
│    └──gateway                             // 网关服务
│    └──admin-server                        // 监控(管理)服务
│    └──passport-ui                         // 登录服务UI
│    └──passport                            // 登录服务
│    └──ui                                  // UI
│    └──resource-services-parent            // 资源服务父模块
│        └──canal                           // 阿里巴巴 MySQL binlog 增量订阅、消费服务
│        └──file                            // 文件服务
│        └──master-data                     // 主数据服务
│        └──user                            // 用户服务
│        └──websocket                       // WebSocket 服务
│        └──webservice                      // WebService 服务
│        └──wechat-miniprogram              // 微信小程序服务
│        └──wechat-offiaccount              // 微信公众号服务
│    └──utils                               // 工具类
│    └──cloud-commons-parent                // 微服务公共组件父模块
│        └──cloud-starter-core              // 核心组件
│        └──cloud-starter-idempotent        // 幂等组件
│        └──cloud-starter-loadbalancer      // 负载均衡组件
│        └──cloud-starter-log               // 日志组件
│        └──cloud-starter-mybatis           // MyBatis 组件
│        └──cloud-starter-oauth2            // OAuth2 组件
│        └──cloud-starter-openfeign         // OpenFeign 组件
│        └──cloud-starter-redis             // Redis 组件
│        └──cloud-starter-session-redis     // Session Redis 组件
│        └──cloud-starter-validation        // 验证组件
│    └──xxl-job-admin                       // XXL JOB Admin
│    └──example-parent                      // 示例模块(独立模块)
│        └──oauth2-client                   // OAuth 2.0 客户端(独立服务)
│        └──cxf-client                      // CXF 2.0 客户端(独立服务)

端口

  • 注意:本项目主要使用 IDEA 编写,为了方便,引入了环境变量插件 EnvFile环境变量文件 ,如果需要调整,请自行修改该文件或删除
模块 模块名称 域名(虚拟) 端口 kubernetes Service 端口
Nacos 注册、配置中心 nacos.example.xuxiaowei.cloud 8848 30848/31848
MySQL 数据库 mysql.example.xuxiaowei.cloud 3306 30306
Redis 数据库 redis.example.xuxiaowei.cloud 6379 30379
canal-deployer 阿里巴巴 MySQL binlog 增量订阅&消费组件 canal-deployer.example.xuxiaowei.cloud 11111 暂未部署
sentinel-dashboard 流控防护组件 22222 32222
ui UI example.xuxiaowei.cloud 1001 30180
gateway 网关 gateway.example.xuxiaowei.cloud 1101 31101
admin-server 监控(管理) admin-server.example.xuxiaowei.cloud 1201 31201
passport 登录 passport.example.xuxiaowei.cloud 1401 31401
passport-ui 登录UI passport.example.xuxiaowei.cloud 1411 放在 passport 中部署
canal 阿里巴巴 MySQL binlog 增量订阅、消费服务 1601 31601
user 用户服务 1701 31701
websocket WebSocket 服务 1801 31801
webservice WebService 服务 1901 31901
wechat-miniprogram 微信小程序服务 2001 32001
wechat-offiaccount 微信公众号服务 2101 32101
master-data 主数据服务 2201 32201
file 文件服务 2301 32301
xxl-job-admin XXL Job Admin 5101 30101
oauth2-client OAuth 2.0 客户端(独立服务) 10001 以下是仅用于测试的客户端,无需部署
cxf-client CXF 客户端(独立服务) 10002
  • 流控防护限流端口
模块 模块名称 限流端口
gateway 网关 9001
passport 登录 9002
user 用户服务 9003
websocket WebSocket 服务 9004
webservice WebService 服务 9005
wechat-miniprogram 微信小程序服务 9006
wechat-offiaccount 微信公众号服务 9007
master-data 主数据服务 9008
file 文件服务 9009

租户、用户名与密码

租户ID 租户名 账户名/用户名 密码 启用 说明
1 徐晓伟工作室(默认) xuxiaowei 123 1
1 徐晓伟工作室(默认) xuxiaowei-2 123 1 相同组织不能有重复的用户名
2 青岛XX公司 xuxiaowei 123 1 不同组织可以有相同的用户名
3 上海XX公司 zhangsan 123 1

其他服务

名称 地址 账户名 密码
XXL Job http://127.0.0.1:5101/xxl-job-admin admin 123456
网关 Swagger http://127.0.0.1:1101/webjars/swagger-ui/index.html
服务 Swagger http://127.0.0.1:端口/swagger-ui/index.html
docker 守护程序的 URL http://host.docker.example.xuxiaowei.cloud:2375
docker 私库 URL registry.docker.example.xuxiaowei.cloud admin xuxiaowei

租户、客户ID与秘钥

tenant_id tenant_name id client_id client_id_issued_at client_secret client_secret_expires_at client_authentication_methods authorization_grant_types redirect_uris scopes require-authorization-consent authorization-code-time-to-live access-token-time-to-live refresh-token-time-to-live reuse-refresh-tokens id-token-signature-algorithm token-endpoint-authentication-signing-algorithm access-token-format
租户ID 租户名 说明 主键 客户ID 客户ID发布时间 客户秘钥 客户秘钥过期时间 授权认证方法 授权类型 授权码重定向地址 范围 是否需要客户授权同意 授权code有效时间 授权Token有效时间 刷新Token有效时间 重复使用刷新Token 授权Token签名算法 private_key_jwt、client_secret_jwt 算法 授权Token的格式
1 徐晓伟工作室(默认) 网站 1 xuxiaowei_client_id 2022-05-30 17:17:41 xuxiaowei_client_secret client_secret_post,client_secret_basic refresh_token,implicit,client_credentials,authorization_code http://127.0.0.1:1401/code/xuxiaowei_client_id,http://gateway.example.xuxiaowei.cloud:1101/passport/code/xuxiaowei_client_id,https://gateway.example.xuxiaowei.cloud/passport/code/xuxiaowei_client_id snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 微信小程序使用 2 xuxiaowei_client_wechat_miniprogram_id 2022-05-30 17:17:41 xuxiaowei_client_wechat_miniprogram_secret client_secret_post,client_secret_basic refresh_token,wechat_miniprogram snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 微信公众号使用 3 xuxiaowei_client_wechat_offiaccount_id 2022-05-30 17:17:41 xuxiaowei_client_wechat_offiaccount_secret client_secret_post,client_secret_basic refresh_token,wechat_offiaccount snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 微信扫码使用 4 xuxiaowei_client_wechat_oplatform_id 2022-05-30 17:17:41 xuxiaowei_client_wechat_oplatform_secret client_secret_post,client_secret_basic refresh_token,wechat_oplatform_website snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 码云Gitee使用 5 xuxiaowei_client_gitee_id 2022-05-30 17:17:41 xuxiaowei_client_gitee_secret client_secret_post,client_secret_basic refresh_token,gitee snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) QQ扫码使用 6 xuxiaowei_client_qq_website_id 2022-05-30 17:17:41 xuxiaowei_client_qq_website_secret client_secret_post,client_secret_basic refresh_token,qq_website snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 微博扫码使用 7 xuxiaowei_client_weibo_id 2022-05-30 17:17:41 xuxiaowei_client_weibo_secret client_secret_post,client_secret_basic refresh_token,weibo_website snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) gitlab使用 8 xuxiaowei_client_gitlab_id 2022-05-30 17:17:41 xuxiaowei_client_gitlab_secret client_secret_post,client_secret_basic refresh_token,gitlab snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 企业微信扫码使用 9 xuxiaowei_client_wechat_work_website_id 2022-05-30 17:17:41 xuxiaowei_client_wechat_work_website_secret client_secret_post,client_secret_basic refresh_token,wechat_work_website snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) github使用 10 xuxiaowei_client_github_id 2022-05-30 17:17:41 xuxiaowei_client_github_secret client_secret_post,client_secret_basic refresh_token,github snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 钉钉dingtalk使用 11 xuxiaowei_client_dingtalk_id 2022-05-30 17:17:41 xuxiaowei_client_dingtalk_secret client_secret_post,client_secret_basic refresh_token,dingtalk snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) QQ小程序使用 12 xuxiaowei_client_qq_miniprogram_id 2022-05-30 17:17:41 xuxiaowei_client_qq_miniprogram_secret client_secret_post,client_secret_basic refresh_token,qq_miniprogram snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 支付宝小程序使用 13 xuxiaowei_client_alipay_miniprogram_id 2022-05-30 17:17:41 xuxiaowei_client_alipay_miniprogram_secret client_secret_post,client_secret_basic refresh_token,alipay_miniprogram snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 支付宝网站应用使用 14 xuxiaowei_client_alipay_oplatform_website_id 2022-05-30 17:17:41 xuxiaowei_client_alipay_oplatform_website_secret client_secret_post,client_secret_basic refresh_token,alipay_oplatform_website snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 飞书网页应用使用 15 xuxiaowei_client_feishu_webpage_id 2022-05-30 17:17:41 xuxiaowei_client_feishu_webpage_secret client_secret_post,client_secret_basic refresh_token,feishu_webpage snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
1 徐晓伟工作室(默认) 使用 client_secret_jwt 验证客户凭证使用 16 xuxiaowei_client_client_secret_jwt_id 2022-05-30 17:17:41 6c63d616146a4c3db7d0d2f3ec6d93ce client_secret_jwt client_credentials snsapi_base,snsapi_info false 300 43200 2592000 true RS256 HS256 self-contained
2 青岛XX公司 网站 17 tenant_id_1_client_id 2022-05-30 17:17:41 tenant_id_1_client_secret client_secret_post,client_secret_basic refresh_token,implicit,client_credentials,authorization_code http://127.0.0.1:1401/code/tenant_id_1_client_id,http://gateway.example.xuxiaowei.cloud:1101/passport/code/tenant_id_1_client_id,https://gateway.example.xuxiaowei.cloud/passport/code/tenant_id_1_client_id snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
3 上海XX公司 网站 18 tenant_id_2_client_id 2022-05-30 17:17:41 tenant_id_2_client_secret client_secret_post,client_secret_basic refresh_token,implicit,client_credentials,authorization_code http://127.0.0.1:1401/code/tenant_id_2_client_id,http://gateway.example.xuxiaowei.cloud:1101/passport/code/tenant_id_2_client_id,https://gateway.example.xuxiaowei.cloud/passport/code/tenant_id_2_client_id snsapi_base,snsapi_info false 300 43200 2592000 true RS256 self-contained
  • authorization_grant_types
    • 授权码模式 authorization_code
    • 刷新Token权限 refresh_token
    • 客户端凭证模式 client_credentials
    • 密码模式 password
    • 简化模式 implicit
    • 微信小程序(个人开发适配 OAuth 2.1、微信小程序的授权方式) wechat_miniprogram
    • 微信公众号(个人开发适配 OAuth 2.1、微信公众号的授权方式) wechat_offiaccount
    • 微信扫码(个人开发适配 OAuth 2.1、微信扫码的授权方式) wechat_oplatform_website
    • 码云(个人开发适配 OAuth 2.1、码云的授权方式) gitee
    • QQ扫码(个人开发适配 OAuth 2.1、QQ扫码的授权方式) qq_website
    • 微博扫码(个人开发适配 OAuth 2.1、微博扫码的授权方式) weibo_website
    • gitlab授权(个人开发适配 OAuth 2.1、gitlab的授权方式) gitlab
    • 企业微信扫码(个人开发适配 OAuth 2.1、企业微信扫码的授权方式) wechat_work_website
    • github授权(个人开发适配 OAuth 2.1、gitlab的授权方式) github
    • 钉钉dingtalk扫码(个人开发适配 OAuth 2.1、钉钉dingtalk扫码的授权方式) dingtalk
    • 支付宝小程序(个人开发适配 OAuth 2.1、支付宝小程序的授权方式) alipay_miniprogram
    • 支付宝网站应用(个人开发适配 OAuth 2.1、支付宝网站应用的授权方式) alipay_oplatform_website
    • 飞书网页应用(个人开发适配 OAuth 2.1、飞书网页应用的授权方式) feishu_webpage

仓库、分支、提交记录

  1. 使用了哪六个仓库?

    1. 极狐 GitLab
    2. 码云 Gitee
    3. GitCode
    4. GitLink
    5. GitHub
    6. GitLab
  2. 上述六个仓库以哪个为准?其余仓库何时同步?

    1. 极狐 GitLab 为准
    2. 其余仓库每日同步
  3. 提交记录中的地址为何不准确?

    1. 由于本项目使用了多个代码托管平台,并且某些代码托管平台的规则相同,导致提交注释中简写地址不存在或者不匹配,请根据情况区分后到各个平台查看:
      1. 如:dependabot[bot] <[email protected]> 提交的PR,全部都在GitHub平台
  4. 各个仓库的作用?

仓库地址 作用 说明
极狐 GitLab 国内备份仓库,主仓库 供国内用户访问、提问、下载资源、GitLab Runner CI/CD 流水线打包/制作Docker镜像、Kubernetes(k8s)/shell/docker 发布项目使用,开源项目 免费使用 GitLab Runner
码云 Gitee 国内备份仓库 已关闭该仓库的流水线,后续仅在 极狐 GitLab 上运行流水线,由于技术栈(项目使用 GitLab Runner CI/CD 流水线测试与发布)及不可抗力的因素,将来会关闭 Gitee 的 issues,并将历史数据迁移到 极狐 GitLab
GitCode 国内备份仓库 已关闭该仓库的流水线,后续仅在 极狐 GitLab 上运行流水线
GitLink 国内备份仓库
GitHub 国外备份仓库 使用 CodeQL 每日扫描项目中的 main 分支是否存在漏洞、使用 dependabot 每日扫描项目中的 main 分支是否需要升级依赖并创建对应的 PR 与 测试
GitLab 国外备份仓库 已关闭该仓库的流水线,后续仅在 极狐 GitLab 上运行流水线
  1. 各分支的作用?
    1. main
    2. k8s
      • 用于 GitLab Runner 在 kubernetes(k8s) 类型的执行器执行 CI/CD
      • 使用 kubernetes(k8s) 编译代码打包
      • 使用 kubernetes(k8s) 将打包后的jar包制作成docker镜像
      • 使用 kubernetes(k8s) 进行发布
      • 与主分支代码相同(定时同步/测试),流水线根据分支名进行触发
    3. shell
      • 用于 GitLab Runner 在 shell 类型的执行器执行 CI/CD
      • 使用 shell 命令编译代码打包
      • 使用 shell 命令创建 Linux service 服务进行发布
      • 与主分支代码相同(定时同步/测试),流水线根据分支名进行触发
    4. docker
      • 用于 GitLab Runner 在 docker 类型的执行器执行 CI/CD
      • 使用 docker 编译代码打包
      • 使用 docker 将打包后的jar包制作成docker镜像
      • 使用 docker 进行发布
      • 与主分支代码相同(定时同步/测试),流水线根据分支名进行触发
    5. xuxiaowei开头的分支
      • 个人分支,按功能PR到主分支main
    6. pages
      • 文档分支
    7. archive/OAuth2.0
      • 归档版本分支,使用 OAuth 2.0 进行授权,后续不再维护(主分支使用 OAuth 2.1)
    8. archive/only-passport
      • 归档版本分支,删除了passport-ui模块,在passport中使用CDN引入element-plusvue进行网页编写(不推荐,后续不再维护)
    9. 此处未说明的分支,请勿使用
    10. 已上包含 CI/CD 的分支
      1. 分支内的各阶段,可交替使用,如:使用 docker 编译代码打包、使用 docker 将打包后的jar包制作成docker镜像,使用 kubernetes(k8s) 进行发布。如何选择请使用者自行组合。
      2. 这些分支代码相同,CI/CD 根据分支名进行触发,即:想使用某个分支的某些执行器执行 CI/CD,就将代码 PR (推荐使用PR,方便一键回滚代码、将回滚的内容进行恢复) 到指定的分支。

批量添加远端仓库地址

点击展开

git remote add gitee https://gitee.com/xuxiaowei-cloud/xuxiaowei-cloud.git

git remote add gitlab https://gitlab.com/xuxiaowei-cloud/xuxiaowei-cloud.git

git remote add jihulab https://jihulab.com/xuxiaowei-cloud/xuxiaowei-cloud.git

git remote add github https://github.com/xuxiaowei-cloud/xuxiaowei-cloud.git

git remote add gitcode https://gitcode.net/xuxiaowei-cloud/xuxiaowei-cloud.git

git remote add gitlink https://gitlink.org.cn/xuxiaowei-cloud/xuxiaowei-cloud.git

鸣谢

  1. 感谢 墨菲安全 提供安全技术支持
  2. 感谢 jetbrains 提供开发工具 IDEA 的免费授权

Stargazers over time

Stargazers over time

xuxiaowei-cloud's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar xuxiaowei-com-cn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.