GitHub PullRequestReviewCommentEvent at 2014-11-23 00:51:45
Repository: fleet
Actor: philips
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/coreos/fleet/pulls/comments/20761135","id":20761135,"diff_hunk":"@@ -386,6 +386,56 @@ func getHTTPClient() (client.API, error) {\n \treturn client.NewHTTPClient(&hc, *ep)\n }\n \n+type ncConn struct {\n+\tnet.Conn\n+\tcloseFunc func()\n+}\n+\n+func (nc *ncConn) Close() error {\n+\tnc.closeFunc()\n+\treturn nc.Conn.Close()\n+}\n+\n+type DialFunc func(net, addr string) (net.Conn, error)\n+\n+func ncTunnelFunc(dial DialFunc, tun string, tgt string) DialFunc {\n+\tproxyHost := \"127.0.0.1\"\n+\tproxyPort := 41827\n+\n+\treturn func(string, string) (net.Conn, error) {\n+\t\tsshClient, err := ssh.NewSSHClient(\"core\", tun, getChecker(), true, getSSHTimeoutFlag())\n+\t\tif err != nil {\n+\t\t\treturn nil, fmt.Errorf(\"failed initializing SSH client: %v\", err)\n+\t\t}\n+\t\tcmd := fmt.Sprintf(`/usr/bin/ncat --listen %s %d --exec \"/usr/bin/ncat --unixsock %s\"`, proxyHost, proxyPort, tgt)","path":"fleetctl/fleetctl.go","position":65,"original_position":65,"commit_id":"7156806db0113d2551d2149e4143a71b0dc37d89","original_commit_id":"7156806db0113d2551d2149e4143a71b0dc37d89","user":{"login":"philips","id":33544,"avatar_url":"https://avatars.githubusercontent.com/u/33544?v=3","gravatar_id":"","url":"https://api.github.com/users/philips","html_url":"https://github.com/philips","followers_url":"https://api.github.com/users/philips/followers","following_url":"https://api.github.com/users/philips/following{/other_user}","gists_url":"https://api.github.com/users/philips/gists{/gist_id}","starred_url":"https://api.github.com/users/philips/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philips/subscriptions","organizations_url":"https://api.github.com/users/philips/orgs","repos_url":"https://api.github.com/users/philips/repos","events_url":"https://api.github.com/users/philips/events{/privacy}","received_events_url":"https://api.github.com/users/philips/received_events","type":"User","site_admin":false},"body":"you are going to have to search around for ncat, nc, etc depending on the system :-/\r\n\r\nThe other thing you could do is find fleetctl in the path and impement a nc equivalent.","created_at":"2014-11-23T00:51:45Z","updated_at":"2014-11-23T00:51:45Z","html_url":"https://github.com/coreos/fleet/pull/1039#discussion_r20761135","pull_request_url":"https://api.github.com/repos/coreos/fleet/pulls/1039","_links":{"self":{"href":"https://api.github.com/repos/coreos/fleet/pulls/comments/20761135"},"html":{"href":"https://github.com/coreos/fleet/pull/1039#discussion_r20761135"},"pull_request":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1039"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/fleet/pulls/1039","id":24891400,"html_url":"https://github.com/coreos/fleet/pull/1039","diff_url":"https://github.com/coreos/fleet/pull/1039.diff","patch_url":"https://github.com/coreos/fleet/pull/1039.patch","issue_url":"https://api.github.com/repos/coreos/fleet/issues/1039","number":1039,"state":"open","locked":false,"title":"WIP: establish ncat proxy when SSH-tunneling to unix socket","user":{"login":"bcwaldon","id":548759,"avatar_url":"https://avatars.githubusercontent.com/u/548759?v=3","gravatar_id":"","url":"https://api.github.com/users/bcwaldon","html_url":"https://github.com/bcwaldon","followers_url":"https://api.github.com/users/bcwaldon/followers","following_url":"https://api.github.com/users/bcwaldon/following{/other_user}","gists_url":"https://api.github.com/users/bcwaldon/gists{/gist_id}","starred_url":"https://api.github.com/users/bcwaldon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcwaldon/subscriptions","organizations_url":"https://api.github.com/users/bcwaldon/orgs","repos_url":"https://api.github.com/users/bcwaldon/repos","events_url":"https://api.github.com/users/bcwaldon/events{/privacy}","received_events_url":"https://api.github.com/users/bcwaldon/received_events","type":"User","site_admin":false},"body":"We really don't want to break `fleetctl --tunnel` when we switch the default fleetctl driver to the fleet API. The fleet API is only deployed on /var/run/fleet.sock. This is a problem as the SSH forwarding protocol does not support tunneling over TCP to unix sockets. \r\n\r\nThe approach of this PR is to establish an SSH tunnel to the target machine that hosts an ncat proxy between a TCP port and a unix socket. This allows fleetctl to dial that ncat-hosted TCP socket through a second SSH tunnel. I'm not using socat for this since CoreOS does not have that tool in the base image.\r\n\r\nAssuming this isn't incredibly stupid, the one last piece to cover here is how to pick an ephemeral port on the target machine and communicate that back to fleetctl on the user's machine. Right now it's hard-coded, which I know needs to change before this merges.","created_at":"2014-11-22T18:07:05Z","updated_at":"2014-11-23T00:51:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ece4f19179c8a08f9436a9a7ef40e376a6bafe6f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/fleet/pulls/1039/commits","review_comments_url":"https://api.github.com/repos/coreos/fleet/pulls/1039/comments","review_comment_url":"https://api.github.com/repos/coreos/fleet/pulls/comments/{number}","comments_url":"https://api.github.com/repos/coreos/fleet/issues/1039/comments","statuses_url":"https://api.github.com/repos/coreos/fleet/statuses/7156806db0113d2551d2149e4143a71b0dc37d89","head":{"label":"bcwaldon:ncat","ref":"ncat","sha":"7156806db0113d2551d2149e4143a71b0dc37d89","user":{"login":"bcwaldon","id":548759,"avatar_url":"https://avatars.githubusercontent.com/u/548759?v=3","gravatar_id":"","url":"https://api.github.com/users/bcwaldon","html_url":"https://github.com/bcwaldon","followers_url":"https://api.github.com/users/bcwaldon/followers","following_url":"https://api.github.com/users/bcwaldon/following{/other_user}","gists_url":"https://api.github.com/users/bcwaldon/gists{/gist_id}","starred_url":"https://api.github.com/users/bcwaldon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcwaldon/subscriptions","organizations_url":"https://api.github.com/users/bcwaldon/orgs","repos_url":"https://api.github.com/users/bcwaldon/repos","events_url":"https://api.github.com/users/bcwaldon/events{/privacy}","received_events_url":"https://api.github.com/users/bcwaldon/received_events","type":"User","site_admin":false},"repo":{"id":14316614,"name":"fleet","full_name":"bcwaldon/fleet","owner":{"login":"bcwaldon","id":548759,"avatar_url":"https://avatars.githubusercontent.com/u/548759?v=3","gravatar_id":"","url":"https://api.github.com/users/bcwaldon","html_url":"https://github.com/bcwaldon","followers_url":"https://api.github.com/users/bcwaldon/followers","following_url":"https://api.github.com/users/bcwaldon/following{/other_user}","gists_url":"https://api.github.com/users/bcwaldon/gists{/gist_id}","starred_url":"https://api.github.com/users/bcwaldon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcwaldon/subscriptions","organizations_url":"https://api.github.com/users/bcwaldon/orgs","repos_url":"https://api.github.com/users/bcwaldon/repos","events_url":"https://api.github.com/users/bcwaldon/events{/privacy}","received_events_url":"https://api.github.com/users/bcwaldon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bcwaldon/fleet","description":"","fork":true,"url":"https://api.github.com/repos/bcwaldon/fleet","forks_url":"https://api.github.com/repos/bcwaldon/fleet/forks","keys_url":"https://api.github.com/repos/bcwaldon/fleet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bcwaldon/fleet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bcwaldon/fleet/teams","hooks_url":"https://api.github.com/repos/bcwaldon/fleet/hooks","issue_events_url":"https://api.github.com/repos/bcwaldon/fleet/issues/events{/number}","events_url":"https://api.github.com/repos/bcwaldon/fleet/events","assignees_url":"https://api.github.com/repos/bcwaldon/fleet/assignees{/user}","branches_url":"https://api.github.com/repos/bcwaldon/fleet/branches{/branch}","tags_url":"https://api.github.com/repos/bcwaldon/fleet/tags","blobs_url":"https://api.github.com/repos/bcwaldon/fleet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bcwaldon/fleet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bcwaldon/fleet/git/refs{/sha}","trees_url":"https://api.github.com/repos/bcwaldon/fleet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bcwaldon/fleet/statuses/{sha}","languages_url":"https://api.github.com/repos/bcwaldon/fleet/languages","stargazers_url":"https://api.github.com/repos/bcwaldon/fleet/stargazers","contributors_url":"https://api.github.com/repos/bcwaldon/fleet/contributors","subscribers_url":"https://api.github.com/repos/bcwaldon/fleet/subscribers","subscription_url":"https://api.github.com/repos/bcwaldon/fleet/subscription","commits_url":"https://api.github.com/repos/bcwaldon/fleet/commits{/sha}","git_commits_url":"https://api.github.com/repos/bcwaldon/fleet/git/commits{/sha}","comments_url":"https://api.github.com/repos/bcwaldon/fleet/comments{/number}","issue_comment_url":"https://api.github.com/repos/bcwaldon/fleet/issues/comments/{number}","contents_url":"https://api.github.com/repos/bcwaldon/fleet/contents/{+path}","compare_url":"https://api.github.com/repos/bcwaldon/fleet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bcwaldon/fleet/merges","archive_url":"https://api.github.com/repos/bcwaldon/fleet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bcwaldon/fleet/downloads","issues_url":"https://api.github.com/repos/bcwaldon/fleet/issues{/number}","pulls_url":"https://api.github.com/repos/bcwaldon/fleet/pulls{/number}","milestones_url":"https://api.github.com/repos/bcwaldon/fleet/milestones{/number}","notifications_url":"https://api.github.com/repos/bcwaldon/fleet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bcwaldon/fleet/labels{/name}","releases_url":"https://api.github.com/repos/bcwaldon/fleet/releases{/id}","created_at":"2013-11-11T23:26:02Z","updated_at":"2014-07-25T23:50:43Z","pushed_at":"2014-11-22T18:00:54Z","git_url":"git://github.com/bcwaldon/fleet.git","ssh_url":"git@github.com:bcwaldon/fleet.git","clone_url":"https://github.com/bcwaldon/fleet.git","svn_url":"https://github.com/bcwaldon/fleet","homepage":null,"size":13474,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"coreos:master","ref":"master","sha":"b49c955204c109fe71d7d2ed304599eeac7f2043","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":13512328,"name":"fleet","full_name":"coreos/fleet","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/fleet","description":"A Distributed init System","fork":false,"url":"https://api.github.com/repos/coreos/fleet","forks_url":"https://api.github.com/repos/coreos/fleet/forks","keys_url":"https://api.github.com/repos/coreos/fleet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/fleet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/fleet/teams","hooks_url":"https://api.github.com/repos/coreos/fleet/hooks","issue_events_url":"https://api.github.com/repos/coreos/fleet/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/fleet/events","assignees_url":"https://api.github.com/repos/coreos/fleet/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/fleet/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/fleet/tags","blobs_url":"https://api.github.com/repos/coreos/fleet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/fleet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/fleet/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/fleet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/fleet/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/fleet/languages","stargazers_url":"https://api.github.com/repos/coreos/fleet/stargazers","contributors_url":"https://api.github.com/repos/coreos/fleet/contributors","subscribers_url":"https://api.github.com/repos/coreos/fleet/subscribers","subscription_url":"https://api.github.com/repos/coreos/fleet/subscription","commits_url":"https://api.github.com/repos/coreos/fleet/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/fleet/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/fleet/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/fleet/issues/comments/{number}","contents_url":"https://api.github.com/repos/coreos/fleet/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/fleet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/fleet/merges","archive_url":"https://api.github.com/repos/coreos/fleet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/fleet/downloads","issues_url":"https://api.github.com/repos/coreos/fleet/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/fleet/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/fleet/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/fleet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/fleet/labels{/name}","releases_url":"https://api.github.com/repos/coreos/fleet/releases{/id}","created_at":"2013-10-11T23:56:38Z","updated_at":"2014-11-22T23:49:36Z","pushed_at":"2014-11-21T22:48:33Z","git_url":"git://github.com/coreos/fleet.git","ssh_url":"git@github.com:coreos/fleet.git","clone_url":"https://github.com/coreos/fleet.git","svn_url":"https://github.com/coreos/fleet","homepage":"","size":24515,"stargazers_count":1330,"watchers_count":1330,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":132,"mirror_url":null,"open_issues_count":83,"forks":132,"open_issues":83,"watchers":1330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1039"},"html":{"href":"https://github.com/coreos/fleet/pull/1039"},"issue":{"href":"https://api.github.com/repos/coreos/fleet/issues/1039"},"comments":{"href":"https://api.github.com/repos/coreos/fleet/issues/1039/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1039/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/fleet/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/coreos/fleet/pulls/1039/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/fleet/statuses/7156806db0113d2551d2149e4143a71b0dc37d89"}}}}