blob: db122dbc95bfe754f64c587b14a98f4ae2482f35 [file] [log] [blame]
刘洪青394c3e72021-06-29 19:21:16 +08001-- 10.0.init.sql
2
3/*
4将 paas.example.com 替换为 paas.学校域名.edu.cn
5*/
6
7
8use admin_center;
9
10
11insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
刘洪青497fb042021-06-30 14:02:42 +080012values ('1', 0, 'bff-admin-api', '管理门户 - 聚合接口', '1', '/api/v1/admin', 'http://localhost:8081', 0);
13insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
14values ('2', 0, 'bff-me-api', '管理门户 - 聚合接口(当前用户)', '1', '/api/v1/me', 'http://localhost:8081', 0);
15insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
16values ('3', 0, 'bff-open-api', '管理门户 - 聚合接口(公开)', '1', '/api/v1/open', 'http://localhost:8081', 0);
17
18update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-bff.admin-platform.svc.cluster.local:8080' where ID='1';
19update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-bff.admin-platform.svc.cluster.local:8080' where ID='2';
20update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-bff.admin-platform.svc.cluster.local:8080' where ID='3';
刘洪青394c3e72021-06-29 19:21:16 +080021
22commit;
23
刘洪青497fb042021-06-30 14:02:42 +080024
25insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
26values ('9', 0, 'management-api', '管理门户 - 管理接口', '1', '/api/v1/mgt', 'http://localhost:8080/v1/admin', 1);
27
28commit;
29
30update TB_MGT_ROUTE set URL='http://admin-platform-admin-center-sa.admin-platform.svc.cluster.local:8080/v1/admin' where ID='9';
刘洪青394c3e72021-06-29 19:21:16 +080031
32commit;
33
34
35-- 更新 admin-center 下菜单的访问域
刘洪青394c3e72021-06-29 19:21:16 +080036update TB_MGT_PERMISSION
37set
38 ORIGIN='http://admin-center.paas.example.com'
39where APPLICATION_ID='00000'
40;
41
42commit;
43
44
45-- 更新 admin-platform 下菜单的访问域
刘洪青394c3e72021-06-29 19:21:16 +080046update TB_MGT_PERMISSION
47set
48 ORIGIN='http://admin-platform.paas.example.com'
49where APPLICATION_ID='1'
50;
51
52commit;
53
54
55use cas_server;
56
刘洪青497fb042021-06-30 14:02:42 +080057-- 更新 服务 admin-center 的信息(废弃)
刘洪青394c3e72021-06-29 19:21:16 +080058update TB_SERVICE
59set
60 INFORMATION_URL='http://admin-center.paas.example.com',
61 LOGOUT_URL='https://admin-center.paas.example.com/slo?redirect_uri=https://admin-platform.paas.example.com?clearCertification=Admin-Token',
62 SERVICE_ID='http://admin-center.paas.example.com/cas/(.*)'
63where ID='1'; -- todo, modify
64
65commit;
66
67
68-- admin-management 的认证对接信息
刘洪青394c3e72021-06-29 19:21:16 +080069INSERT INTO `TB_SERVICE` (`ID`, `COMPANY_ID`, `DELETED`, `ADD_ACCOUNT`, `ADD_TIME`,
70 `NAME`, `DESCRIPTION`, `INFORMATION_URL`, `LOGOUT_URL`,
71 `RESPONSE_TYPE`, `LOGOUT_TYPE`,
72 `EVALUATION_ORDER`, `FRIENDLY_NAME`, `REGISTERED_SERVICE_ID`, `SERVICE_ID`,
73 `ENABLED`, `SSO_ENABLED`, `REQUIRE_ALL_ATTRIBUTES`,
74 `APPLICATION_ID`, `EXTERNAL_ID`)
75VALUES ('20', '1', 0, 'admin', '2020-07-01 00:00:00',
76 '基础管理', '基础管理', 'https://admin-center.paas.example.com', 'https://admin-center.paas.example.com/?clearToken=clearToken',
77 'REDIRECT', 'FRONT_CHANNEL',
78 20, '基础管理', 20, 'https://admin-center.paas.example.com/(.*)',
79 1, 1, 1,
80 '20', '20');
81
82commit;
83
84-- 修改根域名
85update TB_SERVICE
86set
87 INFORMATION_URL='http://admin-center.paas.example.com',
88 LOGOUT_URL='http://admin-center.paas.example.com/?clearToken=clearToken',
89 SERVICE_ID='http://admin-center.paas.example.com/(.*)',
90 ID_TOKEN_ENABLED=1,
91 JWT_AS_SERVICE_TICKET=1,
92 APPLICATION_DOMAIN='admin-center.paas.example.com'
93where ID='20'; -- todo, modify
94
95commit;
96
97
98-- admin-platform 的认证对接信息
刘洪青394c3e72021-06-29 19:21:16 +080099INSERT INTO `TB_SERVICE` (`ID`, `COMPANY_ID`, `DELETED`, `ADD_ACCOUNT`, `ADD_TIME`,
100 `NAME`, `DESCRIPTION`, `INFORMATION_URL`, `LOGOUT_URL`,
101 `RESPONSE_TYPE`, `LOGOUT_TYPE`,
102 `EVALUATION_ORDER`, `FRIENDLY_NAME`, `REGISTERED_SERVICE_ID`, `SERVICE_ID`,
103 `ENABLED`, `SSO_ENABLED`, `REQUIRE_ALL_ATTRIBUTES`,
104 `APPLICATION_ID`, `EXTERNAL_ID`)
105VALUES ('21', '1', 0, 'admin', '2020-07-01 00:00:00',
106 '云平台', '云平台', 'https://admin-platform.paas.example.com', 'https://admin-platform.paas.example.com/?clearToken=clearToken',
107 'REDIRECT', 'FRONT_CHANNEL',
108 21, '云平台', 21, 'https://admin-platform.paas.example.com/(.*)',
109 1, 1, 1,
110 '21', '21');
111
112commit;
113
114-- 修改根域名
115update TB_SERVICE
116set
117 INFORMATION_URL='http://admin-platform.paas.example.com',
118 LOGOUT_URL='http://admin-platform.paas.example.com/?clearToken=clearToken',
119 SERVICE_ID='http://admin-platform.paas.example.com/(.*)',
120 ID_TOKEN_ENABLED=1,
121 JWT_AS_SERVICE_TICKET=1,
122 APPLICATION_DOMAIN='admin-platform.paas.example.com'
123where ID='21'; -- todo, modify
124
125commit;
126
127
128
129use user_authz;
130
131-- 更新 admin-center 下的角色同步地址
刘洪青394c3e72021-06-29 19:21:16 +0800132update TB_APPLICATION
133set
134 SYNC_URL='http://admin-center.paas.example.com/api/v1/open/sync/roles'
135where ID='1'; -- todo, modify
136
137commit;
138