{"action":"created","comment":{"url":"https://api.github.com/repos/lxc/lxd/pulls/comments/73600748","id":73600748,"diff_hunk":"@@ -818,16 +843,23 @@ in theory attack their parent container and gain more privileges than\n they otherwise would.\n \n `)\n-\t\t\tif askBool(\"Would you like to have your containers share their parent's allocation (yes/no)? \") {\n+\t\t\tif askBool(\"Would you like to have your containers share their parent's allocation (yes/no) [default=yes]? \", \"yes\") {\n \t\t\t\tdefaultPrivileged = 1\n \t\t\t} else {\n \t\t\t\tdefaultPrivileged = 0\n \t\t\t}\n \t\t}\n \n-\t\tif askBool(\"Would you like LXD to be available over the network (yes/no)? \") {\n-\t\t\tnetworkAddress = askString(\"Address to bind LXD to (not including port): \")\n-\t\t\tnetworkPort = askInt(\"Port to bind LXD to (8443 recommended): \", 1, 65535)\n+\t\tif askBool(\"Would you like LXD to be available over the network (yes/no) [default=no]? \", \"no\") {\n+\t\t\tisIPAddress := func(s string) string {\n+\t\t\t\tif net.ParseIP(s) == nil {\n+\t\t\t\t\treturn fmt.Sprintf(\"'%s' is not an IP address\", s)\n+\t\t\t\t}\n+\t\t\t\treturn \"\"\n+\t\t\t}","path":"lxd/main.go","position":131,"original_position":131,"commit_id":"0e2bc7a45db13073f855914dd6b0d33f3e3f24e2","original_commit_id":"0e2bc7a45db13073f855914dd6b0d33f3e3f24e2","user":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars.githubusercontent.com/u/2230599?v=3","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"body":"Because of the way ParseIP works, an address like \"[::]\" won't be considered valid, despite this being the needed format when then appending a port to it.\r\n\r\nI'm not against using ParseIP, but we should then check if the provided address is an IPv6 address and if it is, re-format it to be [address] before continuing.","created_at":"2016-08-04T20:54:07Z","updated_at":"2016-08-04T20:54:07Z","html_url":"https://github.com/lxc/lxd/pull/2264#discussion_r73600748","pull_request_url":"https://api.github.com/repos/lxc/lxd/pulls/2264","_links":{"self":{"href":"https://api.github.com/repos/lxc/lxd/pulls/comments/73600748"},"html":{"href":"https://github.com/lxc/lxd/pull/2264#discussion_r73600748"},"pull_request":{"href":"https://api.github.com/repos/lxc/lxd/pulls/2264"}}},"pull_request":{"url":"https://api.github.com/repos/lxc/lxd/pulls/2264","id":80146640,"html_url":"https://github.com/lxc/lxd/pull/2264","diff_url":"https://github.com/lxc/lxd/pull/2264.diff","patch_url":"https://github.com/lxc/lxd/pull/2264.patch","issue_url":"https://api.github.com/repos/lxc/lxd/issues/2264","number":2264,"state":"open","locked":false,"title":"add some reasonable defaults to `lxd init`","user":{"login":"tych0","id":785111,"avatar_url":"https://avatars.githubusercontent.com/u/785111?v=3","gravatar_id":"","url":"https://api.github.com/users/tych0","html_url":"https://github.com/tych0","followers_url":"https://api.github.com/users/tych0/followers","following_url":"https://api.github.com/users/tych0/following{/other_user}","gists_url":"https://api.github.com/users/tych0/gists{/gist_id}","starred_url":"https://api.github.com/users/tych0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tych0/subscriptions","organizations_url":"https://api.github.com/users/tych0/orgs","repos_url":"https://api.github.com/users/tych0/repos","events_url":"https://api.github.com/users/tych0/events{/privacy}","received_events_url":"https://api.github.com/users/tych0/received_events","type":"User","site_admin":false},"body":"This also adds some validation: namely that ip addresses are valid and that\r\nany block device specified as a ZFS pool is indeed an actual block device.\r\n\r\nCloses #1933\r\n\r\nSigned-off-by: Tycho Andersen <tycho.andersen@canonical.com>","created_at":"2016-08-04T20:45:36Z","updated_at":"2016-08-04T20:54:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49571fac4ed931cc59b433f15d663cf7a585ee88","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lxc/lxd/pulls/2264/commits","review_comments_url":"https://api.github.com/repos/lxc/lxd/pulls/2264/comments","review_comment_url":"https://api.github.com/repos/lxc/lxd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/2264/comments","statuses_url":"https://api.github.com/repos/lxc/lxd/statuses/0e2bc7a45db13073f855914dd6b0d33f3e3f24e2","head":{"label":"tych0:add-defaults-lxd-init","ref":"add-defaults-lxd-init","sha":"0e2bc7a45db13073f855914dd6b0d33f3e3f24e2","user":{"login":"tych0","id":785111,"avatar_url":"https://avatars.githubusercontent.com/u/785111?v=3","gravatar_id":"","url":"https://api.github.com/users/tych0","html_url":"https://github.com/tych0","followers_url":"https://api.github.com/users/tych0/followers","following_url":"https://api.github.com/users/tych0/following{/other_user}","gists_url":"https://api.github.com/users/tych0/gists{/gist_id}","starred_url":"https://api.github.com/users/tych0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tych0/subscriptions","organizations_url":"https://api.github.com/users/tych0/orgs","repos_url":"https://api.github.com/users/tych0/repos","events_url":"https://api.github.com/users/tych0/events{/privacy}","received_events_url":"https://api.github.com/users/tych0/received_events","type":"User","site_admin":false},"repo":{"id":26268776,"name":"lxd","full_name":"tych0/lxd","owner":{"login":"tych0","id":785111,"avatar_url":"https://avatars.githubusercontent.com/u/785111?v=3","gravatar_id":"","url":"https://api.github.com/users/tych0","html_url":"https://github.com/tych0","followers_url":"https://api.github.com/users/tych0/followers","following_url":"https://api.github.com/users/tych0/following{/other_user}","gists_url":"https://api.github.com/users/tych0/gists{/gist_id}","starred_url":"https://api.github.com/users/tych0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tych0/subscriptions","organizations_url":"https://api.github.com/users/tych0/orgs","repos_url":"https://api.github.com/users/tych0/repos","events_url":"https://api.github.com/users/tych0/events{/privacy}","received_events_url":"https://api.github.com/users/tych0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tych0/lxd","description":"REST API, command line tool and OpenStack integration plugin for LXC (pronounced lex-dee)","fork":true,"url":"https://api.github.com/repos/tych0/lxd","forks_url":"https://api.github.com/repos/tych0/lxd/forks","keys_url":"https://api.github.com/repos/tych0/lxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tych0/lxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tych0/lxd/teams","hooks_url":"https://api.github.com/repos/tych0/lxd/hooks","issue_events_url":"https://api.github.com/repos/tych0/lxd/issues/events{/number}","events_url":"https://api.github.com/repos/tych0/lxd/events","assignees_url":"https://api.github.com/repos/tych0/lxd/assignees{/user}","branches_url":"https://api.github.com/repos/tych0/lxd/branches{/branch}","tags_url":"https://api.github.com/repos/tych0/lxd/tags","blobs_url":"https://api.github.com/repos/tych0/lxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tych0/lxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tych0/lxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/tych0/lxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tych0/lxd/statuses/{sha}","languages_url":"https://api.github.com/repos/tych0/lxd/languages","stargazers_url":"https://api.github.com/repos/tych0/lxd/stargazers","contributors_url":"https://api.github.com/repos/tych0/lxd/contributors","subscribers_url":"https://api.github.com/repos/tych0/lxd/subscribers","subscription_url":"https://api.github.com/repos/tych0/lxd/subscription","commits_url":"https://api.github.com/repos/tych0/lxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/tych0/lxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/tych0/lxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/tych0/lxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/tych0/lxd/contents/{+path}","compare_url":"https://api.github.com/repos/tych0/lxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tych0/lxd/merges","archive_url":"https://api.github.com/repos/tych0/lxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tych0/lxd/downloads","issues_url":"https://api.github.com/repos/tych0/lxd/issues{/number}","pulls_url":"https://api.github.com/repos/tych0/lxd/pulls{/number}","milestones_url":"https://api.github.com/repos/tych0/lxd/milestones{/number}","notifications_url":"https://api.github.com/repos/tych0/lxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tych0/lxd/labels{/name}","releases_url":"https://api.github.com/repos/tych0/lxd/releases{/id}","deployments_url":"https://api.github.com/repos/tych0/lxd/deployments","created_at":"2014-11-06T12:22:14Z","updated_at":"2015-08-31T09:26:17Z","pushed_at":"2016-08-04T20:45:23Z","git_url":"git://github.com/tych0/lxd.git","ssh_url":"git@github.com:tych0/lxd.git","clone_url":"https://github.com/tych0/lxd.git","svn_url":"https://github.com/tych0/lxd","homepage":null,"size":6718,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lxc:master","ref":"master","sha":"dc945d4cfc2c283acd5e9042f3988b82d045349d","user":{"login":"lxc","id":2301756,"avatar_url":"https://avatars.githubusercontent.com/u/2301756?v=3","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"repo":{"id":26192117,"name":"lxd","full_name":"lxc/lxd","owner":{"login":"lxc","id":2301756,"avatar_url":"https://avatars.githubusercontent.com/u/2301756?v=3","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lxc/lxd","description":"Daemon based on liblxc offering a REST API to manage containers","fork":false,"url":"https://api.github.com/repos/lxc/lxd","forks_url":"https://api.github.com/repos/lxc/lxd/forks","keys_url":"https://api.github.com/repos/lxc/lxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lxc/lxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lxc/lxd/teams","hooks_url":"https://api.github.com/repos/lxc/lxd/hooks","issue_events_url":"https://api.github.com/repos/lxc/lxd/issues/events{/number}","events_url":"https://api.github.com/repos/lxc/lxd/events","assignees_url":"https://api.github.com/repos/lxc/lxd/assignees{/user}","branches_url":"https://api.github.com/repos/lxc/lxd/branches{/branch}","tags_url":"https://api.github.com/repos/lxc/lxd/tags","blobs_url":"https://api.github.com/repos/lxc/lxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lxc/lxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lxc/lxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lxc/lxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lxc/lxd/statuses/{sha}","languages_url":"https://api.github.com/repos/lxc/lxd/languages","stargazers_url":"https://api.github.com/repos/lxc/lxd/stargazers","contributors_url":"https://api.github.com/repos/lxc/lxd/contributors","subscribers_url":"https://api.github.com/repos/lxc/lxd/subscribers","subscription_url":"https://api.github.com/repos/lxc/lxd/subscription","commits_url":"https://api.github.com/repos/lxc/lxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lxc/lxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lxc/lxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lxc/lxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lxc/lxd/contents/{+path}","compare_url":"https://api.github.com/repos/lxc/lxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lxc/lxd/merges","archive_url":"https://api.github.com/repos/lxc/lxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lxc/lxd/downloads","issues_url":"https://api.github.com/repos/lxc/lxd/issues{/number}","pulls_url":"https://api.github.com/repos/lxc/lxd/pulls{/number}","milestones_url":"https://api.github.com/repos/lxc/lxd/milestones{/number}","notifications_url":"https://api.github.com/repos/lxc/lxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lxc/lxd/labels{/name}","releases_url":"https://api.github.com/repos/lxc/lxd/releases{/id}","deployments_url":"https://api.github.com/repos/lxc/lxd/deployments","created_at":"2014-11-04T22:40:52Z","updated_at":"2016-08-02T15:23:46Z","pushed_at":"2016-08-04T20:45:36Z","git_url":"git://github.com/lxc/lxd.git","ssh_url":"git@github.com:lxc/lxd.git","clone_url":"https://github.com/lxc/lxd.git","svn_url":"https://github.com/lxc/lxd","homepage":"https://linuxcontainers.org/lxd","size":9523,"stargazers_count":1056,"watchers_count":1056,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":211,"mirror_url":null,"open_issues_count":84,"forks":211,"open_issues":84,"watchers":1056,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lxc/lxd/pulls/2264"},"html":{"href":"https://github.com/lxc/lxd/pull/2264"},"issue":{"href":"https://api.github.com/repos/lxc/lxd/issues/2264"},"comments":{"href":"https://api.github.com/repos/lxc/lxd/issues/2264/comments"},"review_comments":{"href":"https://api.github.com/repos/lxc/lxd/pulls/2264/comments"},"review_comment":{"href":"https://api.github.com/repos/lxc/lxd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lxc/lxd/pulls/2264/commits"},"statuses":{"href":"https://api.github.com/repos/lxc/lxd/statuses/0e2bc7a45db13073f855914dd6b0d33f3e3f24e2"}}}}
{"actor":{"display_login":"stgraber"}}