刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 1 | -- 10.0.init.sql |
| 2 | |
| 3 | /* |
| 4 | 将 paas.example.com 替换为 paas.学校域名.edu.cn |
| 5 | */ |
| 6 | |
| 7 | |
| 8 | use admin_center; |
| 9 | |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 10 | -- 若 insert 异常,确认下 TB_MGT_ROUTE 中 是否已经存在记录,若存在,可忽略,直接执行 update 即可 |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 11 | insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) |
刘洪青 | 497fb04 | 2021-06-30 14:02:42 +0800 | [diff] [blame] | 12 | values ('1', 0, 'bff-admin-api', '管理门户 - 聚合接口', '1', '/api/v1/admin', 'http://localhost:8081', 0); |
| 13 | insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) |
| 14 | values ('2', 0, 'bff-me-api', '管理门户 - 聚合接口(当前用户)', '1', '/api/v1/me', 'http://localhost:8081', 0); |
| 15 | insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) |
| 16 | values ('3', 0, 'bff-open-api', '管理门户 - 聚合接口(公开)', '1', '/api/v1/open', 'http://localhost:8081', 0); |
| 17 | |
| 18 | update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-bff.admin-platform.svc.cluster.local:8080' where ID='1'; |
| 19 | update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-bff.admin-platform.svc.cluster.local:8080' where ID='2'; |
| 20 | update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-bff.admin-platform.svc.cluster.local:8080' where ID='3'; |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 21 | |
| 22 | commit; |
| 23 | |
刘洪青 | 497fb04 | 2021-06-30 14:02:42 +0800 | [diff] [blame] | 24 | |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 25 | -- 若 insert 异常,确认下 TB_MGT_ROUTE 中 是否已经存在记录,若存在,可忽略,直接执行 update 即可 |
刘洪青 | 497fb04 | 2021-06-30 14:02:42 +0800 | [diff] [blame] | 26 | insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 27 | values ('10', 0, 'management-api', '管理门户 - 管理接口', '1', '/api/v1/mgt', 'http://localhost:8080/v1/admin', 1); |
刘洪青 | 497fb04 | 2021-06-30 14:02:42 +0800 | [diff] [blame] | 28 | |
| 29 | commit; |
| 30 | |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 31 | update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin' where ID='10'; |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 32 | |
| 33 | commit; |
| 34 | |
| 35 | |
| 36 | -- 更新 admin-center 下菜单的访问域 |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 37 | update TB_MGT_PERMISSION |
| 38 | set |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 39 | ORIGIN='https://admin-center.paas.example.com' |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 40 | where APPLICATION_ID='00000' |
| 41 | ; |
| 42 | |
| 43 | commit; |
| 44 | |
| 45 | |
| 46 | -- 更新 admin-platform 下菜单的访问域 |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 47 | update TB_MGT_PERMISSION |
| 48 | set |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 49 | ORIGIN='https://admin-platform.paas.example.com' |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 50 | where APPLICATION_ID='1' |
| 51 | ; |
| 52 | |
| 53 | commit; |
| 54 | |
| 55 | |
| 56 | use cas_server; |
| 57 | |
刘洪青 | 497fb04 | 2021-06-30 14:02:42 +0800 | [diff] [blame] | 58 | -- 更新 服务 admin-center 的信息(废弃) |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 59 | update TB_SERVICE |
| 60 | set |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 61 | DELETED=1, |
刘洪青 | c303b0c | 2021-09-22 13:33:19 +0800 | [diff] [blame^] | 62 | INFORMATION_URL='https://admin-center.paas.example.com/admin', |
| 63 | LOGOUT_URL='https://admin-center.paas.example.com/admin/slo?redirect_uri=https://admin-platform.paas.example.com?clearCertification=Admin-Token', |
| 64 | SERVICE_ID='https://admin-center.paas.example.com/admin/cas/(.*)' |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 65 | where ID='1'; -- todo, modify |
| 66 | |
| 67 | commit; |
| 68 | |
| 69 | |
| 70 | -- admin-management 的认证对接信息 |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 71 | INSERT INTO `TB_SERVICE` (`ID`, `COMPANY_ID`, `DELETED`, `ADD_ACCOUNT`, `ADD_TIME`, |
| 72 | `NAME`, `DESCRIPTION`, `INFORMATION_URL`, `LOGOUT_URL`, |
| 73 | `RESPONSE_TYPE`, `LOGOUT_TYPE`, |
| 74 | `EVALUATION_ORDER`, `FRIENDLY_NAME`, `REGISTERED_SERVICE_ID`, `SERVICE_ID`, |
| 75 | `ENABLED`, `SSO_ENABLED`, `REQUIRE_ALL_ATTRIBUTES`, |
| 76 | `APPLICATION_ID`, `EXTERNAL_ID`) |
| 77 | VALUES ('20', '1', 0, 'admin', '2020-07-01 00:00:00', |
| 78 | '基础管理', '基础管理', 'https://admin-center.paas.example.com', 'https://admin-center.paas.example.com/?clearToken=clearToken', |
| 79 | 'REDIRECT', 'FRONT_CHANNEL', |
| 80 | 20, '基础管理', 20, 'https://admin-center.paas.example.com/(.*)', |
| 81 | 1, 1, 1, |
| 82 | '20', '20'); |
| 83 | |
| 84 | commit; |
| 85 | |
| 86 | -- 修改根域名 |
| 87 | update TB_SERVICE |
| 88 | set |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 89 | INFORMATION_URL='https://admin-center.paas.example.com', |
| 90 | LOGOUT_URL='https://admin-center.paas.example.com/?clearToken=clearToken', |
| 91 | SERVICE_ID='https://admin-center.paas.example.com/(.*)', |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 92 | ID_TOKEN_ENABLED=1, |
| 93 | JWT_AS_SERVICE_TICKET=1, |
| 94 | APPLICATION_DOMAIN='admin-center.paas.example.com' |
| 95 | where ID='20'; -- todo, modify |
| 96 | |
| 97 | commit; |
| 98 | |
| 99 | |
| 100 | -- admin-platform 的认证对接信息 |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 101 | INSERT INTO `TB_SERVICE` (`ID`, `COMPANY_ID`, `DELETED`, `ADD_ACCOUNT`, `ADD_TIME`, |
| 102 | `NAME`, `DESCRIPTION`, `INFORMATION_URL`, `LOGOUT_URL`, |
| 103 | `RESPONSE_TYPE`, `LOGOUT_TYPE`, |
| 104 | `EVALUATION_ORDER`, `FRIENDLY_NAME`, `REGISTERED_SERVICE_ID`, `SERVICE_ID`, |
| 105 | `ENABLED`, `SSO_ENABLED`, `REQUIRE_ALL_ATTRIBUTES`, |
| 106 | `APPLICATION_ID`, `EXTERNAL_ID`) |
| 107 | VALUES ('21', '1', 0, 'admin', '2020-07-01 00:00:00', |
| 108 | '云平台', '云平台', 'https://admin-platform.paas.example.com', 'https://admin-platform.paas.example.com/?clearToken=clearToken', |
| 109 | 'REDIRECT', 'FRONT_CHANNEL', |
| 110 | 21, '云平台', 21, 'https://admin-platform.paas.example.com/(.*)', |
| 111 | 1, 1, 1, |
| 112 | '21', '21'); |
| 113 | |
| 114 | commit; |
| 115 | |
| 116 | -- 修改根域名 |
| 117 | update TB_SERVICE |
| 118 | set |
刘洪青 | db94c74 | 2021-09-20 15:02:06 +0800 | [diff] [blame] | 119 | INFORMATION_URL='https://admin-platform.paas.example.com', |
| 120 | LOGOUT_URL='https://admin-platform.paas.example.com/?clearToken=clearToken', |
| 121 | SERVICE_ID='https://admin-platform.paas.example.com/(.*)', |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 122 | ID_TOKEN_ENABLED=1, |
| 123 | JWT_AS_SERVICE_TICKET=1, |
| 124 | APPLICATION_DOMAIN='admin-platform.paas.example.com' |
| 125 | where ID='21'; -- todo, modify |
| 126 | |
| 127 | commit; |
| 128 | |
| 129 | |
| 130 | |
| 131 | use user_authz; |
| 132 | |
刘洪青 | c303b0c | 2021-09-22 13:33:19 +0800 | [diff] [blame^] | 133 | -- 如果已经存在,则无须执行 INSERT |
| 134 | INSERT INTO TB_R_SYSTEM (ID, COMPANY_ID, DELETED, ADD_ACCOUNT, ADD_TIME, |
| 135 | BUSINESS_DOMAIN_ID, |
| 136 | CODE, NAME, ENABLED) |
| 137 | VALUES ('1', '1', 0, 'admin', '2019-07-01 00:00:00', |
| 138 | '1', |
| 139 | '1', '云平台', 1); |
| 140 | |
| 141 | INSERT INTO TB_APPLICATION (ID, COMPANY_ID, DELETED, ADD_ACCOUNT, ADD_TIME, |
| 142 | BUSINESS_DOMAIN_ID, SYSTEM_ID, |
| 143 | NAME, APPLICATION_ID, SYNC_URL, ENABLED) |
| 144 | VALUES ('1', '1', 0, 'admin', '2019-07-01 00:00:00', |
| 145 | '1', '1', |
| 146 | '云平台', '1', 'http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin/open/sync/roles', 1); |
| 147 | |
| 148 | commit; |
| 149 | |
| 150 | |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 151 | -- 更新 admin-center 下的角色同步地址 |
刘洪青 | c303b0c | 2021-09-22 13:33:19 +0800 | [diff] [blame^] | 152 | -- 外部地址 https://admin-center.paas.example.com/admin/api/v1/mgt/open/sync/roles |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 153 | update TB_APPLICATION |
| 154 | set |
刘洪青 | c303b0c | 2021-09-22 13:33:19 +0800 | [diff] [blame^] | 155 | NAME='云平台', |
| 156 | SYNC_URL='http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin/open/sync/roles' |
刘洪青 | 394c3e7 | 2021-06-29 19:21:16 +0800 | [diff] [blame] | 157 | where ID='1'; -- todo, modify |
| 158 | |
| 159 | commit; |
| 160 | |