chore: chart 部署脚本
diff --git "a/deploy-manifests/charts/1.2.0000.\344\272\221\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\346\211\213\345\206\214\357\274\210\345\237\272\344\272\216\345\272\224\347\224\250\345\225\206\345\272\227\357\274\211.md" "b/deploy-manifests/charts/1.2.0000.\344\272\221\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\346\211\213\345\206\214\357\274\210\345\237\272\344\272\216\345\272\224\347\224\250\345\225\206\345\272\227\357\274\211.md"
new file mode 100644
index 0000000..945bbba
--- /dev/null
+++ "b/deploy-manifests/charts/1.2.0000.\344\272\221\345\271\263\345\217\260\345\256\211\350\243\205\351\203\250\347\275\262\346\211\213\345\206\214\357\274\210\345\237\272\344\272\216\345\272\224\347\224\250\345\225\206\345\272\227\357\274\211.md"
@@ -0,0 +1,346 @@
+
+# 安装部署手册
+
+**业务中台之云平台**
+
+
+* 修订历史
+
+版本 | 作者 | 日期 | 备注
+- | - | - | -
+v1 | 刘洪青 | 2021-05-15 | 初稿
+
+
+[TOC]
+
+
+## 安装准备
+
+### MySQL 初始配置及相关基础命令
+
+数据文件目录:/var/lib/mysql
+
+* 安装完成后,调整 mysql 服务的配置参数
+
+ 查看当前配置:show variables;
+
+ 最大连接数 max_connections
+ 操作日志的保留时长 binlog_expire_logs_seconds
+
+ 参考命令:
+ ```
+ set global max_connections = 1000;
+ set persist max_connections = 1000;
+
+ // 7天 86400 * 7
+ // 1天 86400
+ set global binlog_expire_logs_seconds = 86400 * 7;
+ set persist binlog_expire_logs_seconds = 86400 * 7;
+ ```
+
+ 时区设置
+
+ 确保MySQL 的时区设置为 GMT+8
+
+
+* 创建数据库帐号
+
+ 参考命令:
+ ```
+ create user 'admin_center'@'%' identified with mysql_native_password by 'your_password';
+ ```
+
+
+* 创建 database
+
+ 参考命令:
+ ```
+ create database `admin_center` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
+ ```
+
+
+* 授予权限
+
+ 将 database 的权限授予对应的帐号
+
+ 参考命令:
+ ```
+ grant all privileges on `admin_center`.* to 'admin_center'@'%' with grant option;
+ ```
+
+
+* 备份与还原
+
+ 参考命令:
+ 备份:
+ ```
+ mysqldump -u root -p admin_center > admin_center.sql
+ ```
+
+ 还原:
+ ```
+ mysql -u root -p admin_center < admin_center.sql
+ ```
+
+
+### Harbor 准备及相关说明
+
+* 创建 devops 帐号
+
+ 用于 rancher 部署时拉取镜像
+
+ 用户管理 下 创建用户
+ 如 devops
+
+
+* 镜像同步
+
+ 从 https://harbor.supwisdom.com 中同步镜像
+
+ 仓库管理 下 新建目标
+ ```
+ supwisdom https://harbor.supwisdom.com rancher.devops / PWMgP85qiLFC
+ ```
+
+ 同步管理 下 新建规则
+
+ ```
+ admin-center admin-center/*
+
+ admin-platform admin-platform/*
+ ```
+
+ 同步规则,创建完成后,进行镜像同步
+
+ 选择某个同步规则,点击 同步,等待任务完成
+
+
+* 授予 devops 帐号 对各个项目的 访客 权限
+
+ 项目 下,点击 项目名称,进入到 成员,添加用户,查找用户 devops,选择角色 访客,确定,添加即可
+
+
+### Rancher 准备及相关说明
+
+* 商店设置
+
+ 进入 全局 - 集群(具体名称视项目安装而定) - 工具 - 商店设置,添加应用商店
+
+ 名称:`supwisdom`
+ 商店URL地址:`https://e.coding.net/supwisdom/charts/charts.git`
+ 分支:`master`
+ 范围:选择`cluster`
+
+
+* 创建项目
+
+ 进入 全局 - 集群(具体名称视项目安装而定) - 项目/命名空间,添加项目
+
+ 输入 项目名称,保存
+
+ 本产品所须创建的项目名称为:`admin-platform`
+
+
+* 启动应用
+
+ 进入 全局 - 集群(具体名称视项目安装而定) - 项目(某个项目)
+
+ 进入 应用商店
+
+ 点击 启动,在应用列表中 找到 相关应用
+
+ 点击 该应用,选择模板版本(一般选择最新的版本),根据情况设置 配置选项,启动 即可
+
+ 本产品所须的相关应用清单:
+ ```
+ admin-platform 云平台产品
+ ```
+
+* 确定命名空间
+
+ 本产品安装过程中所须的命名空间如下:
+
+ ```
+ admin-platform 云平台
+ ```
+
+
+### 域名准备
+
+* 确定域名
+
+ 首先明确是否使用泛域名,如:`*.paas.xxx.edu.cn`,或 直接使用学校域名 `xxx.edu.cn`
+
+ 本产品安装需要的域名如下:
+ ```
+ admin-center.paas.xxx.edu.cn 云平台管理
+
+ admin-platform.paas.xxx.edu.cn 云平台
+ ```
+
+ 如果使用 学校域名,则去除 .paas 即可,同时申请开通相关域名
+
+
+
+## 开始安装
+
+### 数据库安装(略)
+
+* 确定服务地址、端口
+
+ 明确MySQL 数据库的 IP、端口
+
+
+### 数据库创建
+
+* 数据库帐号
+
+ 以下是 各服务对应的数据库帐号
+
+ 服务 | 数据库帐号
+ - | -
+ 云平台管理 admin-center | admin_center
+
+ 命令:
+ **请修改命令中的 `your_password` 为实际的数据库用户的密码**
+ ```
+ create user 'admin_center'@'%' identified with mysql_native_password by 'your_password';
+ ```
+
+
+* 数据库
+
+ 以下是 各服务对应的数据库
+
+ 服务 | 数据库
+ - | -
+ 云平台管理 admin-center | admin_center
+
+ 命令:
+ ```
+ create database `admin_center` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
+ ```
+
+
+* 数据库权限授予
+
+ 将 database 的权限授予对应的帐号
+
+ 命令:
+ ```
+ grant all privileges on `admin_center`.* to 'admin_center'@'%' with grant option;
+ ```
+
+
+### rancher 部署(应用商店)
+
+#### admin-platform
+
+命名空间: admin-platform
+
+* REDIS配置 - 安全配置
+ Redis密码: `8KuwoslOiuw7H`
+
+ Default Storage Class: <请选择存储类>
+
+
+* MYSQL数据库配置 - 服务地址
+ MySQL服务 host: <请填写数据库服务的IP地址>
+ MySQL服务 port: <请填写数据库服务的端口>
+
+* MYSQL数据库配置 - 云平台管理
+
+ 用户名: `admin_center` ,固定值
+ 密码: <请填写创建的数据库用户的密码>
+ 数据库名: `admin_center` ,固定值
+
+
+* 域名全局设置
+
+ 根域名: `paas.<school>.edu.cn` ,请修改为实际的学校域名
+
+* 域名配置 - 云平台管理
+
+ 子域名: `admin-center` ,若须修改,根据实际情况修改即可
+
+* 域名配置 - 云平台
+
+ 子域名: `admin-platform` ,若须修改,根据实际情况修改即可
+
+
+* POA 设置
+
+ POA网关地址: `http://poa.paas.<school>.edu.cn` ,请设置为 poa 网关的外网地址
+ POA SA地址: 请设置为 poa-sa 管理接口的 k8s 内部地址(根据实际部署的 POA 进行调整)
+
+
+* 依赖服务 - 文件服务设置
+
+ Minio外网地址: `http://authx-minio.paas.<school>.edu.cn` ,请设置为 minio 的外网地址
+
+* 依赖服务 - 认证设置
+
+ CAS认证地址: `http://cas.paas.<school>.edu.cn/cas` ,请设置为 cas 认证的外网地址
+
+
+* 依赖 API - AGENT SERVICE
+
+ Agent Service API内部地址: `http://agent-service.agent-service.svc.cluster.local:8080` ,固定值,若 agent-service 的命名空间有调整,请修改
+
+ Agent Service 文件上传路径: `/api/v1/tpas/file/minio` ,一般不用修改
+
+* 依赖 API - CAS SERVER
+
+ CAS内部地址: `http://cas-server-webapp.cas-server.svc.cluster.local:8080/cas` ,固定值,若 cas-server 的命名空间有调整,请修改
+ CAS SA API内部地址: `http://cas-server-sa.cas-server.svc.cluster.local:8080` ,固定值,若 cas-server 的命名空间有调整,请修改
+
+* 依赖 API - 用户服务
+
+ User Data Service GOA API地址: `http://authx-service-user-data-service-goa.authx-service.svc.cluster.local:8080` ,固定值,若 authx-service 的命名空间有调整,请修改
+
+* 依赖 API - 授权服务
+
+ User Authorization Service SA API地址: `http://authx-service-user-authz-service-sa.authx-service.svc.cluster.local:8080` ,固定值,若 authx-service 的命名空间有调整,请修改
+
+
+* 个人中心
+
+ 个人中心访问地址: `http://security-center.paas.<school>.edu.cn` ,如果有门户,可以链接到门户的个人中心
+
+
+* 管理功能 - 认证授权
+
+ 认证管理SPA的地址: `https://admin-platform.paas.<school>.edu.cn`
+ 用户管理SPA的地址: `https://admin-platform.paas.<school>.edu.cn`
+ 授权管理SPA的地址: `https://admin-platform.paas.<school>.edu.cn`
+
+ 安全中心后端地址: `https://security-center.paas.<school>.edu.cn`
+
+
+* 管理功能 - 流程表单
+
+ 流程表单SPA的地址: `https://admin-platform.paas.<school>.edu.cn`
+
+ 流程表单后端地址: `https://formflow.paas.<school>.edu.cn`
+ 表单设计器外网地址: `https://form-design.paas.<school>.edu.cn`
+ 签章图片外网地址: 该学校的签章图片地址
+
+
+* 管理功能 - 消息服务
+
+ 消息服务SPA的地址: `https://admin-platform.paas.<school>.edu.cn`
+
+ 消息服务后端地址: `https://message-service.paas.<school>.edu.cn`
+
+
+* 管理功能 - 门户
+
+ 门户管理SPA的地址: `https://portal-admin.paas.<school>.edu.cn`
+
+
+* 管理功能 - 开放平台
+
+ 开放平台SPA的地址: `https://dev-center.paas.<school>.edu.cn`
+
+ 开放平台后端地址: `https://dev-admin.paas.<school>.edu.cn`
+
diff --git a/deploy-manifests/charts/10.0.init.sql b/deploy-manifests/charts/10.0.init.sql
new file mode 100644
index 0000000..5e32052
--- /dev/null
+++ b/deploy-manifests/charts/10.0.init.sql
@@ -0,0 +1,130 @@
+-- 10.0.init.sql
+
+/*
+将 paas.example.com 替换为 paas.学校域名.edu.cn
+*/
+
+
+use admin_center;
+
+
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('9', 0, 'management-api', '管理门户 - 管理接口', '1', '/api/v1/mgt', 'http://admin-center-sa-svc.admin-center.svc.cluster.local:8080/v1/admin', 1);
+
+commit;
+
+update TB_MGT_ROUTE set URL='http://admin-center-sa-svc.admin-center.svc.cluster.local:8080/v1/admin' where ID='9';
+
+commit;
+
+
+-- 更新 admin-center 下菜单的访问域
+
+update TB_MGT_PERMISSION
+set
+ ORIGIN='http://admin-center.paas.example.com'
+where APPLICATION_ID='00000'
+;
+
+commit;
+
+
+-- 更新 admin-platform 下菜单的访问域
+
+update TB_MGT_PERMISSION
+set
+ ORIGIN='http://admin-platform.paas.example.com'
+where APPLICATION_ID='1'
+;
+
+commit;
+
+
+use cas_server;
+
+-- 更新 服务 admin-center 的信息
+
+update TB_SERVICE
+set
+ INFORMATION_URL='http://admin-center.paas.example.com',
+ LOGOUT_URL='https://admin-center.paas.example.com/slo?redirect_uri=https://admin-platform.paas.example.com?clearCertification=Admin-Token',
+ SERVICE_ID='http://admin-center.paas.example.com/cas/(.*)'
+where ID='1'; -- todo, modify
+
+commit;
+
+
+-- admin-management 的认证对接信息
+
+INSERT INTO `TB_SERVICE` (`ID`, `COMPANY_ID`, `DELETED`, `ADD_ACCOUNT`, `ADD_TIME`,
+ `NAME`, `DESCRIPTION`, `INFORMATION_URL`, `LOGOUT_URL`,
+ `RESPONSE_TYPE`, `LOGOUT_TYPE`,
+ `EVALUATION_ORDER`, `FRIENDLY_NAME`, `REGISTERED_SERVICE_ID`, `SERVICE_ID`,
+ `ENABLED`, `SSO_ENABLED`, `REQUIRE_ALL_ATTRIBUTES`,
+ `APPLICATION_ID`, `EXTERNAL_ID`)
+VALUES ('20', '1', 0, 'admin', '2020-07-01 00:00:00',
+ '基础管理', '基础管理', 'https://admin-center.paas.example.com', 'https://admin-center.paas.example.com/?clearToken=clearToken',
+ 'REDIRECT', 'FRONT_CHANNEL',
+ 20, '基础管理', 20, 'https://admin-center.paas.example.com/(.*)',
+ 1, 1, 1,
+ '20', '20');
+
+commit;
+
+-- 修改根域名
+update TB_SERVICE
+set
+ INFORMATION_URL='http://admin-center.paas.example.com',
+ LOGOUT_URL='http://admin-center.paas.example.com/?clearToken=clearToken',
+ SERVICE_ID='http://admin-center.paas.example.com/(.*)',
+ ID_TOKEN_ENABLED=1,
+ JWT_AS_SERVICE_TICKET=1,
+ APPLICATION_DOMAIN='admin-center.paas.example.com'
+where ID='20'; -- todo, modify
+
+commit;
+
+
+-- admin-platform 的认证对接信息
+
+INSERT INTO `TB_SERVICE` (`ID`, `COMPANY_ID`, `DELETED`, `ADD_ACCOUNT`, `ADD_TIME`,
+ `NAME`, `DESCRIPTION`, `INFORMATION_URL`, `LOGOUT_URL`,
+ `RESPONSE_TYPE`, `LOGOUT_TYPE`,
+ `EVALUATION_ORDER`, `FRIENDLY_NAME`, `REGISTERED_SERVICE_ID`, `SERVICE_ID`,
+ `ENABLED`, `SSO_ENABLED`, `REQUIRE_ALL_ATTRIBUTES`,
+ `APPLICATION_ID`, `EXTERNAL_ID`)
+VALUES ('21', '1', 0, 'admin', '2020-07-01 00:00:00',
+ '云平台', '云平台', 'https://admin-platform.paas.example.com', 'https://admin-platform.paas.example.com/?clearToken=clearToken',
+ 'REDIRECT', 'FRONT_CHANNEL',
+ 21, '云平台', 21, 'https://admin-platform.paas.example.com/(.*)',
+ 1, 1, 1,
+ '21', '21');
+
+commit;
+
+-- 修改根域名
+update TB_SERVICE
+set
+ INFORMATION_URL='http://admin-platform.paas.example.com',
+ LOGOUT_URL='http://admin-platform.paas.example.com/?clearToken=clearToken',
+ SERVICE_ID='http://admin-platform.paas.example.com/(.*)',
+ ID_TOKEN_ENABLED=1,
+ JWT_AS_SERVICE_TICKET=1,
+ APPLICATION_DOMAIN='admin-platform.paas.example.com'
+where ID='21'; -- todo, modify
+
+commit;
+
+
+
+use user_authz;
+
+-- 更新 admin-center 下的角色同步地址
+
+update TB_APPLICATION
+set
+ SYNC_URL='http://admin-center.paas.example.com/api/v1/open/sync/roles'
+where ID='1'; -- todo, modify
+
+commit;
+
diff --git a/deploy-manifests/charts/10.1.init-authx.sql b/deploy-manifests/charts/10.1.init-authx.sql
new file mode 100644
index 0000000..6c0088f
--- /dev/null
+++ b/deploy-manifests/charts/10.1.init-authx.sql
@@ -0,0 +1,55 @@
+-- 10.1.init-authx.sql
+
+
+/* 升级认证授权接口时,执行 */
+/*
+update TB_MGT_ROUTE set MEMO='废弃', STATUS='0' where ID='1';
+
+commit;
+
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('30', 0, 'authx-admin-api', '认证授权 - 认证授权接口', '1', '/api/v1/admin', 'http://localhost:8009', 0);
+
+update TB_MGT_ROUTE set URL='http://authx-service-bff-svc.authx-service.svc.cluster.local:8080' where ID='30';
+
+*/
+
+
+/* 部署云平台2.0时,执行以下脚本 */
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('1', 0, 'bff-admin-api', '管理门户 - 聚合接口', '1', '/api/v1/admin', 'http://localhost:8081', 0);
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('2', 0, 'bff-me-api', '管理门户 - 聚合接口(当前用户)', '1', '/api/v1/me', 'http://localhost:8081', 0);
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('3', 0, 'bff-open-api', '管理门户 - 聚合接口(公开)', '1', '/api/v1/open', 'http://localhost:8081', 0);
+
+update TB_MGT_ROUTE set URL='http://admin-center-bff-svc.admin-center.svc.cluster.local:8080' where ID='1';
+update TB_MGT_ROUTE set URL='http://admin-center-bff-svc.admin-center.svc.cluster.local:8080' where ID='2';
+update TB_MGT_ROUTE set URL='http://admin-center-bff-svc.admin-center.svc.cluster.local:8080' where ID='3';
+
+commit;
+
+
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('10', 0, 'authx-admin-api', '认证授权 - 认证授权接口', '1', '/api/v2/admin', 'http://localhost:8009', 0);
+
+update TB_MGT_ROUTE set URL='http://authx-service-bff-svc.authx-service.svc.cluster.local:8080' where ID='10';
+
+commit;
+
+
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('20', 0, 'user-api', '认证授权 - 用户接口', '1', '/api/v1/base', 'https://localhost:8022', 0);
+
+insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
+values ('40', 0, 'personal-api', '认证授权 - 个人信息接口', '1', '/api/v1/personal', 'http://localhost:8041/api/v1', 1);
+
+update TB_MGT_ROUTE set URL='http://user-data-service-goa-svc.user-data-service.svc.cluster.local:8080' where ID='20';
+update TB_MGT_ROUTE set URL='http://personal-security-center-bff-svc.personal-security-center.svc.cluster.local:8080/api/v1' where ID='40';
+
+commit;
+
+
+/* 菜单、角色的初始化,请参考《认证授权菜单初始化》 */
+
+