{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/gocd/pulls/comments/30870207","id":30870207,"diff_hunk":"@@ -76,7 +76,9 @@ protected void startServer() throws Exception {\n \n     AppServer configureServer() throws Exception {\n         Constructor<?> constructor = Class.forName(systemEnvironment.get(SystemEnvironment.APP_SERVER)).getConstructor(SystemEnvironment.class, String.class, SSLSocketFactory.class);\n-        AppServer server = ((AppServer) constructor.newInstance(systemEnvironment, password, sslSocketFactory));\n+        String value = System.getenv(\"KEYSTORE_PASSWORD\");\n+        String pass = (value != null)?value:password;\n+        AppServer server = ((AppServer) constructor.newInstance(systemEnvironment, pass, sslSocketFactory));","path":"server/src/com/thoughtworks/go/server/GoServer.java","position":7,"original_position":7,"commit_id":"e9bc42a6ea883cefdbb10ebbab1a7546bc3a0e5c","original_commit_id":"e9bc42a6ea883cefdbb10ebbab1a7546bc3a0e5c","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"Thanks a lot for raising this issue.\r\n\r\nWe would be happy to allow users to configure this password. Before we merge this pull request, we'd like to make sure that the code confirms to some of the conventions and guidelines. To that effect, here is some feedback that would ensure that the PR gets merged.\r\n\r\nThe `SystemEnvironment` class is the one true place to configure things and for users to know what can be configured.\r\n\r\nCould you make a change to pull this value from the `systemEnvironment` variable instead, like this.\r\n\r\n``` java\r\nString value = systemEnvironment.keyStorePassword();\r\n```\r\n\r\nfor an implementation of `keyStorePassword()`, checkout this https://github.com/gocd/gocd/blob/e7c3a0ceb8d00eecd99c1927fb8a0a23608583e5/base/src/com/thoughtworks/go/util/SystemEnvironment.java#L521-523\r\n\r\nAnother secondary change that would be great to have.\r\n\r\nAlso since the `AppServer` class is being passed the `SystemEnvironment` instance, it'd be great if we could kill the password parameter to all the constructors in the `AppServer` hierarchy.\r\n\r\n","created_at":"2015-05-22T05:30:18Z","updated_at":"2015-05-22T05:30:18Z","html_url":"https://github.com/gocd/gocd/pull/1143#discussion_r30870207","pull_request_url":"https://api.github.com/repos/gocd/gocd/pulls/1143","_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments/30870207"},"html":{"href":"https://github.com/gocd/gocd/pull/1143#discussion_r30870207"},"pull_request":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1143"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/gocd/pulls/1143","id":35973157,"html_url":"https://github.com/gocd/gocd/pull/1143","diff_url":"https://github.com/gocd/gocd/pull/1143.diff","patch_url":"https://github.com/gocd/gocd/pull/1143.patch","issue_url":"https://api.github.com/repos/gocd/gocd/issues/1143","number":1143,"state":"open","locked":false,"title":"Make Keystore password configurable by ENV","user":{"login":"timepieces141","id":5561047,"avatar_url":"https://avatars.githubusercontent.com/u/5561047?v=3","gravatar_id":"","url":"https://api.github.com/users/timepieces141","html_url":"https://github.com/timepieces141","followers_url":"https://api.github.com/users/timepieces141/followers","following_url":"https://api.github.com/users/timepieces141/following{/other_user}","gists_url":"https://api.github.com/users/timepieces141/gists{/gist_id}","starred_url":"https://api.github.com/users/timepieces141/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timepieces141/subscriptions","organizations_url":"https://api.github.com/users/timepieces141/orgs","repos_url":"https://api.github.com/users/timepieces141/repos","events_url":"https://api.github.com/users/timepieces141/events{/privacy}","received_events_url":"https://api.github.com/users/timepieces141/received_events","type":"User","site_admin":false},"body":"Before creating the AppServer instance, it checks for the environment variable KEYSTORE_PASSWORD. If there is a password found, it uses that, if not (backwards compatible) it uses the hardcoded value stored 'password'. This should allow folks to change the password on the keystore for security sake where needed, just add the environment variable to /etc/default/go-server (or the Windows equivalent) - while maintaining compatibility with those who are fine with the historic hardcoded value.","created_at":"2015-05-21T20:18:53Z","updated_at":"2015-05-22T05:30:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"356fd443adc1cdfe7d7b300f206f2c1c5fa8c73f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gocd/gocd/pulls/1143/commits","review_comments_url":"https://api.github.com/repos/gocd/gocd/pulls/1143/comments","review_comment_url":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/1143/comments","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/e9bc42a6ea883cefdbb10ebbab1a7546bc3a0e5c","head":{"label":"timepieces141:master","ref":"master","sha":"e9bc42a6ea883cefdbb10ebbab1a7546bc3a0e5c","user":{"login":"timepieces141","id":5561047,"avatar_url":"https://avatars.githubusercontent.com/u/5561047?v=3","gravatar_id":"","url":"https://api.github.com/users/timepieces141","html_url":"https://github.com/timepieces141","followers_url":"https://api.github.com/users/timepieces141/followers","following_url":"https://api.github.com/users/timepieces141/following{/other_user}","gists_url":"https://api.github.com/users/timepieces141/gists{/gist_id}","starred_url":"https://api.github.com/users/timepieces141/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timepieces141/subscriptions","organizations_url":"https://api.github.com/users/timepieces141/orgs","repos_url":"https://api.github.com/users/timepieces141/repos","events_url":"https://api.github.com/users/timepieces141/events{/privacy}","received_events_url":"https://api.github.com/users/timepieces141/received_events","type":"User","site_admin":false},"repo":{"id":36032789,"name":"gocd","full_name":"timepieces141/gocd","owner":{"login":"timepieces141","id":5561047,"avatar_url":"https://avatars.githubusercontent.com/u/5561047?v=3","gravatar_id":"","url":"https://api.github.com/users/timepieces141","html_url":"https://github.com/timepieces141","followers_url":"https://api.github.com/users/timepieces141/followers","following_url":"https://api.github.com/users/timepieces141/following{/other_user}","gists_url":"https://api.github.com/users/timepieces141/gists{/gist_id}","starred_url":"https://api.github.com/users/timepieces141/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timepieces141/subscriptions","organizations_url":"https://api.github.com/users/timepieces141/orgs","repos_url":"https://api.github.com/users/timepieces141/repos","events_url":"https://api.github.com/users/timepieces141/events{/privacy}","received_events_url":"https://api.github.com/users/timepieces141/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timepieces141/gocd","description":"Main repository for Go Continuous Delivery","fork":true,"url":"https://api.github.com/repos/timepieces141/gocd","forks_url":"https://api.github.com/repos/timepieces141/gocd/forks","keys_url":"https://api.github.com/repos/timepieces141/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timepieces141/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timepieces141/gocd/teams","hooks_url":"https://api.github.com/repos/timepieces141/gocd/hooks","issue_events_url":"https://api.github.com/repos/timepieces141/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/timepieces141/gocd/events","assignees_url":"https://api.github.com/repos/timepieces141/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/timepieces141/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/timepieces141/gocd/tags","blobs_url":"https://api.github.com/repos/timepieces141/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timepieces141/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timepieces141/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/timepieces141/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timepieces141/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/timepieces141/gocd/languages","stargazers_url":"https://api.github.com/repos/timepieces141/gocd/stargazers","contributors_url":"https://api.github.com/repos/timepieces141/gocd/contributors","subscribers_url":"https://api.github.com/repos/timepieces141/gocd/subscribers","subscription_url":"https://api.github.com/repos/timepieces141/gocd/subscription","commits_url":"https://api.github.com/repos/timepieces141/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/timepieces141/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/timepieces141/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/timepieces141/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/timepieces141/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/timepieces141/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timepieces141/gocd/merges","archive_url":"https://api.github.com/repos/timepieces141/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timepieces141/gocd/downloads","issues_url":"https://api.github.com/repos/timepieces141/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/timepieces141/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/timepieces141/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/timepieces141/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timepieces141/gocd/labels{/name}","releases_url":"https://api.github.com/repos/timepieces141/gocd/releases{/id}","created_at":"2015-05-21T19:21:33Z","updated_at":"2015-05-21T19:21:48Z","pushed_at":"2015-05-21T20:18:34Z","git_url":"git://github.com/timepieces141/gocd.git","ssh_url":"git@github.com:timepieces141/gocd.git","clone_url":"https://github.com/timepieces141/gocd.git","svn_url":"https://github.com/timepieces141/gocd","homepage":null,"size":250826,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gocd:master","ref":"master","sha":"0f3270d599e2c682a7aeae4ace1252642d76945c","user":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":15155534,"name":"gocd","full_name":"gocd/gocd","owner":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocd/gocd","description":"Main repository for Go Continuous Delivery","fork":false,"url":"https://api.github.com/repos/gocd/gocd","forks_url":"https://api.github.com/repos/gocd/gocd/forks","keys_url":"https://api.github.com/repos/gocd/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/gocd/teams","hooks_url":"https://api.github.com/repos/gocd/gocd/hooks","issue_events_url":"https://api.github.com/repos/gocd/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/gocd/events","assignees_url":"https://api.github.com/repos/gocd/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/gocd/tags","blobs_url":"https://api.github.com/repos/gocd/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/gocd/languages","stargazers_url":"https://api.github.com/repos/gocd/gocd/stargazers","contributors_url":"https://api.github.com/repos/gocd/gocd/contributors","subscribers_url":"https://api.github.com/repos/gocd/gocd/subscribers","subscription_url":"https://api.github.com/repos/gocd/gocd/subscription","commits_url":"https://api.github.com/repos/gocd/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/gocd/merges","archive_url":"https://api.github.com/repos/gocd/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/gocd/downloads","issues_url":"https://api.github.com/repos/gocd/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/gocd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/gocd/releases{/id}","created_at":"2013-12-13T05:26:16Z","updated_at":"2015-05-21T16:09:54Z","pushed_at":"2015-05-22T05:04:31Z","git_url":"git://github.com/gocd/gocd.git","ssh_url":"git@github.com:gocd/gocd.git","clone_url":"https://github.com/gocd/gocd.git","svn_url":"https://github.com/gocd/gocd","homepage":null,"size":250826,"stargazers_count":1514,"watchers_count":1514,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":253,"mirror_url":null,"open_issues_count":423,"forks":253,"open_issues":423,"watchers":1514,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1143"},"html":{"href":"https://github.com/gocd/gocd/pull/1143"},"issue":{"href":"https://api.github.com/repos/gocd/gocd/issues/1143"},"comments":{"href":"https://api.github.com/repos/gocd/gocd/issues/1143/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1143/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/gocd/pulls/1143/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/gocd/statuses/e9bc42a6ea883cefdbb10ebbab1a7546bc3a0e5c"}}}}