{"action":"created","comment":{"url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments/236790431","pull_request_review_id":178938611,"id":236790431,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjc5MDQzMQ==","diff_hunk":"@@ -113,38 +118,99 @@ func serviceChannel(newChannel ssh.NewChannel) error {\n \t}\n \tdefer channel.Close()\n \n+\tallow := map[string]bool{\"shell\": true, \"pty-req\": true, \"window-change\": true}\n+\tresize := make(chan *pty.Winsize, 1)\n+\tdefer close(resize)\n+\tdone := make(chan struct{})\n+\tfor {\n+\t\tselect {\n+\t\tcase <-done:\n+\t\t\treturn nil\n+\t\tcase req, ok := <-requests:\n+\t\t\tif !ok {\n+\t\t\t\treturn nil\n+\t\t\t}\n+\t\t\tif req.WantReply {\n+\t\t\t\treq.Reply(allow[req.Type], nil)\n+\t\t\t}\n+\t\t\tswitch req.Type {\n+\t\t\tcase \"pty-req\":\n+\t\t\t\tr := bytes.NewReader(req.Payload)\n+\t\t\t\tterm, err := readString(r)\n+\t\t\t\tif err != nil {\n+\t\t\t\t\treturn fmt.Errorf(\"parsing TERM environment variable value: %v\", err)\n+\t\t\t\t}\n+\n+\t\t\t\tsize, err := readWindowSize(r)\n+\t\t\t\tif err != nil {\n+\t\t\t\t\treturn fmt.Errorf(\"parsing window size: %v\", err)\n+\t\t\t\t}\n+\t\t\t\tresize <- size\n+\n+\t\t\t\tgo func() {\n+\t\t\t\t\tif err := runPTY(channel, term, resize); err != nil {\n+\t\t\t\t\t\tfmt.Printf(\"Failed to run pty: %v\", err)\n+\t\t\t\t\t}\n+\t\t\t\t\tclose(done)\n+\t\t\t\t}()\n+\t\t\tcase \"window-change\":\n+\t\t\t\tsize, err := readWindowSize(bytes.NewReader(req.Payload))\n+\t\t\t\tif err != nil {\n+\t\t\t\t\tlog.Printf(\"Failed to parse window size: %v\", err)\n+\t\t\t\t\tcontinue\n+\t\t\t\t}\n+\t\t\t\tresize <- size\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+func runPTY(channel ssh.Channel, term string, resize chan *pty.Winsize) error {\n \t// Start the command with a pseudo-terminal.\n-\tshell, err := pty.Start(exec.Command(\"bash\"))\n+\tcmd := exec.Command(\"bash\")\n+\tcmd.Env = append(cmd.Env, fmt.Sprintf(\"TERM=%s\", term))\n+\tshell, err := pty.Start(cmd)\n \tif err != nil {\n-\t\treturn fmt.Errorf(\"starting pty: %v\", err)\n+\t\treturn fmt.Errorf(\"Failed to start pty: %v\", err)","path":"ssh-server/main.go","position":112,"original_position":112,"commit_id":"96e50736d6489b6a5439ad542e7911d44ba95201","original_commit_id":"96e50736d6489b6a5439ad542e7911d44ba95201","user":{"login":"kemp-google","id":28713279,"node_id":"MDQ6VXNlcjI4NzEzMjc5","avatar_url":"https://avatars3.githubusercontent.com/u/28713279?v=4","gravatar_id":"","url":"https://api.github.com/users/kemp-google","html_url":"https://github.com/kemp-google","followers_url":"https://api.github.com/users/kemp-google/followers","following_url":"https://api.github.com/users/kemp-google/following{/other_user}","gists_url":"https://api.github.com/users/kemp-google/gists{/gist_id}","starred_url":"https://api.github.com/users/kemp-google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kemp-google/subscriptions","organizations_url":"https://api.github.com/users/kemp-google/orgs","repos_url":"https://api.github.com/users/kemp-google/repos","events_url":"https://api.github.com/users/kemp-google/events{/privacy}","received_events_url":"https://api.github.com/users/kemp-google/received_events","type":"User","site_admin":false},"body":"Change message back to original","created_at":"2018-11-27T18:29:51Z","updated_at":"2018-11-27T18:30:27Z","html_url":"https://github.com/googlegenomics/pipelines-tools/pull/85#discussion_r236790431","pull_request_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments/236790431"},"html":{"href":"https://github.com/googlegenomics/pipelines-tools/pull/85#discussion_r236790431"},"pull_request":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85","id":232465764,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNDY1NzY0","html_url":"https://github.com/googlegenomics/pipelines-tools/pull/85","diff_url":"https://github.com/googlegenomics/pipelines-tools/pull/85.diff","patch_url":"https://github.com/googlegenomics/pipelines-tools/pull/85.patch","issue_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/85","number":85,"state":"open","locked":false,"title":"Fixed connection error through browser SSH","user":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-20T21:32:30Z","updated_at":"2018-11-27T18:30:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66e5d96d9635d3dfbf7a6b988a4ed64cfc5f9eae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85/commits","review_comments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85/comments","review_comment_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/85/comments","statuses_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/statuses/96e50736d6489b6a5439ad542e7911d44ba95201","head":{"label":"anamanolache:browserSSH","ref":"browserSSH","sha":"96e50736d6489b6a5439ad542e7911d44ba95201","user":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"repo":{"id":130226215,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAyMjYyMTU=","name":"pipelines-tools","full_name":"anamanolache/pipelines-tools","private":false,"owner":{"login":"anamanolache","id":23612578,"node_id":"MDQ6VXNlcjIzNjEyNTc4","avatar_url":"https://avatars1.githubusercontent.com/u/23612578?v=4","gravatar_id":"","url":"https://api.github.com/users/anamanolache","html_url":"https://github.com/anamanolache","followers_url":"https://api.github.com/users/anamanolache/followers","following_url":"https://api.github.com/users/anamanolache/following{/other_user}","gists_url":"https://api.github.com/users/anamanolache/gists{/gist_id}","starred_url":"https://api.github.com/users/anamanolache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anamanolache/subscriptions","organizations_url":"https://api.github.com/users/anamanolache/orgs","repos_url":"https://api.github.com/users/anamanolache/repos","events_url":"https://api.github.com/users/anamanolache/events{/privacy}","received_events_url":"https://api.github.com/users/anamanolache/received_events","type":"User","site_admin":false},"html_url":"https://github.com/anamanolache/pipelines-tools","description":"Tools for developing and running pipelines with the Genomics API","fork":true,"url":"https://api.github.com/repos/anamanolache/pipelines-tools","forks_url":"https://api.github.com/repos/anamanolache/pipelines-tools/forks","keys_url":"https://api.github.com/repos/anamanolache/pipelines-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anamanolache/pipelines-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anamanolache/pipelines-tools/teams","hooks_url":"https://api.github.com/repos/anamanolache/pipelines-tools/hooks","issue_events_url":"https://api.github.com/repos/anamanolache/pipelines-tools/issues/events{/number}","events_url":"https://api.github.com/repos/anamanolache/pipelines-tools/events","assignees_url":"https://api.github.com/repos/anamanolache/pipelines-tools/assignees{/user}","branches_url":"https://api.github.com/repos/anamanolache/pipelines-tools/branches{/branch}","tags_url":"https://api.github.com/repos/anamanolache/pipelines-tools/tags","blobs_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anamanolache/pipelines-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/anamanolache/pipelines-tools/languages","stargazers_url":"https://api.github.com/repos/anamanolache/pipelines-tools/stargazers","contributors_url":"https://api.github.com/repos/anamanolache/pipelines-tools/contributors","subscribers_url":"https://api.github.com/repos/anamanolache/pipelines-tools/subscribers","subscription_url":"https://api.github.com/repos/anamanolache/pipelines-tools/subscription","commits_url":"https://api.github.com/repos/anamanolache/pipelines-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/anamanolache/pipelines-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/anamanolache/pipelines-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/anamanolache/pipelines-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/anamanolache/pipelines-tools/contents/{+path}","compare_url":"https://api.github.com/repos/anamanolache/pipelines-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anamanolache/pipelines-tools/merges","archive_url":"https://api.github.com/repos/anamanolache/pipelines-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anamanolache/pipelines-tools/downloads","issues_url":"https://api.github.com/repos/anamanolache/pipelines-tools/issues{/number}","pulls_url":"https://api.github.com/repos/anamanolache/pipelines-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/anamanolache/pipelines-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/anamanolache/pipelines-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anamanolache/pipelines-tools/labels{/name}","releases_url":"https://api.github.com/repos/anamanolache/pipelines-tools/releases{/id}","deployments_url":"https://api.github.com/repos/anamanolache/pipelines-tools/deployments","created_at":"2018-04-19T14:15:14Z","updated_at":"2018-06-18T21:22:16Z","pushed_at":"2018-11-26T18:13:09Z","git_url":"git://github.com/anamanolache/pipelines-tools.git","ssh_url":"git@github.com:anamanolache/pipelines-tools.git","clone_url":"https://github.com/anamanolache/pipelines-tools.git","svn_url":"https://github.com/anamanolache/pipelines-tools","homepage":null,"size":150,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"googlegenomics:master","ref":"master","sha":"2c276392db660c1ed3a0e0721fa97c718420fa21","user":{"login":"googlegenomics","id":7434120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MzQxMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7434120?v=4","gravatar_id":"","url":"https://api.github.com/users/googlegenomics","html_url":"https://github.com/googlegenomics","followers_url":"https://api.github.com/users/googlegenomics/followers","following_url":"https://api.github.com/users/googlegenomics/following{/other_user}","gists_url":"https://api.github.com/users/googlegenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/googlegenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlegenomics/subscriptions","organizations_url":"https://api.github.com/users/googlegenomics/orgs","repos_url":"https://api.github.com/users/googlegenomics/repos","events_url":"https://api.github.com/users/googlegenomics/events{/privacy}","received_events_url":"https://api.github.com/users/googlegenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":123620762,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM2MjA3NjI=","name":"pipelines-tools","full_name":"googlegenomics/pipelines-tools","private":false,"owner":{"login":"googlegenomics","id":7434120,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MzQxMjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7434120?v=4","gravatar_id":"","url":"https://api.github.com/users/googlegenomics","html_url":"https://github.com/googlegenomics","followers_url":"https://api.github.com/users/googlegenomics/followers","following_url":"https://api.github.com/users/googlegenomics/following{/other_user}","gists_url":"https://api.github.com/users/googlegenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/googlegenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlegenomics/subscriptions","organizations_url":"https://api.github.com/users/googlegenomics/orgs","repos_url":"https://api.github.com/users/googlegenomics/repos","events_url":"https://api.github.com/users/googlegenomics/events{/privacy}","received_events_url":"https://api.github.com/users/googlegenomics/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/googlegenomics/pipelines-tools","description":"Tools for developing and running pipelines with the Genomics API","fork":false,"url":"https://api.github.com/repos/googlegenomics/pipelines-tools","forks_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/forks","keys_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/teams","hooks_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/hooks","issue_events_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/events{/number}","events_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/events","assignees_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/assignees{/user}","branches_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/branches{/branch}","tags_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/tags","blobs_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/languages","stargazers_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/stargazers","contributors_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/contributors","subscribers_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/subscribers","subscription_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/subscription","commits_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/contents/{+path}","compare_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/merges","archive_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/downloads","issues_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues{/number}","pulls_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/labels{/name}","releases_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/releases{/id}","deployments_url":"https://api.github.com/repos/googlegenomics/pipelines-tools/deployments","created_at":"2018-03-02T19:20:13Z","updated_at":"2018-11-16T20:55:58Z","pushed_at":"2018-11-26T18:13:11Z","git_url":"git://github.com/googlegenomics/pipelines-tools.git","ssh_url":"git@github.com:googlegenomics/pipelines-tools.git","clone_url":"https://github.com/googlegenomics/pipelines-tools.git","svn_url":"https://github.com/googlegenomics/pipelines-tools","homepage":null,"size":115,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":9,"open_issues":3,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85"},"html":{"href":"https://github.com/googlegenomics/pipelines-tools/pull/85"},"issue":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/85"},"comments":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/googlegenomics/pipelines-tools/statuses/96e50736d6489b6a5439ad542e7911d44ba95201"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kemp-google"}}