(chosen latest LTS version)
$ sudo npm i -g pm2notice. mysql8.x default auth caching_sha2_pasword not support in node-mysql2 see issue
$ git clone https://github.com/EddyVerbruggen/nativescript-app-sync-server
$ cd nativescript-app-sync-server
$ npm i$ ./bin/db init --dbhost "your mysql host" --dbport "your mysql port" --dbname "codepush" --dbuser "your mysql user" --dbpassword "your mysql password"save the file config.js
Some config has to change:
local.storageDirchange to your directory,make sure have read/write permissions.local.downloadUrlreplace127.0.0.1to your machine ip.common.dataDirchange to your directory,make sure have read/write permissions.jwt.tokenSecretget the random string fromhttps://www.grc.com/passwords.htm, and replace the valueINSERT_RANDOM_TOKEN_KEY.dbconfig:username,password,host,portchange your own's
save the file process.json
some config have to change:
scriptif you install nativescript-app-sync-server from npm usenativescript-app-sync-server, or use"your source code dir"/bin/wwwCONFIG_FILEabove config.js file path, use absolute paths.
$ pm2 start process.json$ pm2 restart process.json$ pm2 stop process.json$ curl -I http://YOUR_APPSYNC_SERVER_IP:3000/return httpCode
200 OK
HTTP/1.1 200 OK
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Type: text/html; charset=utf-8
Content-Length: 592
ETag: W/"250-IiCMcM1ZUFSswSYCU0KeFYFEMO8"
Date: Sat, 25 Aug 2018 15:45:46 GMT
Connection: keep-aliveconfig redis in config.js
updateCheckCacherolloutClientUniqueIdCachetryLoginTimes
$ cd /path/to/nativescript-app-sync-server
$ git pull --rebase origin master
$ ./bin/db upgrade --dbhost "your mysql host" --dbport "your mysql port" --dbuser "your mysql user" --dbpassword "your mysql password"
# upgrade codepush database
$ pm2 restart nativescript-app-sync-server # restart service$ pm2 ls
$ pm2 show nativescript-app-sync-server
$ tail -f "output file path"- local (default)
- qiniu (qiniu)
- s3 (aws)
- oss (aliyun)
- tencentcloud
you can change it in process.json, env: PORT,HOST
$ npm i -g nativescript-app-sync-cli
$ nativescript-app-sync login http://YOU_SERVICE_IP:3000 #login in browser account:admin password:123456change admin password eg.
$ curl -X PATCH -H "Authorization: Bearer mytoken" -H "Accept: application/json" -H "Content-Type:application/json" -d '{"oldPassword":"123456","newPassword":"654321"}' http://YOU_SERVICE_IP:3000/users/passwordUse NativeScript AppSync Web to manage apps
add codePushWebUrl config in config.js
eg.
"common": {
"codePushWebUrl": "Your AppSync Web address",
}