Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 2ff374b

Browse files
committed
update(config) update config json to env file
1 parent 0824810 commit 2ff374b

6 files changed

Lines changed: 107 additions & 132 deletions

File tree

.env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
envId=YOUR_ENVID
2+
customLoginJson.private_key_id=SECRET_KEY_ID
3+
customLoginJson.private_key=SECRET_KEY
4+
customLoginJson.env_id=YOUR_ENVID
5+
administratorName=NAME
6+
administratorPassword=PASSWORD
7+
operatorName=NAME_OPER
8+
operatorPassword=PASSWORD_OPER
9+
deployPath=/deploy-path

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ lerna-debug.log*
3434
!.vscode/extensions.json
3535

3636
config/config.json
37-
.env
37+
.env.local

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,33 @@
2626

2727
前置依赖
2828

29-
- 安装最新版本 CloudBase CLI `npm install -g @cloudbase/cli`
29+
- 安装最新版本 CloudBase CLI(0.9.1+)`npm install -g @cloudbase/cli`
3030
- 开通一个按量计费的环境,或使用已有的按量计费环境
3131
- 开通自定义登录,并复制自定义登录密钥 (https://console.cloud.tencent.com/tcb/env/setting?tab=loginConfig)
3232

3333
#### 配置
3434

35-
复制一份 `config/config.example.json`,重新保存为 `config/config.json`
35+
复制一份 `.env.example`,重新保存为 `.env.local`
3636

3737
填写配置
3838

39-
```js
40-
{
41-
// 填写环境 ID
42-
"envId": "ENV_ID",
43-
// 填入上面前置依赖第二步的自定义登录密钥
44-
"customLoginJson": {
45-
"private_key_id": "xxx",
46-
"private_key": "xxxx",
47-
"env_id": "xxx"
48-
},
49-
// 账号名长度需要大于 4 位
50-
// 管理员账号密码,密码仅支持大小写字母
51-
"administratorName": "ADMINISTRATOR_NAME",
52-
"administratorPassword": "ADMINISTRATOR_PASSWORD",
53-
// 运营账号密码,密码仅支持大小写字母
54-
"operatorName": "OPERATOR_NAME",
55-
"operatorPassword": "OPERATOR_PASSWORD",
56-
// 部署静态网站路径
57-
"deployPath": "/tcb-cms"
58-
}
39+
```bash
40+
# 填写环境 ID
41+
envId=YOUR_ENVID
42+
# 填入上面前置依赖第二步的自定义登录密钥信息
43+
customLoginJson.private_key_id=SECRET_KEY_ID
44+
customLoginJson.private_key=SECRET_KEY
45+
customLoginJson.env_id=YOUR_ENVID
46+
# 账号名长度需要大于 4 位
47+
administratorName=NAME
48+
# 管理员账号密码,密码仅支持大小写字母
49+
administratorPassword=PASSWORD
50+
# 运营账号密码,密码仅支持大小写字母
51+
operatorName=NAME_OPER
52+
operatorPassword=PASSWORD_OPER
53+
# 部署静态网站路径
54+
deployPath=/deploy-path
55+
5956
```
6057

6158
#### 构建部署
@@ -111,11 +108,10 @@ CMS 的安装路径是是静态托管默认域名/tcb-cms, 可以看下地址是
111108

112109
CMS 负责登录的 auth 云函数需要关闭访问鉴权才可以使用
113110

114-
115111
## 开发
116112

117113
[参考文档](./docs/dev.md)
118114

119115
## RoadMap
120116

121-
待定
117+
待定

cloudbaserc.js

Lines changed: 0 additions & 98 deletions
This file was deleted.

cloudbaserc.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"version": "2.0",
3+
"envId": "{{env.envId}}",
4+
"framework": {
5+
"plugins": {
6+
"admin": {
7+
"use": "@cloudbase/framework-plugin-website",
8+
"inputs": {
9+
"outputPath": "./packages/tcb-ext-cms-admin/build",
10+
"cloudPath": "/tcb-cms"
11+
}
12+
},
13+
"init": {
14+
"use": "@cloudbase/framework-plugin-function",
15+
"inputs": {
16+
"functionRootPath": "./packages",
17+
"functions": [
18+
{
19+
"name": "tcb-ext-cms-init",
20+
"config": {
21+
"timeout": 60,
22+
"envVariables": {
23+
"CMS_ADMIN_USER_NAME": "{{env.administratorName}}",
24+
"CMS_ADMIN_PASS_WORD": "{{env.administratorPassword}}",
25+
"CMS_OPERATOR_USER_NAME": "{{env.operatorName}}",
26+
"CMS_OPERATOR_PASS_WORD": "{{env.operatorPassword}}",
27+
"CMS_DEPLOY_PATH": "{{env.deployPath}}"
28+
},
29+
"installDependency": true
30+
},
31+
"handler": "index.main"
32+
}
33+
]
34+
}
35+
},
36+
"service": {
37+
"use": "@cloudbase/framework-plugin-node",
38+
"inputs": {
39+
"name": "tcb-ext-cms-service",
40+
"entry": "app.js",
41+
"projectPath": "./packages/tcb-ext-cms-service",
42+
"path": "/tcb-ext-cms-service",
43+
"buildCommand": "npm run build",
44+
"functionOptions": {
45+
"timeout": 5,
46+
"envVariables": {
47+
"NODE_ENV": "production",
48+
"CMS_CUSTOM_LOGIN_JSON": "{{env.customLoginJson}}"
49+
}
50+
}
51+
}
52+
},
53+
"db": {
54+
"use": "@cloudbase/framework-plugin-database",
55+
"inputs": {
56+
"collections": [
57+
{
58+
"collectionName": "tcb-ext-cms-contents",
59+
"description": "CMS 系统内容配置数据,CMS 所有的系统内容类型配置、字段配置等信息都存储在该集合内(请不要手动修改",
60+
"aclTag": "ADMINONLY"
61+
},
62+
{
63+
"collectionName": "tcb-ext-cms-users",
64+
"description": " CMS 系统用户数据,存储 CMS 的用户信息,包括管理员和运营者的账号信息,包括角色信息,用户,加密存储的密码等(请不要手动修改)",
65+
"aclTag": "ADMINONLY"
66+
},
67+
{
68+
"collectionName": "tcb-ext-cms-webhooks",
69+
"description": "CMS 系统 webhook 集合,存储 CMS 系统的回调接口配置,CMS 系统数据的变更可以通过回调来进行同步 (请不要手动修改)",
70+
"aclTag": "ADMINONLY"
71+
}
72+
]
73+
}
74+
}
75+
}
76+
}
77+
}

config/config.example.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)