{"action":"created","issue":{"url":"https://api.github.com/repos/justinleewells/pogo-optimizer/issues/133","repository_url":"https://api.github.com/repos/justinleewells/pogo-optimizer","labels_url":"https://api.github.com/repos/justinleewells/pogo-optimizer/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/justinleewells/pogo-optimizer/issues/133/comments","events_url":"https://api.github.com/repos/justinleewells/pogo-optimizer/issues/133/events","html_url":"https://github.com/justinleewells/pogo-optimizer/issues/133","id":167811635,"number":133,"title":".http-mitm-proxy not generated in Dockerhub image","user":{"login":"daveenguyen","id":2568174,"avatar_url":"https://avatars.githubusercontent.com/u/2568174?v=3","gravatar_id":"","url":"https://api.github.com/users/daveenguyen","html_url":"https://github.com/daveenguyen","followers_url":"https://api.github.com/users/daveenguyen/followers","following_url":"https://api.github.com/users/daveenguyen/following{/other_user}","gists_url":"https://api.github.com/users/daveenguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/daveenguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveenguyen/subscriptions","organizations_url":"https://api.github.com/users/daveenguyen/orgs","repos_url":"https://api.github.com/users/daveenguyen/repos","events_url":"https://api.github.com/users/daveenguyen/events{/privacy}","received_events_url":"https://api.github.com/users/daveenguyen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-27T09:35:36Z","updated_at":"2016-07-27T19:37:28Z","closed_at":"2016-07-27T14:35:48Z","body":"When I try to use `justinleewells/pogo-optimizer` image,\r\nit does not have `.http-mitm-proxy` folder generated inside the container.\r\n\r\nIt fails with the following\r\n```\r\nfs.js:640\r\n  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);\r\n                 ^\r\n\r\nError: ENOENT: no such file or directory, open '.http-mitm-proxy/certs/ca.pem'\r\n    at Error (native)\r\n    at Object.fs.openSync (fs.js:640:18)\r\n    at Object.fs.readFileSync (fs.js:508:33)\r\n    at Object.<anonymous> (/code/index.js:20:46)\r\n    at Module._compile (module.js:541:32)\r\n    at Object.Module._extensions..js (module.js:550:10)\r\n    at Module.load (module.js:458:32)\r\n    at tryModuleLoad (module.js:417:12)\r\n    at Function.Module._load (module.js:409:3)\r\n    at Module.runMain (module.js:575:10)\r\n\r\nnpm info lifecycle pogo-optimizer@1.3.0~start: Failed to exec start script\r\nnpm ERR! Linux 3.13.0-85-generic\r\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"start\"\r\nnpm ERR! node v6.3.0\r\nnpm ERR! npm  v3.10.3\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! pogo-optimizer@1.3.0 start: `gulp && node index`\r\nnpm ERR! Exit status 1\r\nnpm ERR!\r\nnpm ERR! Failed at the pogo-optimizer@1.3.0 start script 'gulp && node index'.\r\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\r\nnpm ERR! If you do, this is most likely a problem with the pogo-optimizer package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR!     gulp && node index\r\nnpm ERR! You can get information on how to open an issue for this project with:\r\nnpm ERR!     npm bugs pogo-optimizer\r\nnpm ERR! Or if that isn't available, you can get their info via:\r\nnpm ERR!     npm owner ls pogo-optimizer\r\nnpm ERR! There is likely additional logging output above.\r\n\r\nnpm ERR! Please include the following file with any support request:\r\nnpm ERR!     /code/npm-debug.log\r\n```\r\n\r\nThe code fails at the following code because it cannot open file `ca.pem` because it wasn't generated yet.\r\n```js\r\nif (!fs.existsSync(__dirname + '/.htt-mitm-proxy/certs/ca.crt')) {\r\n  var cert = forge.pki.certificateFromPem(fs.readFileSync('.http-mitm-proxy/certs/ca.pem'));\r\n  fs.writeFile('.http-mitm-proxy/certs/ca.crt', forge.asn1.toDer(forge.pki.certificateToAsn1(cert)).getBytes(), {encoding: 'binary'});\r\n}\r\n```\r\n\r\nI found [pokemon-go-mitm's README](https://github.com/rastapasta/pokemon-go-mitm-node/blob/master/README.md) and it says to run an example to generate the certificate.\r\n\r\nIf I comment the code where it failed, `node index` generates the `.http-mitm-proxy` folder.\r\n\r\nI think we could add a quick run of an example or some way to generate the certificate as part of the Dockerfile"},"comment":{"url":"https://api.github.com/repos/justinleewells/pogo-optimizer/issues/comments/235695927","html_url":"https://github.com/justinleewells/pogo-optimizer/issues/133#issuecomment-235695927","issue_url":"https://api.github.com/repos/justinleewells/pogo-optimizer/issues/133","id":235695927,"user":{"login":"ChristRespawns","id":20683342,"avatar_url":"https://avatars.githubusercontent.com/u/20683342?v=3","gravatar_id":"","url":"https://api.github.com/users/ChristRespawns","html_url":"https://github.com/ChristRespawns","followers_url":"https://api.github.com/users/ChristRespawns/followers","following_url":"https://api.github.com/users/ChristRespawns/following{/other_user}","gists_url":"https://api.github.com/users/ChristRespawns/gists{/gist_id}","starred_url":"https://api.github.com/users/ChristRespawns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChristRespawns/subscriptions","organizations_url":"https://api.github.com/users/ChristRespawns/orgs","repos_url":"https://api.github.com/users/ChristRespawns/repos","events_url":"https://api.github.com/users/ChristRespawns/events{/privacy}","received_events_url":"https://api.github.com/users/ChristRespawns/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T19:37:28Z","updated_at":"2016-07-27T19:37:28Z","body":"That worked. Thanks for the help!"}}
{"actor":{"display_login":"ChristRespawns"}}