{"action":"created","comment":{"url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/comments/85539962","pull_request_review_id":6251713,"id":85539962,"diff_hunk":"@@ -51,6 +53,18 @@ function DataStore(userStore, roomStore) {\n         unique: true,\n         sparse: false\n     }, errLog(\"user id\"));\n+\n+    this._privateKey = null;\n+\n+    if (pkeyPath) {\n+        try {\n+            this._privateKey = fs.readFileSync(pkeyPath, \"utf8\").toString();\n+            log.info(`Private key loaded from ${pkeyPath} - IRC password encryption enabled.`);\n+        }\n+        catch (err) {\n+            log.error('Could not load private key ${err.message}.');","path":"lib/DataStore.js","position":32,"original_position":32,"commit_id":"9ac2b2bd574bb658484f062a5562d2ed4b813410","original_commit_id":"9ac2b2bd574bb658484f062a5562d2ed4b813410","user":{"login":"lukebarnard1","id":6750344,"avatar_url":"https://avatars.githubusercontent.com/u/6750344?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebarnard1","html_url":"https://github.com/lukebarnard1","followers_url":"https://api.github.com/users/lukebarnard1/followers","following_url":"https://api.github.com/users/lukebarnard1/following{/other_user}","gists_url":"https://api.github.com/users/lukebarnard1/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebarnard1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebarnard1/subscriptions","organizations_url":"https://api.github.com/users/lukebarnard1/orgs","repos_url":"https://api.github.com/users/lukebarnard1/repos","events_url":"https://api.github.com/users/lukebarnard1/events{/privacy}","received_events_url":"https://api.github.com/users/lukebarnard1/received_events","type":"User","site_admin":false},"body":"But what if someone wants to use the bridge without bothering with generating a PEM key?","created_at":"2016-10-28T14:24:03Z","updated_at":"2016-10-28T14:24:03Z","html_url":"https://github.com/matrix-org/matrix-appservice-irc/pull/251#discussion_r85539962","pull_request_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251","_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/comments/85539962"},"html":{"href":"https://github.com/matrix-org/matrix-appservice-irc/pull/251#discussion_r85539962"},"pull_request":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251"}}},"pull_request":{"url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251","id":90846179,"html_url":"https://github.com/matrix-org/matrix-appservice-irc/pull/251","diff_url":"https://github.com/matrix-org/matrix-appservice-irc/pull/251.diff","patch_url":"https://github.com/matrix-org/matrix-appservice-irc/pull/251.patch","issue_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/251","number":251,"state":"open","locked":false,"title":"Store passwords in user.db configs","user":{"login":"lukebarnard1","id":6750344,"avatar_url":"https://avatars.githubusercontent.com/u/6750344?v=3","gravatar_id":"","url":"https://api.github.com/users/lukebarnard1","html_url":"https://github.com/lukebarnard1","followers_url":"https://api.github.com/users/lukebarnard1/followers","following_url":"https://api.github.com/users/lukebarnard1/following{/other_user}","gists_url":"https://api.github.com/users/lukebarnard1/gists{/gist_id}","starred_url":"https://api.github.com/users/lukebarnard1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukebarnard1/subscriptions","organizations_url":"https://api.github.com/users/lukebarnard1/orgs","repos_url":"https://api.github.com/users/lukebarnard1/repos","events_url":"https://api.github.com/users/lukebarnard1/events{/privacy}","received_events_url":"https://api.github.com/users/lukebarnard1/received_events","type":"User","site_admin":false},"body":"Send `!storepass server.name password` to have your virtual IRC client's password stored encrypted in the db.\r\n\r\nThe passwords are encrypted and decrypted using a PEM key stored in a file specified in the config file (See passwordEncryptionKeyPath).\r\n\r\nThe passwords are then used in place of the server password set in the config file, whether it is set or not.\r\n\r\nThis has been tested to work whilst bridging with freenode, and as expected, when !nick and !storepass are issued prior to the bridge restarting (or the IRC client reconnecting), NickServ asks for identification (if the nick is registered) but then immediately resolves (having received PASS with the recently decrypted password).","created_at":"2016-10-25T16:42:35Z","updated_at":"2016-10-28T14:24:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7af73924b3d578789ba3f5b1238b1d90f3792884","assignee":{"login":"Kegsay","id":7190048,"avatar_url":"https://avatars.githubusercontent.com/u/7190048?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegsay","html_url":"https://github.com/Kegsay","followers_url":"https://api.github.com/users/Kegsay/followers","following_url":"https://api.github.com/users/Kegsay/following{/other_user}","gists_url":"https://api.github.com/users/Kegsay/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegsay/subscriptions","organizations_url":"https://api.github.com/users/Kegsay/orgs","repos_url":"https://api.github.com/users/Kegsay/repos","events_url":"https://api.github.com/users/Kegsay/events{/privacy}","received_events_url":"https://api.github.com/users/Kegsay/received_events","type":"User","site_admin":false},"assignees":[{"login":"Kegsay","id":7190048,"avatar_url":"https://avatars.githubusercontent.com/u/7190048?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegsay","html_url":"https://github.com/Kegsay","followers_url":"https://api.github.com/users/Kegsay/followers","following_url":"https://api.github.com/users/Kegsay/following{/other_user}","gists_url":"https://api.github.com/users/Kegsay/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegsay/subscriptions","organizations_url":"https://api.github.com/users/Kegsay/orgs","repos_url":"https://api.github.com/users/Kegsay/repos","events_url":"https://api.github.com/users/Kegsay/events{/privacy}","received_events_url":"https://api.github.com/users/Kegsay/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251/commits","review_comments_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251/comments","review_comment_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/251/comments","statuses_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/statuses/9ac2b2bd574bb658484f062a5562d2ed4b813410","head":{"label":"matrix-org:luke/feature-nickserv-password","ref":"luke/feature-nickserv-password","sha":"9ac2b2bd574bb658484f062a5562d2ed4b813410","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":31962644,"name":"matrix-appservice-irc","full_name":"matrix-org/matrix-appservice-irc","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-appservice-irc","description":"Node.js IRC bridge for Matrix","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc","forks_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/deployments","created_at":"2015-03-10T14:42:06Z","updated_at":"2016-10-14T21:06:59Z","pushed_at":"2016-10-28T11:06:57Z","git_url":"git://github.com/matrix-org/matrix-appservice-irc.git","ssh_url":"git@github.com:matrix-org/matrix-appservice-irc.git","clone_url":"https://github.com/matrix-org/matrix-appservice-irc.git","svn_url":"https://github.com/matrix-org/matrix-appservice-irc","homepage":null,"size":1782,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":90,"forks":15,"open_issues":90,"watchers":32,"default_branch":"master"}},"base":{"label":"matrix-org:develop","ref":"develop","sha":"4553f93fe0e4e618b17d26daa4b5dc2216113cff","user":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"repo":{"id":31962644,"name":"matrix-appservice-irc","full_name":"matrix-org/matrix-appservice-irc","owner":{"login":"matrix-org","id":8418310,"avatar_url":"https://avatars.githubusercontent.com/u/8418310?v=3","gravatar_id":"","url":"https://api.github.com/users/matrix-org","html_url":"https://github.com/matrix-org","followers_url":"https://api.github.com/users/matrix-org/followers","following_url":"https://api.github.com/users/matrix-org/following{/other_user}","gists_url":"https://api.github.com/users/matrix-org/gists{/gist_id}","starred_url":"https://api.github.com/users/matrix-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matrix-org/subscriptions","organizations_url":"https://api.github.com/users/matrix-org/orgs","repos_url":"https://api.github.com/users/matrix-org/repos","events_url":"https://api.github.com/users/matrix-org/events{/privacy}","received_events_url":"https://api.github.com/users/matrix-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matrix-org/matrix-appservice-irc","description":"Node.js IRC bridge for Matrix","fork":false,"url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc","forks_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/forks","keys_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/teams","hooks_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/hooks","issue_events_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/events{/number}","events_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/events","assignees_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/assignees{/user}","branches_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/branches{/branch}","tags_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/tags","blobs_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/refs{/sha}","trees_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/statuses/{sha}","languages_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/languages","stargazers_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/stargazers","contributors_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/contributors","subscribers_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/subscribers","subscription_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/subscription","commits_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/commits{/sha}","git_commits_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/git/commits{/sha}","comments_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/comments{/number}","issue_comment_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/comments{/number}","contents_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/contents/{+path}","compare_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/merges","archive_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/downloads","issues_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues{/number}","pulls_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls{/number}","milestones_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/milestones{/number}","notifications_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/labels{/name}","releases_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/releases{/id}","deployments_url":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/deployments","created_at":"2015-03-10T14:42:06Z","updated_at":"2016-10-14T21:06:59Z","pushed_at":"2016-10-28T11:06:57Z","git_url":"git://github.com/matrix-org/matrix-appservice-irc.git","ssh_url":"git@github.com:matrix-org/matrix-appservice-irc.git","clone_url":"https://github.com/matrix-org/matrix-appservice-irc.git","svn_url":"https://github.com/matrix-org/matrix-appservice-irc","homepage":null,"size":1782,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":90,"forks":15,"open_issues":90,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251"},"html":{"href":"https://github.com/matrix-org/matrix-appservice-irc/pull/251"},"issue":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/251"},"comments":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/issues/251/comments"},"review_comments":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251/comments"},"review_comment":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/pulls/251/commits"},"statuses":{"href":"https://api.github.com/repos/matrix-org/matrix-appservice-irc/statuses/9ac2b2bd574bb658484f062a5562d2ed4b813410"}}}}
{"actor":{"display_login":"lukebarnard1"}}