lisong / code-push-server Goto Github PK
View Code? Open in Web Editor NEWCodePush service is hot update services which adapter react-native-code-push and cordova-plugin-code-push - 热更新
License: MIT License
CodePush service is hot update services which adapter react-native-code-push and cordova-plugin-code-push - 热更新
License: MIT License
Please create dir /Users/tablee/workspaces/storage
C:\Users\Administrator\AppData\Roaming\npm\node_modules\code-push-server\app.js:57
throw new Error(Please create dir ${dir}
);
在windows下创建上述目录失败,因为这是linux系统下的路径格式,能否支持一下window路径?
PATCH /apps/xbc-android/deployments/Staging/release 404 33.010 ms - 1580
Error: Not Found
at E:\code-push-server\app.js:71:13
at Layer.handle [as handle_request] (E:\code-push-server\node_modules\expres
s\lib\router\layer.js:95:5)
at trim_prefix (E:\code-push-server\node_modules\express\lib\router\index.js
:312:13)
at E:\code-push-server\node_modules\express\lib\router\index.js:280:7
at Function.process_params (E:\code-push-server\node_modules\express\lib\rou
ter\index.js:330:12)
at next (E:\code-push-server\node_modules\express\lib\router\index.js:271:10
)
at E:\code-push-server\node_modules\express\lib\router\index.js:618:15
at next (E:\code-push-server\node_modules\express\lib\router\index.js:256:14
)
at Function.handle (E:\code-push-server\node_modules\express\lib\router\inde
x.js:176:3)
at router (E:\code-push-server\node_modules\express\lib\router\index.js:46:1
2)
at Layer.handle [as handle_request] (E:\code-push-server\node_modules\expres
s\lib\router\layer.js:95:5)
at trim_prefix (E:\code-push-server\node_modules\express\lib\router\index.js
:312:13)
at E:\code-push-server\node_modules\express\lib\router\index.js:280:7
at Function.process_params (E:\code-push-server\node_modules\express\lib\rou
ter\index.js:330:12)
at next (E:\code-push-server\node_modules\express\lib\router\index.js:271:10
)
at E:\code-push-server\node_modules\express\lib\router\index.js:618:15
yargs(测试版本 6.6.0)会把纯数字变为number类型
导致bin/db里面的 _.isString()返回false
如果我们的app需求:同时数十万的客户端在哪请求更新,请问code-push-server 的数据库机制能够解决吗?谢啦
有时候莫名的更新错误,服务死掉了,请问遇到过,遇到过没有啊
code-push release-react MYAPP android -m true -d Production
mandatory option shows no. both v6, v7 was released with mandatory option
If i open the app to get the new code-pushed bundle, the app crashes
And then, when i reopen the app, now the app works with the new pushed bundle.
Any clues to guess? 😰
/bin/www 运行可以用默认账号登录,用 pm2 启动登录时提示 secret must be a string or buffer
进入热更新 sdk 的逻辑下载失败 日志如下
2016-11-14 18:47:58.238 [info][tid:com.facebook.React.JavaScript] [CodePush] Error: 404: The specified resource does not exist.
RequestId:055a110c-0002-0139-0f64-3e17ec000000
我用 pm2 指定的 process.yml
信息如下
apps:
- script : /Users/Jovi/work/mock/code-push-server/bin/www
name : code-push-server
watch : true
env :
NODE_ENV: production
PORT: 3000
CONFIG_FILE: /Users/Jovi/work/mock/production/hotfix/config.js
对应的 config.js
如下
var config = {};
config.development = {
//数据库配置
db: {
username: "jovi",
password: "miaomiao",
database: "codepush",
host: "127.0.0.1",
dialect: "mysql"
},
//七牛云存储配置 当storageType为qiniu时需要配置
qiniu: {
accessKey: "",
secretKey: "",
bucketName: "",
downloadUrl: "" //文件下载域名地址
},
//文件存储在本地配置 当storageType为local时需要配置
local: {
storageDir: "/Users/jovi/work/mock/production/hotfix/workspaces/storage",
//文件下载地址 CodePush Server 地址 + '/download' download对应app.js里面的地址
downloadUrl: "http://localhost:3000/download"
},
common: {
//登录jwt签名密钥,必须更改,否则有安全隐患,可以使用随机生成的字符串
loginSecret: "CodePushServer",
//当天登录密码错误尝试次数,超过次数帐户将会锁定。0:表示无限制,可能会出现暴力破解。 大于0:必须开启redis服务。
tryLoginTimes: 0,
//CodePush Web部署地址,也可以配置成CodePush Web地址
//codePushWebUrl: "http://localhost:3001",
//差异化更新版本生成数目 默认为3
diffNums: 3,
//数据目录,优化选项
dataDir: "/Users/jovi/work/mock/production/hotfix/workspaces/data",
//选择存储类型,目前支持local和qiniu配置
storageType: "local"
},
//邮件配置,注册模块验证邮箱需要使用 参考https://github.com/nodemailer/nodemailer
smtpConfig:{
host: "smtp.mxhichina.com",
port: 465,
secure: true,
auth: {
user: "",
pass: ""
}
},
//配置redis, 注册时需要, 登录限制密码出错次数
redis: {
default: {
host: "127.0.0.1",
port: 6379,
retry_strategy: function (options) {
if (options.error.code === 'ECONNREFUSED') {
// End reconnecting on a specific error and flush all commands with a individual error
return new Error('The server refused the connection');
}
if (options.total_retry_time > 1000 * 60 * 60) {
// End reconnecting after a specific timeout and flush all commands with a individual error
return new Error('Retry time exhausted');
}
if (options.times_connected > 10) {
// End reconnecting with built in error
return undefined;
}
// reconnect after
return Math.max(options.attempt * 100, 3000);
}
}
}
}
config.production = Object.assign({}, config.development);
module.exports = config;
使用 code-push 推送资源成功后未发现报错 也确实看到了本地 storage
下存在了文件
我用命令行和浏览器访问 /download
也发现了 404 的返回结果
看到了 app.js
的逻辑是 app.use('/download', express.static(_.get(config, 'local.storageDir')))
想问下问题出在哪里
感谢
使用 code-push release-react -ios ios -d Production 打包并发布后
启动待更新应用,应用没有更新。
本地服务器Shell 报以下错误,烦请指示一下哪里配置不对了 @lisong
帮忙分析一下,谢谢
客户端发布报如下错误
[Error] EACCES: permission denied, mkdir '/Users'
报这个错误,Please upgrade your database. usage bin/db upgrade or code-push-server-db upgrade。
After the installation is complete, open the address login, the default account password is admin, 123456
How do I change it
你好 首先感谢你的这个项目
这里想问几个关于 codepush 的问题
我看到你初始化设置了 账号 admin
和 密码 123456
我目前已经通过 code-push-cli 成功的 login 并且生成了我本地的 session config
我的问题是这个初始的账号密码是否可以使用 code-push-cli 更换
code-push-cli 是否只能记忆单次会话
我之前是使用微软官方的公有云 在登出了之后我指定了本地 http://localhost:3000
作为参数生成了新的 config
这是不是意味着以后我想再使用微软之前生成的账号 就需要再次先 logout 后重新 login 微软公有云才有效?
如果上述条目 2 成立 我在第一次指定了 code-push-cli login http://localhost:3000
之后的所有后续操作 比如 code-push app add <MyApp>
等等 是不是都不再需要指定本地的 url 参数了 会直接发送到 http://localhost:3000 的服务?
感谢回复
致意
当我执行
code-push-server-db init --dbhost localhost --dbuser root --dbpassword
的时候报错
{ [Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: NO)]
cause:
{ [Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: NO)]
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sqlState: '28000',
fatal: true },
isOperational: true,
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sqlState: '2800
npm ERR! Linux 3.19.0-25-generic
npm ERR! argv "/root/.nvm/versions/node/v6.9.1/bin/node" "/root/.nvm/versions/node/v6.9.1/bin/npm" "install" "code-push-server" "-g"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/app/code-push-server/npm-debug.log
npm ERR! code 1
自己的搭建的code-push-server 有没有管理界面
看到默认使用的账户是 [email protected]
使用 code-push register http://[myhost] 后发现到了登录界面 输入数据库里初始的用户名密码后发现后台报错
。。想默默问下怎么注册新的邮箱账户
感谢 :)
如何解决服务被中间人抓包的问题呢?
这样被人就能拿到我们的bundle代码了
没有修改密码的地方
如题 因为我们这个服务器是直接使用 node 自己的 server 我想加一层 auth 之后再暴露到外面 想问下有木有办法
感谢
@lisong 帮忙看一下创建服务器时候出的这个错误
`npm ERR! Linux 2.6.32-504.el6.x86_64
npm ERR! argv "/weblogic/code-push/node-v6.6.0-linux-x64/bin/node" "/weblogic/code-push/node-v6.6.0-linux-x64/bin/npm" "install"
npm ERR! node v6.6.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /weblogic/code-push/code-push-server/npm-debug.log
`
Want to use S3
, instead of qiniu
https://github.com/lisong/code-push-server/blob/master/core/utils/common.js#L158
I am planning to replace this part to s3upload.
Seems like there is no problem, but it should be better asking to the owner :)
本地存储的我测试过了,可以用了
请问是还有什么没说明清楚的要做的步骤吗?因为是这方面的新手可能有些地方不是很明白,谢谢了。
通过CLI的generate指令在指定目录下创建一个服务器实例,这样便于配置、管理(尤其是需要运行多个server实例时)和定制,同时也比clone github的代码更加友好。
code-push release-cordova 使用 -t 参数,即--targetBinaryVersion 参数
一直报错不支持的版本号, 是该功能未实现么?
bogon:code-push-demo-app-master jq$ code-push release CodePushDemo-android ./bundles/index.android.bundle 1.0.0 --deploymentName Production --description "1.支持文章缓存。" --mandatory true
Upload progress:[==================================================] 100% 0.0s
[Error] 上传的文件格式不对
1.执行code-push release-react CodePushDemo-ios ios -d Production或在App点更新,控制台出现:
GET /download/FiF3MP8tbkXx_dkU0OFIE3beImwE 404 0.778 ms - 1987
Error: Not Found
at /usr/local/lib/node_modules/code-push-server/app.js:69:13
...
app界面无变化
2.在mac下我用http://localhost:3000和http://127.0.0.1:3000都可以访问,用局域网ip却不行,我没有改host文件,也没有在浏览器设代理
Every server's secret configurations are raw string
in config.js(i.e username: "root"
)
It needs to be hidden.
我使用 code-push release ... ./bundle/index.android.bundle .... 会提示上传格式不对。
我使用 code-push release ... ./bundle .... 会提示 it must be publish it by ios type 。
请教一下,应该如何使用 code-push release 。
谢谢。
部署到数据库总是登录连接不上,有空帮忙看一下什么原因?qq1245880084
使用如下命令部署
code-push release-react finance-android android --description "13. 测试提示" -d "Production" -m
服务端错误日志:
0|code-pus | { Error: ENOENT: no such file or directory, chmod '/home/ubuntu/storage/FkrEhz92120pOEqjFY5zUhi9Teoz'
0|code-pus | errno: -2,
0|code-pus | code: 'ENOENT',
0|code-pus | syscall: 'chmod',
0|code-pus | path: '/home/ubuntu/storage/FkrEhz92120pOEqjFY5zUhi9Teoz' }
0|code-pus | Error: ENOENT: no such file or directory, open '/tmp/codepush_DZ6SFf4vUBZwgKvTzMLOpzn2ZElmjH2Y/FgJjaMWow7_70N7g29IezDkkwl19.zip'
PM2 | App [code-push-server] with id [0] and pid [21423], exited with code [1] via signal [SIGINT]
PM2 | Starting execution sequence in -fork mode- for app name:code-push-server id:0
PM2 | App name:code-push-server id:0 online
可以看出code-push-server进程是退出了,但是由于使用了pm2管理并开启watch,所以又重启了。
不知道为什么会出现这样的错误,还请指教
CodePush 有个 package_hash 。
这个值是在客户端 code-push release 的时候在客户端产生然后发送给服务器保存的 ,
还是更新包zip文件发送到服务器端了之后,服务器端hash得到的值?
点击更新按钮之后,出现下载弹窗,然后点击安装后就会显示unknown error。查看了服务端发现有查询packages_diff表,但我看了一下那个表里是空的。请教一下可能是什么原因导致这个错误呢?
客户端版本号为4位可以吗,非得强制3位吗
Hi, I follow the tutorial, but when I run code-push-server-db init --dbhost localhost —dbuser root --dbpassword 123456
, error occurs, here is the log
$ code-push-server-db init --dbhost localhost —dbuser root --dbpassword 123456
/home/google/.tnvm/versions/alinode/v2.0.8/lib/node_modules/code-push-server/node_modules/mysql/lib/protocol/Parser.js:79
throw err; // Rethrow non-MySQL errors
^
Error: If encoding is specified then the first argument must be a string
at new Buffer (buffer.js:74:13)
I am getting a error "stream connection ended and connection aborted" while trying to login using default credentials
报找不到文件的错误
GET //download/Fqh9cD7XMY223d5g_SbncGC7FNh4 404 3.040 ms - 1907
Error: Not Found
at /Users/jq/React-native/code-push-server/app.js:70:13
at Layer.handle [as handle_request] (/Users/jq/React-native/code-push-server/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/jq/React-native/code-p
ush-server/node_modules/express/lib/router/index.js:312:13)
at /Users/jq/React-native/code-push-server/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/Users/jq/React-native/code-push-server/node_modules/express/lib/router/index.js:330:12)
at next (/Users/jq/React-native/code-push-server/node_modules/express/lib/router/index.js:271:10)
at /Users/jq/React-native/code-push-server/node_modules/express/lib/router/index.js:618:15
at next (/Users/jq/React-native/code-push-server/node_modules/express/lib/router/index.js:256:14)
at Function.handle (/Users/jq/React-native/code-push-server/node_modules/express/lib/router/index.js:176:3)
我的config配置如下:
** local: {
// Binary files storage dir, Do not use tmpdir and it's public download dir.
storageDir: "/Users/jq/code-push-storage",
// Binary files download host address which Code Push Server listen to. the files storage in storageDir.
downloadUrl: "http://10.2.8.208:3000/download",
// public static download spacename.
public: '/download'
},
jwt: {
// Recommended: 63 random alpha-numeric characters
// Generate using: https://www.grc.com/passwords.htm
tokenSecret: 'INSERT_RANDOM_TOKEN_KEY'
},
common: {
/*
* tryLoginTimes is control login error times to avoid force attack.
* if value is 0, no limit for login auth, it may not safe for account. when it's a number, it means you can
* try that times today. but it need config redis server.
*/
tryLoginTimes: 0,
// CodePush Web(https://github.com/lisong/code-push-web) login address.
//codePushWebUrl: "http://localhost:3001/login",
// create patch updates's number. default value is 3
diffNums: 3,
// data dir for caclulate diff files. it's optimization.
dataDir: "/Users/jq/code-push-storage",
// storageType which is your binary package files store. options value is ("local" | "qiniu" | "s3")
storageType: "local",
// options value is (true | false), when it's true, it will cache updateCheck results in redis.
updateCheckCache: false
},
想问下这是自己搭建私有的 code push server 嘛 官方文档貌似只找到 sdk 和 cli 的集成方法
有哪里提供官方的搭建 code push server 服务的文档么
感谢
Got ER_INVALID_DEFAULT 1067 issue running database init on clean [email protected]
./bin/db init --dbhost localhost --dbuser root --dbpassword
{ Error: ER_INVALID_DEFAULT: Invalid default value for 'created_at'
...
I've created PR with the fix
code-push deployment clear app-ios Staging
执行这个命令后 不能删除仍然提示更新
貌似没搜到相关代码的样子
如果不支持,请问是否有支持计划?
如果我命令行code-push-cli 已经登陆一个服务器,但是那个服务器已经销毁了,code-push logout 登出超时,怎么解决,我想登陆一个新的服务器
执行后并不能清除已经上传的package
是未实现么?
比如 SQLite之类
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.