Compare commits

..

11 Commits

5 changed files with 1541 additions and 1295 deletions

View File

@ -39,14 +39,18 @@ docker run -itd --name electron-distribution --restart always \
wy373226722/electron-distribution:latest 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. You need to configure nginx and SSL by yourself. SCHEME only a tip.
#### Environment #### Environment
| ENV Var | Default | Description | | ENV Var | Default | Description |
|---|---|---| | ----------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NAME` | `"APP"` | `Your app name. Numbers, letters and "-".` | | `NAME` | `"APP"` | `Your app name. Numbers, letters and "-".` |
| `SCHEME` | `"https"` | `Production environment only work with SSL.` | | `SCHEME` | `"https"` | `Production environment only work with SSL.` |
| `DOMAIN` | `"www.example.com"` | `Your Electron Distribution server-side domain.` | | `DOMAIN` | `"www.example.com"` | `Your Electron Distribution server-side domain.` |

View File

@ -37,14 +37,18 @@ docker run -itd --name electron-distribution --restart always \
wy373226722/electron-distribution 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`只是一个标识。 你需要自行安装 Nginx 并配置使其支持 SSL这是必须的否则应用程序自动更新可能会失效。`SCHEME`只是一个标识。
#### 环境变量 #### 环境变量
| 变量名 | 默认值 | 描述 | | 变量名 | 默认值 | 描述 |
|---|---|---| | ----------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NAME` | `"APP"` | `Your app name. Numbers, letters and "-".` | | `NAME` | `"APP"` | `Your app name. Numbers, letters and "-".` |
| `SCHEME` | `"https"` | `Production environment only work with SSL.` | | `SCHEME` | `"https"` | `Production environment only work with SSL.` |
| `DOMAIN` | `"www.example.com"` | `Your Electron Distribution server-side domain.` | | `DOMAIN` | `"www.example.com"` | `Your Electron Distribution server-side domain.` |

View File

@ -1,45 +1,44 @@
{ {
"name": "electron-distribution", "name": "electron-distribution",
"version": "1.0.3", "version": "1.0.4",
"description": "Electron Distribution", "description": "Electron Distribution",
"author": "yi-ge <a@wyr.me>", "author": "yi-ge <a@wyr.me>",
"scripts": { "scripts": {
"dev": "cross-env NODE_ENV=development nodemon src/dev.js", "dev": "nodemon src/dev.js",
"build": "babel src -d dist", "build": "babel src -d dist",
"start": "node dist/app.js" "start": "node dist/app.js"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"ali-oss": "^6.1.1", "ali-oss": "^6.4.0",
"axios": "^0.18.0", "axios": "^0.19.1",
"chalk": "^2.4.2", "chalk": "^3.0.0",
"chance": "^1.0.18", "chance": "^1.1.4",
"cos-nodejs-sdk-v5": "^2.5.7", "cos-nodejs-sdk-v5": "^2.5.14",
"cross-env": "^5.2.0", "dockerode": "^3.0.2",
"dockerode": "^2.5.8",
"hapi": "^18.1.0", "hapi": "^18.1.0",
"hapi-swagger": "^9.4.2", "hapi-swagger": "^12.0.0",
"inert": "^5.1.2", "inert": "^5.1.3",
"joi": "^13.7.0", "joi": "^14.3.1",
"jssha": "^2.3.1", "jssha": "^2.3.1",
"lodash": "^4.17.11", "lodash": "^4.17.15",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"moment-timezone": "^0.5.23", "moment-timezone": "^0.5.27",
"qiniu": "^7.2.1", "qiniu": "^7.3.0",
"simple-git": "^1.110.0", "simple-git": "^1.129.0",
"socket.io": "^2.2.0", "socket.io": "^2.3.0",
"ssh2": "^0.8.2", "ssh2": "^0.8.7",
"vision": "^5.4.4" "vision": "^5.4.4"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.2.3", "@babel/cli": "^7.8.3",
"@babel/core": "^7.4.0", "@babel/core": "^7.8.3",
"@babel/plugin-proposal-class-properties": "^7.4.0", "@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-decorators": "^7.4.0", "@babel/plugin-proposal-decorators": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.2.0", "@babel/plugin-proposal-optional-chaining": "^7.8.3",
"@babel/preset-env": "^7.4.2", "@babel/preset-env": "^7.8.3",
"@babel/register": "^7.4.0", "@babel/register": "^7.8.3",
"nodemon": "^1.18.10" "nodemon": "^2.0.2"
}, },
"nodemonConfig": { "nodemonConfig": {
"ignore": [ "ignore": [

View File

@ -6,7 +6,6 @@ const mac = new qiniu.auth.digest.Mac(QINIU.accessKey, QINIU.secretKey)
const putPolicy = new qiniu.rs.PutPolicy({ const putPolicy = new qiniu.rs.PutPolicy({
scope: QINIU.bucket scope: QINIU.bucket
}) })
const uploadToken = putPolicy.uploadToken(mac)
const config = new qiniu.conf.Config() const config = new qiniu.conf.Config()
// 空间对应的机房 // 空间对应的机房
@ -18,6 +17,7 @@ config.useHttpsDomain = true
export const uploadLocalFileToQiniu = (key, localFile) => { export const uploadLocalFileToQiniu = (key, localFile) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const uploadToken = putPolicy.uploadToken(mac)
var resumeUploader = new qiniu.resume_up.ResumeUploader(config) var resumeUploader = new qiniu.resume_up.ResumeUploader(config)
var putExtra = new qiniu.resume_up.PutExtra() var putExtra = new qiniu.resume_up.PutExtra()
// 如果指定了断点记录文件,那么下次会从指定的该文件尝试读取上次上传的进度,以实现断点续传 // 如果指定了断点记录文件,那么下次会从指定的该文件尝试读取上次上传的进度,以实现断点续传

2595
yarn.lock

File diff suppressed because it is too large Load Diff