{"action":"created","issue":{"url":"https://api.github.com/repos/lisong/code-push-server/issues/20","repository_url":"https://api.github.com/repos/lisong/code-push-server","labels_url":"https://api.github.com/repos/lisong/code-push-server/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/lisong/code-push-server/issues/20/comments","events_url":"https://api.github.com/repos/lisong/code-push-server/issues/20/events","html_url":"https://github.com/lisong/code-push-server/issues/20","id":189085539,"number":20,"title":"更新资源找不到路径","user":{"login":"L-Jovi","id":7262199,"avatar_url":"https://avatars.githubusercontent.com/u/7262199?v=3","gravatar_id":"","url":"https://api.github.com/users/L-Jovi","html_url":"https://github.com/L-Jovi","followers_url":"https://api.github.com/users/L-Jovi/followers","following_url":"https://api.github.com/users/L-Jovi/following{/other_user}","gists_url":"https://api.github.com/users/L-Jovi/gists{/gist_id}","starred_url":"https://api.github.com/users/L-Jovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L-Jovi/subscriptions","organizations_url":"https://api.github.com/users/L-Jovi/orgs","repos_url":"https://api.github.com/users/L-Jovi/repos","events_url":"https://api.github.com/users/L-Jovi/events{/privacy}","received_events_url":"https://api.github.com/users/L-Jovi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-11-14T11:08:30Z","updated_at":"2016-11-14T11:58:56Z","closed_at":null,"body":"进入热更新 sdk 的逻辑下载失败  日志如下\r\n\r\n```\r\n2016-11-14 18:47:58.238 [info][tid:com.facebook.React.JavaScript] [CodePush] Error: 404: The specified resource does not exist.\r\nRequestId:055a110c-0002-0139-0f64-3e17ec000000\r\n```\r\n\r\n---\r\n\r\n我用 pm2 指定的 `process.yml` 信息如下\r\n\r\n```\r\napps:\r\n  - script : /Users/Jovi/work/mock/code-push-server/bin/www\r\n    name   : code-push-server\r\n    watch  : true\r\n    env    :\r\n      NODE_ENV: production\r\n      PORT: 3000\r\n      CONFIG_FILE: /Users/Jovi/work/mock/production/hotfix/config.js\r\n```\r\n\r\n---\r\n\r\n对应的 `config.js` 如下\r\n\r\n```\r\nvar config = {};\r\nconfig.development = {\r\n  //数据库配置\r\n  db: {\r\n    username: \"jovi\",\r\n    password: \"miaomiao\",\r\n    database: \"codepush\",\r\n    host: \"127.0.0.1\",\r\n    dialect: \"mysql\"\r\n  },\r\n  //七牛云存储配置 当storageType为qiniu时需要配置\r\n  qiniu: {\r\n    accessKey: \"\",\r\n    secretKey: \"\",\r\n    bucketName: \"\",\r\n    downloadUrl: \"\" //文件下载域名地址\r\n  },\r\n  //文件存储在本地配置 当storageType为local时需要配置\r\n  local: {\r\n    storageDir: \"/Users/jovi/work/mock/production/hotfix/workspaces/storage\",\r\n    //文件下载地址 CodePush Server 地址 + '/download' download对应app.js里面的地址\r\n    downloadUrl: \"http://localhost:3000/download\"\r\n  },\r\n  common: {\r\n    //登录jwt签名密钥，必须更改，否则有安全隐患，可以使用随机生成的字符串\r\n    loginSecret: \"CodePushServer\",\r\n    //当天登录密码错误尝试次数，超过次数帐户将会锁定。0:表示无限制，可能会出现暴力破解。 大于0:必须开启redis服务。\r\n    tryLoginTimes: 0,\r\n    //CodePush Web部署地址，也可以配置成CodePush Web地址\r\n    //codePushWebUrl: \"http://localhost:3001\",\r\n    //差异化更新版本生成数目 默认为3\r\n    diffNums: 3,\r\n    //数据目录，优化选项\r\n    dataDir: \"/Users/jovi/work/mock/production/hotfix/workspaces/data\",\r\n    //选择存储类型，目前支持local和qiniu配置\r\n    storageType: \"local\"\r\n  },\r\n  //邮件配置，注册模块验证邮箱需要使用 参考https://github.com/nodemailer/nodemailer\r\n  smtpConfig:{\r\n    host: \"smtp.mxhichina.com\",\r\n    port: 465,\r\n    secure: true,\r\n    auth: {\r\n      user: \"\",\r\n      pass: \"\"\r\n    }\r\n  },\r\n  //配置redis, 注册时需要， 登录限制密码出错次数\r\n  redis: {\r\n    default: {\r\n      host: \"127.0.0.1\",\r\n      port: 6379,\r\n      retry_strategy: function (options) {\r\n        if (options.error.code === 'ECONNREFUSED') {\r\n          // End reconnecting on a specific error and flush all commands with a individual error\r\n          return new Error('The server refused the connection');\r\n        }\r\n        if (options.total_retry_time > 1000 * 60 * 60) {\r\n            // End reconnecting after a specific timeout and flush all commands with a individual error\r\n            return new Error('Retry time exhausted');\r\n        }\r\n        if (options.times_connected > 10) {\r\n            // End reconnecting with built in error\r\n            return undefined;\r\n        }\r\n        // reconnect after\r\n        return Math.max(options.attempt * 100, 3000);\r\n      }\r\n    }\r\n  }\r\n}\r\nconfig.production = Object.assign({}, config.development);\r\nmodule.exports = config;\r\n```\r\n\r\n---\r\n\r\n使用 code-push 推送资源成功后未发现报错  也确实看到了本地 `storage` 下存在了文件\r\n\r\n![image](https://cloud.githubusercontent.com/assets/7262199/20262681/2b76f4ba-aa9e-11e6-871a-cd86b9e58398.png)\r\n\r\n\r\n我用命令行和浏览器访问 `/download` 也发现了 404 的返回结果\r\n\r\n看到了 `app.js` 的逻辑是 `app.use('/download', express.static(_.get(config, 'local.storageDir')))`\r\n\r\n想问下问题出在哪里\r\n\r\n感谢\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/lisong/code-push-server/issues/comments/260317590","html_url":"https://github.com/lisong/code-push-server/issues/20#issuecomment-260317590","issue_url":"https://api.github.com/repos/lisong/code-push-server/issues/20","id":260317590,"user":{"login":"L-Jovi","id":7262199,"avatar_url":"https://avatars.githubusercontent.com/u/7262199?v=3","gravatar_id":"","url":"https://api.github.com/users/L-Jovi","html_url":"https://github.com/L-Jovi","followers_url":"https://api.github.com/users/L-Jovi/followers","following_url":"https://api.github.com/users/L-Jovi/following{/other_user}","gists_url":"https://api.github.com/users/L-Jovi/gists{/gist_id}","starred_url":"https://api.github.com/users/L-Jovi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L-Jovi/subscriptions","organizations_url":"https://api.github.com/users/L-Jovi/orgs","repos_url":"https://api.github.com/users/L-Jovi/repos","events_url":"https://api.github.com/users/L-Jovi/events{/privacy}","received_events_url":"https://api.github.com/users/L-Jovi/received_events","type":"User","site_admin":false},"created_at":"2016-11-14T11:58:56Z","updated_at":"2016-11-14T11:58:56Z","body":"```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\r\n<plist version=\"1.0\">\r\n<dict>\r\n\t<key>CFBundleDevelopmentRegion</key>\r\n\t<string>en</string>\r\n\t<key>CFBundleExecutable</key>\r\n\t<string>$(EXECUTABLE_NAME)</string>\r\n\t<key>CFBundleIcons</key>\r\n\t<dict/>\r\n\t<key>CFBundleIcons~ipad</key>\r\n\t<dict/>\r\n\t<key>CFBundleIdentifier</key>\r\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\r\n\t<key>CFBundleInfoDictionaryVersion</key>\r\n\t<string>6.0</string>\r\n\t<key>CFBundleName</key>\r\n\t<string>$(PRODUCT_NAME)</string>\r\n\t<key>CFBundlePackageType</key>\r\n\t<string>APPL</string>\r\n\t<key>CFBundleShortVersionString</key>\r\n\t<string>0.2.2</string>\r\n\t<key>CFBundleSignature</key>\r\n\t<string>????</string>\r\n\t<key>CFBundleVersion</key>\r\n\t<string>1</string>\r\n\t<key>CodePushDeploymentKey</key>\r\n\t<string>XJiabUpIS6p7GIlSBLvdlwEDxEae4ksvOXqog</string>\r\n\t<key>LSRequiresIPhoneOS</key>\r\n\t<true/>\r\n\t<key>NSAppTransportSecurity</key>\r\n\t<dict>\r\n\t\t<key>NSAllowsArbitraryLoads</key>\r\n\t\t<true/>\r\n\t</dict>\r\n\t<key>NSAppleMusicUsageDescription</key>\r\n\t<string>同意访问媒体库</string>\r\n\t<key>NSCalendarsUsageDescription</key>\r\n\t<string>同意访问日历</string>\r\n\t<key>NSCameraUsageDescription</key>\r\n\t<string>同意访问照相机</string>\r\n\t<key>NSContactsUsageDescription</key>\r\n\t<string>同意访问联系人</string>\r\n\t<key>NSLocationAlwaysUsageDescription</key>\r\n\t<string>同意后台一直使用位置</string>\r\n\t<key>NSLocationWhenInUseUsageDescription</key>\r\n\t<string>同意定位</string>\r\n\t<key>NSMicrophoneUsageDescription</key>\r\n\t<string>同意访问麦克风</string>\r\n\t<key>NSPhotoLibraryUsageDescription</key>\r\n\t<string>同意访问媒体库</string>\r\n\t<key>UIRequiredDeviceCapabilities</key>\r\n\t<array>\r\n\t\t<string>armv7</string>\r\n\t</array>\r\n\t<key>UIStatusBarHidden</key>\r\n\t<true/>\r\n\t<key>UISupportedInterfaceOrientations</key>\r\n\t<array>\r\n\t\t<string>UIInterfaceOrientationPortrait</string>\r\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\r\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\r\n\t</array>\r\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\r\n\t<false/>\r\n</dict>\r\n</plist>\r\n\r\n```"}}
{"actor":{"display_login":"L-Jovi"}}