Compare commits

..

2 Commits

Author SHA1 Message Date
7f3996f15b Merge branch 'master' of git.hxr.so:yige/electron-distribution into dev 2020-02-01 17:24:11 +08:00
43ec6cbcdf update README.md 2020-02-01 17:23:28 +08:00
2 changed files with 49 additions and 42 deletions

View File

@ -39,55 +39,59 @@ docker run -itd --name electron-distribution --restart always \
wy373226722/electron-distribution:latest
```
China user: `docker pull registry.cn-shenzhen.aliyuncs.com/yi-ge/electron-distribution:latest` or `docker pull ccr.ccs.tencentyun.com/yi-ge/electron-distribution:latest`
**China user**
Aliyun: `docker pull registry.cn-shenzhen.aliyuncs.com/yi-ge/electron-distribution:latest`
TencentYun: `docker pull ccr.ccs.tencentyun.com/yi-ge/electron-distribution:latest`
**Notice**
You need to configure nginx and SSL by yourself. SCHEME only a tip.
#### Environment
| ENV Var | Default | Description |
|---|---|---|
| `NAME` | `"APP"` | `Your app name. Numbers, letters and "-".` |
| `SCHEME` | `"https"` | `Production environment only work with SSL.` |
| `DOMAIN` | `"www.example.com"` | `Your Electron Distribution server-side domain.` |
| `TOKEN` | `"1jH27dJf9s852"` | `Your Electron Distribution API TOKEN.` |
| `REPOPATH` | `"git@github.com:yi-ge/electron-distribution.git"` | `Your electron app repository.` |
| `BUILD_TYPE` | `"win,linux"` | `win,linux,mac` |
| `WORKPATH` | `"/data"` | `-v /data:/data, The two path must be consistent.` |
| `DOCKER_SOCKET` | `"/var/run/docker.sock"` | `Docker socket path.` |
| `MAC_SERVER_HOST` | `"127.0.0.1"` | `Your macOS server host.` |
| `MAC_SERVER_PORT` | `"22"` | `Your macOS server ssh port.` |
| `MAC_SERVER_USERNAME` | `"guest"` | `Your macOS server ssh username.` |
| `LINUX_SERVER_HOST` | `"127.0.0.1"` | `Only require build mac application. Your linux server host.` |
| `LINUX_SERVER_PORT` | `"22"` | `Only require build mac application. Your linux server ssh port.` |
| `LINUX_SERVER_USERNAME` | `"guest"` | `Only require build mac application. Your linux server ssh username.` |
| `GH_TOKEN` | `""` | `If you set publish option.` |
| `CSC_LINK` | `""` | `https://www.electron.build/code-signing` |
| `CSC_KEY_PASSWORD` | `""` | `https://www.electron.build/code-signing` |
| `CSC_NAME`, | `""` | `https://www.electron.build/code-signing` |
| `BUILD_CPU_LIMIT` | `"0"` | `Linux and Windows build cpu limit. CPUs in which to allow execution (e.g., 0-3, 0,1)` |
| `BUILD_MEMORY_LIMIT` | `0` | `Linux and Windows memory limit in bytes. 1024 * 1024 * 1024 bytes = 1073741824 bytes = 1GB` |
| `OBJECT_STORAGE_TYPE` | `"cos"` | `cos: Tencent Cloud Object Storage; oss: Aliyun Object Storage; qiniu: Qiniu Object Storage.` |
| `QINIU_ACCESS_KEY` | `""` | `Qiniu Object Storage, accessKey.` |
| `QINIU_SECRET_KEY` | `""` | `Qiniu Object Storage, secretKey.` |
| `QINIU_BUCKET_KEY` | `""` | `Qiniu Object Storage, bucket.` |
| `QINIU_ZONE` | `"Zone_z0"` | `华东 Zone_z0、华北 Zone_z1、华南 Zone_z2、北美 Zone_na0` |
| `QINIU_URL` | `"https://cdn.xxx.com"` | `Qiniu Object Storage CDN url.` |
| `OSS_ACCESS_KEY_ID` | `"id"` | `Aliyun accessKeyId.` |
| `OSS_ACCESS_SECRET` | `"secret"` | `Aliyun accessKeySecret.` |
| `OSS_REGION` | `"oss-cn-qingdao"` | `Aliyun Object Storage, Region.` |
| `OSS_BUCKET` | `"bucket"` | `Aliyun Object Storage, Bucket.` |
| `OSS_URL` | `"https://cdn.xxx.com"` | `Aliyun Object Storage CDN url.` |
| `OSS_INTERNAL` | `false` | `Access aliyun OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set "true" to save lot of money.` |
| `COS_SECRE_ID` | `""` | `Tencent Cloud Object Storage SecretId.` |
| `COS_SECRE_KEY` | `""` | `SecretKey.` |
| `COS_BUCKET` | `"bucketname-12345678"` | `Bucket.` |
| `COS_REGION` | `"ap-chengdu"` | `Region.` |
| `COS_URL` | `"https://cdn.xxx.com"` | `Object Storage CDN url.` |
| ENV Var | Default | Description |
| ----------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NAME` | `"APP"` | `Your app name. Numbers, letters and "-".` |
| `SCHEME` | `"https"` | `Production environment only work with SSL.` |
| `DOMAIN` | `"www.example.com"` | `Your Electron Distribution server-side domain.` |
| `TOKEN` | `"1jH27dJf9s852"` | `Your Electron Distribution API TOKEN.` |
| `REPOPATH` | `"git@github.com:yi-ge/electron-distribution.git"` | `Your electron app repository.` |
| `BUILD_TYPE` | `"win,linux"` | `win,linux,mac` |
| `WORKPATH` | `"/data"` | `-v /data:/data, The two path must be consistent.` |
| `DOCKER_SOCKET` | `"/var/run/docker.sock"` | `Docker socket path.` |
| `MAC_SERVER_HOST` | `"127.0.0.1"` | `Your macOS server host.` |
| `MAC_SERVER_PORT` | `"22"` | `Your macOS server ssh port.` |
| `MAC_SERVER_USERNAME` | `"guest"` | `Your macOS server ssh username.` |
| `LINUX_SERVER_HOST` | `"127.0.0.1"` | `Only require build mac application. Your linux server host.` |
| `LINUX_SERVER_PORT` | `"22"` | `Only require build mac application. Your linux server ssh port.` |
| `LINUX_SERVER_USERNAME` | `"guest"` | `Only require build mac application. Your linux server ssh username.` |
| `GH_TOKEN` | `""` | `If you set publish option.` |
| `CSC_LINK` | `""` | `https://www.electron.build/code-signing` |
| `CSC_KEY_PASSWORD` | `""` | `https://www.electron.build/code-signing` |
| `CSC_NAME`, | `""` | `https://www.electron.build/code-signing` |
| `BUILD_CPU_LIMIT` | `"0"` | `Linux and Windows build cpu limit. CPUs in which to allow execution (e.g., 0-3, 0,1)` |
| `BUILD_MEMORY_LIMIT` | `0` | `Linux and Windows memory limit in bytes. 1024 * 1024 * 1024 bytes = 1073741824 bytes = 1GB` |
| `OBJECT_STORAGE_TYPE` | `"cos"` | `cos: Tencent Cloud Object Storage; oss: Aliyun Object Storage; qiniu: Qiniu Object Storage.` |
| `QINIU_ACCESS_KEY` | `""` | `Qiniu Object Storage, accessKey.` |
| `QINIU_SECRET_KEY` | `""` | `Qiniu Object Storage, secretKey.` |
| `QINIU_BUCKET_KEY` | `""` | `Qiniu Object Storage, bucket.` |
| `QINIU_ZONE` | `"Zone_z0"` | `华东 Zone_z0、华北 Zone_z1、华南 Zone_z2、北美 Zone_na0` |
| `QINIU_URL` | `"https://cdn.xxx.com"` | `Qiniu Object Storage CDN url.` |
| `OSS_ACCESS_KEY_ID` | `"id"` | `Aliyun accessKeyId.` |
| `OSS_ACCESS_SECRET` | `"secret"` | `Aliyun accessKeySecret.` |
| `OSS_REGION` | `"oss-cn-qingdao"` | `Aliyun Object Storage, Region.` |
| `OSS_BUCKET` | `"bucket"` | `Aliyun Object Storage, Bucket.` |
| `OSS_URL` | `"https://cdn.xxx.com"` | `Aliyun Object Storage CDN url.` |
| `OSS_INTERNAL` | `false` | `Access aliyun OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set "true" to save lot of money.` |
| `COS_SECRE_ID` | `""` | `Tencent Cloud Object Storage SecretId.` |
| `COS_SECRE_KEY` | `""` | `SecretKey.` |
| `COS_BUCKET` | `"bucketname-12345678"` | `Bucket.` |
| `COS_REGION` | `"ap-chengdu"` | `Region.` |
| `COS_URL` | `"https://cdn.xxx.com"` | `Object Storage CDN url.` |
Qiniu Object Storage: [https://developer.qiniu.com/kodo/sdk/1289/nodejs](https://developer.qiniu.com/kodo/sdk/1289/nodejs)
Aliyun Object Storage: [https://github.com/ali-sdk/ali-oss](https://github.com/ali-sdk/ali-oss)
Tencent Cloud Object Storage: [https://github.com/tencentyun/cos-nodejs-sdk-v5](https://github.com/tencentyun/cos-nodejs-sdk-v5)
Tencent Cloud Object Storage: [https://github.com/tencentyun/cos-nodejs-sdk-v5](https://github.com/tencentyun/cos-nodejs-sdk-v5)
#### API Document

View File

@ -37,8 +37,11 @@ docker run -itd --name electron-distribution --restart always \
wy373226722/electron-distribution
```
国内用户: `docker pull registry.cn-shenzhen.aliyuncs.com/yi-ge/electron-distribution:latest` or `docker pull ccr.ccs.tencentyun.com/yi-ge/electron-distribution:latest`
**国内用户**
阿里云镜像:`docker pull registry.cn-shenzhen.aliyuncs.com/yi-ge/electron-distribution:latest`
腾讯云镜像:`docker pull ccr.ccs.tencentyun.com/yi-ge/electron-distribution:latest`
**注意**
你需要自行安装Nginx并配置使其支持SSL这是必须的否则应用程序自动更新可能会失效。`SCHEME`只是一个标识。
#### 环境变量