Skip to content

Commit 043fab8

Browse files
authored
Merge pull request lisong#145 from cloudscapelabs/kb/translate
feat: add i18n english translations for the pug files
2 parents b8cfa71 + d0b696e commit 043fab8

File tree

15 files changed

+352
-83
lines changed

15 files changed

+352
-83
lines changed

README.cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
## 如何安装 code-push-server
4141

42-
- [Docker](./docs/install-server-by-docker.md) (推荐)
42+
- [Docker](./docs/install-server-by-docker.cn.md) (推荐)
4343
- [直接安装](./docs/install-server.md)
4444

4545
## 默认帐号和密码

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Since the original [code-push-server](https://github.com/lisong/code-push-server
2121
- oss: store bundle files in [aliyun](https://www.aliyun.com/product/oss)
2222
- tencentcloud: store bundle files in [tencentcloud](https://cloud.tencent.com/product/cos)
2323

24-
## 正确使用 code-push 热更新
24+
## Correct use of code-push hot update
2525

26-
- 苹果 App 允许使用热更新[Apple's developer agreement](https://developer.apple.com/programs/ios/information/iOS_Program_Information_4_3_15.pdf), 为了不影响用户体验,规定必须使用静默更新。 Google Play 不能使用静默更新,必须弹框告知用户 App 有更新。中国的 android 市场必须采用静默更新(如果弹框提示,App 会被“请上传最新版本的二进制应用包”原因驳回)。
27-
- react-native 不同平台 bundle 包不一样,在使用 code-push-server 的时候必须创建不同的应用来区分(eg. CodePushDemo-ios CodePushDemo-android)
28-
- react-native-code-push 只更新资源文件,不会更新 java Objective C,所以 npm 升级依赖包版本的时候,如果依赖包使用的本地化实现, 这时候必须更改应用版本号(ios 修改 Info.plist 中的 CFBundleShortVersionString, android 修改 build.gradle 中的 versionName), 然后重新编译 app 发布到应用商店。
29-
- 推荐使用 code-push release-react 命令发布应用,该命令合并了打包和发布命令(eg. code-push release-react CodePushDemo-ios ios -d Production)
30-
- 每次向 App Store 提交新的版本时,也应该基于该提交版本同时向 code-push-server 发布一个初始版本。(因为后面每次向 code-push-server 发布版本时,code-puse-server 都会和初始版本比较,生成补丁版本)
26+
- Apple App allows the use of hot updates [Apple's developer agreement](https://developer.apple.com/programs/ios/information/iOS_Program_Information_4_3_15.pdf), in order not to affect the user experience, it is stipulated that silent updates must be used. Google Play cannot use silent updates, and a pop-up box must inform users that there is an update to the app. China's android market must use silent updates (if the pop-up box prompts, the app will be rejected by the reason of "please upload the latest version of the binary application package").
27+
- The bundles of react-native are different for different platforms. When using code-push-server, you must create different applications to distinguish them (eg. CodePushDemo-ios and CodePushDemo-android)
28+
- react-native-code-push only updates resource files, not java and Objective C, so when npm upgrades the version of the dependent package, if the localized implementation used by the dependent package, the application version number must be changed at this time (ios modify Info CFBundleShortVersionString in .plist, android modify versionName in build.gradle), then recompile the app and publish it to the app store.
29+
- It is recommended to use the code-push release-react command to release the application, which combines the packaging and release commands (eg. code-push release-react CodePushDemo-ios ios -d Production)
30+
- Every time a new version is submitted to the App Store, an initial version should also be released to code-push-server based on the submitted version. (Because every time a version is released to code-push-server, code-puse-server will compare it with the initial version to generate a patch version)
3131

3232
### CodePush Cli
3333

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# docker 部署 code-push-server
2+
3+
> 该文档用于描述 docker 部署 code-push-server,实例包含三个部分
4+
5+
- code-push-server 部分
6+
- 更新包默认采用`local`存储(即存储在本地机器上)。使用 docker volume 存储方式,容器销毁不会导致数据丢失,除非人为删除 volume。
7+
- 内部使用 pm2 cluster 模式管理进程,默认开启进程数为 cpu 数,可以根据自己机器配置设置 docker-compose.yml 文件中 deploy 参数。
8+
- docker-compose.yml 只提供了应用的一部分参数设置,如需要设置其他配置,可以修改文件 config.js。
9+
- mysql 部分
10+
- 数据使用 docker volume 存储方式,容器销毁不会导致数据丢失,除非人为删除 volume。
11+
- 应用请勿使用 root 用户,为了安全可以创建权限相对较小的权限供 code-push-server 使用,只需要给予`select,update,insert`权限即可。初始化数据库需要使用 root 或有建表权限用户
12+
- redis 部分
13+
- `tryLoginTimes` 登录错误次数限制
14+
- `updateCheckCache` 提升应用性能
15+
- `rolloutClientUniqueIdCache` 灰度发布
16+
17+
## 安装 Docker
18+
19+
参考 Docker 官方安装教程
20+
21+
- [>>mac 点这里](https://docs.docker.com/docker-for-mac/install/)
22+
- [>>windows 点这里](https://docs.docker.com/docker-for-windows/install/)
23+
- [>>linux 点这里](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
24+
25+
`$ docker info` 能成功输出相关信息,则安装成功,才能继续下面步骤
26+
27+
## 获取代码
28+
29+
```shell
30+
$ git clone https://github.com/shm-open/code-push-server.git
31+
$ cd code-push-server
32+
```
33+
34+
## 修改配置文件
35+
36+
```shell
37+
$ vim docker-compose.yml
38+
```
39+
40+
_`DOWNLOAD_URL``YOUR_MACHINE_IP`替换成本机外网 ip 或者域名_
41+
42+
### jwt.tokenSecret 修改
43+
44+
> code-push-server 验证登录验证方式使用的 json web token 加密方式,该对称加密算法是公开的,所以修改 config.js 中 tokenSecret 值很重要。
45+
46+
_非常重要!非常重要! 非常重要!_
47+
48+
> 可以打开连接`https://www.grc.com/passwords.htm`获取 `63 random alpha-numeric characters`类型的随机生成数作为密钥
49+
50+
_`TOKEN_SECRET``YOUR_JWT_TOKEN_SECRET`替换成密钥_
51+
52+
## 部署
53+
54+
```shell
55+
$ docker-compose up -d
56+
```
57+
58+
> 如果网速不佳,需要漫长而耐心的等待。。。去和妹子聊会天吧^\_^
59+
60+
## 查看进展
61+
62+
```shell
63+
$ docker-compose ps
64+
```
65+
66+
## 访问接口简单验证
67+
68+
`$ curl -I http://YOUR_CODE_PUSH_SERVER_IP:3000/`
69+
70+
返回`200 OK`
71+
72+
```http
73+
HTTP/1.1 200 OK
74+
X-DNS-Prefetch-Control: off
75+
X-Frame-Options: SAMEORIGIN
76+
Strict-Transport-Security: max-age=15552000; includeSubDomains
77+
X-Download-Options: noopen
78+
X-Content-Type-Options: nosniff
79+
X-XSS-Protection: 1; mode=block
80+
Content-Type: text/html; charset=utf-8
81+
Content-Length: 592
82+
ETag: W/"250-IiCMcM1ZUFSswSYCU0KeFYFEMO8"
83+
Date: Sat, 25 Aug 2018 15:45:46 GMT
84+
Connection: keep-alive
85+
```
86+
87+
## 浏览器登录
88+
89+
> 默认用户名:admin 密码:123456 记得要修改默认密码哦
90+
> 如果登录连续输错密码超过一定次数,会限定无法再登录. 需要清空 redis 缓存
91+
92+
```shell
93+
$ docker exec -it code-push-server_redis_1 redis-cli # 进入redis
94+
> flushall
95+
> quit
96+
```
97+
98+
## 查看服务日志
99+
100+
```shell
101+
$ docker-compose logs server
102+
```
103+
104+
## 查看存储 `docker volume ls`
105+
106+
| DRIVER | VOLUME NAME | 描述 |
107+
| ------ | ----------------------------- | ------------------------------ |
108+
| local | code-push-server_data-mysql | 数据库存储数据目录 |
109+
| local | code-push-server_data-storage | 存储打包文件目录 |
110+
| local | code-push-server_data-tmp | 用于计算更新包差异文件临时目录 |
111+
| local | code-push-server_data-redis | redis 落地数据 |
112+
113+
## 销毁退出应用
114+
115+
```shell
116+
$ docker-compose down
117+
```

docs/install-server-by-docker.md

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,77 @@
1-
# docker 部署 code-push-server
1+
# docker deploy code-push-server
22

3-
> 该文档用于描述 docker 部署 code-push-server,实例包含三个部分
3+
[[Chinese version 中文版]](./install-server-by-docker.cn.md)
44

5-
- code-push-server 部分
6-
- 更新包默认采用`local`存储(即存储在本地机器上)。使用 docker volume 存储方式,容器销毁不会导致数据丢失,除非人为删除 volume。
7-
- 内部使用 pm2 cluster 模式管理进程,默认开启进程数为 cpu 数,可以根据自己机器配置设置 docker-compose.yml 文件中 deploy 参数。
8-
- docker-compose.yml 只提供了应用的一部分参数设置,如需要设置其他配置,可以修改文件 config.js。
9-
- mysql 部分
10-
- 数据使用 docker volume 存储方式,容器销毁不会导致数据丢失,除非人为删除 volume。
11-
- 应用请勿使用 root 用户,为了安全可以创建权限相对较小的权限供 code-push-server 使用,只需要给予`select,update,insert`权限即可。初始化数据库需要使用 root 或有建表权限用户
12-
- redis 部分
13-
- `tryLoginTimes` 登录错误次数限制
14-
- `updateCheckCache` 提升应用性能
15-
- `rolloutClientUniqueIdCache` 灰度发布
5+
> This document is used to describe docker deployment code-push-server, the example consists of three parts
166
17-
## 安装 Docker
7+
- code-push-server section
8+
- Update packages are stored in `local` by default (i.e. stored on the local machine). Using the docker volume storage method, container destruction will not cause data loss unless the volume is manually deleted.
9+
- The pm2 cluster mode is used to manage processes internally. The default number of open processes is the number of cpus. You can set the deploy parameter in the docker-compose.yml file according to your own machine configuration.
10+
- docker-compose.yml only provides some parameter settings of the application. If you need to set other configurations, you can modify the file config.js.
11+
- mysql section
12+
- Data is stored using docker volume, and container destruction will not cause data loss unless the volume is manually deleted.
13+
- Do not use the root user for the application. For security, you can create permissions with relatively small permissions for use by code-push-server. You only need to give `select, update, insert` permissions. To initialize the database, you need to use root or a user with table building privileges
14+
- redis part
15+
- `tryLoginTimes` login error limit
16+
- `updateCheckCache` improves application performance
17+
- `rolloutClientUniqueIdCache` grayscale release
1818

19-
参考 Docker 官方安装教程
19+
## Install Docker
2020

21-
- [>>mac 点这里](https://docs.docker.com/docker-for-mac/install/)
22-
- [>>windows 点这里](https://docs.docker.com/docker-for-windows/install/)
23-
- [>>linux 点这里](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
21+
Refer to the official Docker installation tutorial
2422

25-
`$ docker info` 能成功输出相关信息,则安装成功,才能继续下面步骤
23+
- [>>mac click here](https://docs.docker.com/docker-for-mac/install/)
24+
- [>>windows click here](https://docs.docker.com/docker-for-windows/install/)
25+
- [>>linux click here](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
2626

27-
## 获取代码
27+
`$ docker info` can successfully output relevant information, the installation is successful, and the following steps can be continued
28+
29+
## get code
2830

2931
```shell
3032
$ git clone https://github.com/shm-open/code-push-server.git
3133
$ cd code-push-server
32-
```
34+
````
3335

34-
## 修改配置文件
36+
## Modify the configuration file
3537

3638
```shell
3739
$ vim docker-compose.yml
38-
```
40+
````
3941
40-
_`DOWNLOAD_URL``YOUR_MACHINE_IP`替换成本机外网 ip 或者域名_
42+
_Replace `YOUR_MACHINE_IP` in `DOWNLOAD_URL` with your own external network ip or domain name_
4143
42-
### jwt.tokenSecret 修改
44+
### jwt.tokenSecret modification
4345
44-
> code-push-server 验证登录验证方式使用的 json web token 加密方式,该对称加密算法是公开的,所以修改 config.js 中 tokenSecret 值很重要。
46+
> code-push-server verifies the json web token encryption method used by the login authentication method. The symmetric encryption algorithm is public, so it is very important to modify the tokenSecret value in config.js.
4547
46-
_非常重要!非常重要! 非常重要!_
48+
_Very important! Very important! Very important! _
4749
48-
> 可以打开连接`https://www.grc.com/passwords.htm`获取 `63 random alpha-numeric characters`类型的随机生成数作为密钥
50+
> You can open the connection `https://www.grc.com/passwords.htm` to obtain a randomly generated number of type `63 random alpha-numeric characters` as the key
4951
50-
_`TOKEN_SECRET``YOUR_JWT_TOKEN_SECRET`替换成密钥_
52+
_Replace `YOUR_JWT_TOKEN_SECRET` in `TOKEN_SECRET` with the key_
5153
52-
## 部署
54+
## deploy
5355
5456
```shell
5557
$ docker-compose up -d
56-
```
58+
````
5759

58-
> 如果网速不佳,需要漫长而耐心的等待。。。去和妹子聊会天吧^\_^
60+
> If the internet speed is not good, a long and patient wait is required. . . Let's chat with the girl for a while ^\_^
5961
60-
## 查看进展
62+
## View progress
6163
6264
```shell
6365
$ docker-compose ps
64-
```
66+
````
6567
66-
## 访问接口简单验证
68+
## Access interface simple verification
6769
6870
`$ curl -I http://YOUR_CODE_PUSH_SERVER_IP:3000/`
6971
70-
返回`200 OK`
72+
returns `200 OK`
7173
72-
```http
74+
````http
7375
HTTP/1.1 200 OK
7476
X-DNS-Prefetch-Control: off
7577
X-Frame-Options: SAMEORIGIN
@@ -82,35 +84,35 @@ Content-Length: 592
8284
ETag: W/"250-IiCMcM1ZUFSswSYCU0KeFYFEMO8"
8385
Date: Sat, 25 Aug 2018 15:45:46 GMT
8486
Connection: keep-alive
85-
```
87+
````
8688
87-
## 浏览器登录
89+
## Browser login
8890
89-
> 默认用户名:admin 密码:123456 记得要修改默认密码哦
90-
> 如果登录连续输错密码超过一定次数,会限定无法再登录. 需要清空 redis 缓存
91+
> Default username: admin Password: 123456 Remember to change the default password
92+
> If you log in and enter the wrong password for more than a certain number of times, you will no longer be able to log in. You need to clear the redis cache
9193
9294
```shell
93-
$ docker exec -it code-push-server_redis_1 redis-cli # 进入redis
95+
$ docker exec -it code-push-server_redis_1 redis-cli # Enter redis
9496
> flushall
9597
> quit
96-
```
98+
````
9799
98-
## 查看服务日志
100+
## View service log
99101
100102
```shell
101103
$ docker-compose logs server
102-
```
104+
````
103105
104-
## 查看存储 `docker volume ls`
106+
## View storage `docker volume ls`
105107
106-
| DRIVER | VOLUME NAME | 描述 |
107-
| ------ | ----------------------------- | ------------------------------ |
108-
| local | code-push-server_data-mysql | 数据库存储数据目录 |
109-
| local | code-push-server_data-storage | 存储打包文件目录 |
110-
| local | code-push-server_data-tmp | 用于计算更新包差异文件临时目录 |
111-
| local | code-push-server_data-redis | redis 落地数据 |
108+
| DRIVER | VOLUME NAME | DESCRIPTION |
109+
| ------ | ----------------------------- | ------------ ------------------ |
110+
| local | code-push-server_data-mysql | database storage data directory |
111+
| local | code-push-server_data-storage | Storage package file directory |
112+
| local | code-push-server_data-tmp | Temporary directory for calculating update package difference files |
113+
| local | code-push-server_data-redis | redis landing data |
112114
113-
## 销毁退出应用
115+
## destroy exit application
114116
115117
```shell
116118
$ docker-compose down

locales/cn.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Please sign in": "请登录",
3+
"email address": "邮箱地址",
4+
"username": "用户名",
5+
"password": "密码",
6+
"Remember me": "记住我",
7+
"Log in": "登录",
8+
"hot update server": "热更新服务器",
9+
"Change Password": "修改密码",
10+
"Obtain": "获取",
11+
"old password": "原密码",
12+
"new password": "新密码",
13+
"please login again": "请重新登录"
14+
}

locales/en.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"Please sign in": "Please sign in",
3+
"email address": "email address",
4+
"username": "username",
5+
"password": "password",
6+
"Remember me": "Remember me",
7+
"Log in": "Log in",
8+
"hot update server": "hot update server",
9+
"Change Password": "Change Password",
10+
"Obtain": "Obtain",
11+
"old password": "old password",
12+
"new password": "new password",
13+
"please login again": "please login again"
14+
}

0 commit comments

Comments
 (0)