{"action":"created","comment":{"url":"https://api.github.com/repos/progrium/dokku/pulls/comments/38721292","id":38721292,"diff_hunk":"@@ -0,0 +1,174 @@\n+#!/usr/bin/env bash\n+set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x\n+source \"$(dirname $0)/../common/functions\"\n+source \"$(dirname $0)/functions\"\n+\n+is_tar_import() {\n+  [[ -t 0 ]] && return 1\n+  return 0\n+}\n+\n+is_file_import() {\n+  local CRT_FILE=\"$3\"\n+  local KEY_FILE=\"$4\"\n+\n+  if [[ -f $CRT_FILE ]] && [[ -f $KEY_FILE]]; then","path":"plugins/certs/commands","position":15,"original_position":15,"commit_id":"adfc3a8101cf362a59c4d3565539a44ec00d9d42","original_commit_id":"adfc3a8101cf362a59c4d3565539a44ec00d9d42","user":{"login":"michaelshobbs","id":4491438,"avatar_url":"https://avatars.githubusercontent.com/u/4491438?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelshobbs","html_url":"https://github.com/michaelshobbs","followers_url":"https://api.github.com/users/michaelshobbs/followers","following_url":"https://api.github.com/users/michaelshobbs/following{/other_user}","gists_url":"https://api.github.com/users/michaelshobbs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelshobbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelshobbs/subscriptions","organizations_url":"https://api.github.com/users/michaelshobbs/orgs","repos_url":"https://api.github.com/users/michaelshobbs/repos","events_url":"https://api.github.com/users/michaelshobbs/events{/privacy}","received_events_url":"https://api.github.com/users/michaelshobbs/received_events","type":"User","site_admin":false},"body":"you'll want a space here between `$KEY_FILE` and `]]` :smile: ","created_at":"2015-09-04T04:41:03Z","updated_at":"2015-09-04T04:41:03Z","html_url":"https://github.com/progrium/dokku/pull/1414#discussion_r38721292","pull_request_url":"https://api.github.com/repos/progrium/dokku/pulls/1414","_links":{"self":{"href":"https://api.github.com/repos/progrium/dokku/pulls/comments/38721292"},"html":{"href":"https://github.com/progrium/dokku/pull/1414#discussion_r38721292"},"pull_request":{"href":"https://api.github.com/repos/progrium/dokku/pulls/1414"}}},"pull_request":{"url":"https://api.github.com/repos/progrium/dokku/pulls/1414","id":43222873,"html_url":"https://github.com/progrium/dokku/pull/1414","diff_url":"https://github.com/progrium/dokku/pull/1414.diff","patch_url":"https://github.com/progrium/dokku/pull/1414.patch","issue_url":"https://api.github.com/repos/progrium/dokku/issues/1414","number":1414,"state":"open","locked":false,"title":"certs plugin","user":{"login":"michaelshobbs","id":4491438,"avatar_url":"https://avatars.githubusercontent.com/u/4491438?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelshobbs","html_url":"https://github.com/michaelshobbs","followers_url":"https://api.github.com/users/michaelshobbs/followers","following_url":"https://api.github.com/users/michaelshobbs/following{/other_user}","gists_url":"https://api.github.com/users/michaelshobbs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelshobbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelshobbs/subscriptions","organizations_url":"https://api.github.com/users/michaelshobbs/orgs","repos_url":"https://api.github.com/users/michaelshobbs/repos","events_url":"https://api.github.com/users/michaelshobbs/events{/privacy}","received_events_url":"https://api.github.com/users/michaelshobbs/received_events","type":"User","site_admin":false},"body":"TODOS:\r\n- [x] remove 'magically' added VHOST entries based on SSL cert information\r\n- [x] implement `certs` plugin 'loosely' based on https://devcenter.heroku.com/articles/ssl-endpoint \r\n  - only implements `certs:remove`, `certs:info` and `certs:generate` (if someone wants to take a stab at the others, please feel free)\r\n- [x] document `certs` plugin\r\n- [x] document private/shared functions convention for plugins\r\n\r\nNote:\r\n- further implements cross-plugin function sharing. as a convention, we've seem to have settled on shareable functions residing in `<plugin_path>/functions` and non-shareable functions residing in `<plugin_path>/commands` (example [here](https://github.com/progrium/dokku/blob/5676dbc4c6bea9837e36aded1897221bcf4cdee6/plugins/nginx-vhosts/commands#L5-L26))\r\n\r\ncloses #1368 \r\n\r\nexample `certs:info` output\r\n```\r\nroot@dokku:~/dokku# dokku certs:info node-js-app\r\n-----> Fetching SSL Endpoint info for node-js-app...\r\n-----> Certificate details:\r\n=====> Common Name(s):\r\n=====>    test.dokku.me\r\n=====>    www.test.dokku.me\r\n=====>    www.test.app.dokku.me\r\n=====> Expires At: Jan 14 17:57:12 2017 GMT\r\n=====> Issuer: C=US, ST=California, L=San Francisco, OU=Dokku Me, LLC, CN=test.dokku.me\r\n=====> Starts At: Jan 15 17:57:12 2015 GMT\r\n=====> Subject: C=US; ST=California; L=San Francisco; OU=Dokku Me, LLC; CN=test.dokku.me\r\n=====> SSL certificate is self signed.\r\n```","created_at":"2015-08-24T21:16:44Z","updated_at":"2015-09-04T04:41:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5288321d3f2d2c539a739b49d0dc26feb573a48c","assignee":{"login":"michaelshobbs","id":4491438,"avatar_url":"https://avatars.githubusercontent.com/u/4491438?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelshobbs","html_url":"https://github.com/michaelshobbs","followers_url":"https://api.github.com/users/michaelshobbs/followers","following_url":"https://api.github.com/users/michaelshobbs/following{/other_user}","gists_url":"https://api.github.com/users/michaelshobbs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelshobbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelshobbs/subscriptions","organizations_url":"https://api.github.com/users/michaelshobbs/orgs","repos_url":"https://api.github.com/users/michaelshobbs/repos","events_url":"https://api.github.com/users/michaelshobbs/events{/privacy}","received_events_url":"https://api.github.com/users/michaelshobbs/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/progrium/dokku/pulls/1414/commits","review_comments_url":"https://api.github.com/repos/progrium/dokku/pulls/1414/comments","review_comment_url":"https://api.github.com/repos/progrium/dokku/pulls/comments{/number}","comments_url":"https://api.github.com/repos/progrium/dokku/issues/1414/comments","statuses_url":"https://api.github.com/repos/progrium/dokku/statuses/adfc3a8101cf362a59c4d3565539a44ec00d9d42","head":{"label":"progrium:1368_mh-certs-plugin","ref":"1368_mh-certs-plugin","sha":"adfc3a8101cf362a59c4d3565539a44ec00d9d42","user":{"login":"progrium","id":647,"avatar_url":"https://avatars.githubusercontent.com/u/647?v=3","gravatar_id":"","url":"https://api.github.com/users/progrium","html_url":"https://github.com/progrium","followers_url":"https://api.github.com/users/progrium/followers","following_url":"https://api.github.com/users/progrium/following{/other_user}","gists_url":"https://api.github.com/users/progrium/gists{/gist_id}","starred_url":"https://api.github.com/users/progrium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progrium/subscriptions","organizations_url":"https://api.github.com/users/progrium/orgs","repos_url":"https://api.github.com/users/progrium/repos","events_url":"https://api.github.com/users/progrium/events{/privacy}","received_events_url":"https://api.github.com/users/progrium/received_events","type":"User","site_admin":false},"repo":{"id":10567197,"name":"dokku","full_name":"progrium/dokku","owner":{"login":"progrium","id":647,"avatar_url":"https://avatars.githubusercontent.com/u/647?v=3","gravatar_id":"","url":"https://api.github.com/users/progrium","html_url":"https://github.com/progrium","followers_url":"https://api.github.com/users/progrium/followers","following_url":"https://api.github.com/users/progrium/following{/other_user}","gists_url":"https://api.github.com/users/progrium/gists{/gist_id}","starred_url":"https://api.github.com/users/progrium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progrium/subscriptions","organizations_url":"https://api.github.com/users/progrium/orgs","repos_url":"https://api.github.com/users/progrium/repos","events_url":"https://api.github.com/users/progrium/events{/privacy}","received_events_url":"https://api.github.com/users/progrium/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/progrium/dokku","description":"Docker powered mini-Heroku in around 100 lines of Bash","fork":false,"url":"https://api.github.com/repos/progrium/dokku","forks_url":"https://api.github.com/repos/progrium/dokku/forks","keys_url":"https://api.github.com/repos/progrium/dokku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/progrium/dokku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/progrium/dokku/teams","hooks_url":"https://api.github.com/repos/progrium/dokku/hooks","issue_events_url":"https://api.github.com/repos/progrium/dokku/issues/events{/number}","events_url":"https://api.github.com/repos/progrium/dokku/events","assignees_url":"https://api.github.com/repos/progrium/dokku/assignees{/user}","branches_url":"https://api.github.com/repos/progrium/dokku/branches{/branch}","tags_url":"https://api.github.com/repos/progrium/dokku/tags","blobs_url":"https://api.github.com/repos/progrium/dokku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/progrium/dokku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/progrium/dokku/git/refs{/sha}","trees_url":"https://api.github.com/repos/progrium/dokku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/progrium/dokku/statuses/{sha}","languages_url":"https://api.github.com/repos/progrium/dokku/languages","stargazers_url":"https://api.github.com/repos/progrium/dokku/stargazers","contributors_url":"https://api.github.com/repos/progrium/dokku/contributors","subscribers_url":"https://api.github.com/repos/progrium/dokku/subscribers","subscription_url":"https://api.github.com/repos/progrium/dokku/subscription","commits_url":"https://api.github.com/repos/progrium/dokku/commits{/sha}","git_commits_url":"https://api.github.com/repos/progrium/dokku/git/commits{/sha}","comments_url":"https://api.github.com/repos/progrium/dokku/comments{/number}","issue_comment_url":"https://api.github.com/repos/progrium/dokku/issues/comments{/number}","contents_url":"https://api.github.com/repos/progrium/dokku/contents/{+path}","compare_url":"https://api.github.com/repos/progrium/dokku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/progrium/dokku/merges","archive_url":"https://api.github.com/repos/progrium/dokku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/progrium/dokku/downloads","issues_url":"https://api.github.com/repos/progrium/dokku/issues{/number}","pulls_url":"https://api.github.com/repos/progrium/dokku/pulls{/number}","milestones_url":"https://api.github.com/repos/progrium/dokku/milestones{/number}","notifications_url":"https://api.github.com/repos/progrium/dokku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/progrium/dokku/labels{/name}","releases_url":"https://api.github.com/repos/progrium/dokku/releases{/id}","created_at":"2013-06-08T10:26:57Z","updated_at":"2015-09-04T03:43:24Z","pushed_at":"2015-09-04T04:18:47Z","git_url":"git://github.com/progrium/dokku.git","ssh_url":"git@github.com:progrium/dokku.git","clone_url":"https://github.com/progrium/dokku.git","svn_url":"https://github.com/progrium/dokku","homepage":"http://progrium.viewdocs.io/dokku","size":7575,"stargazers_count":9928,"watchers_count":9928,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":824,"mirror_url":null,"open_issues_count":31,"forks":824,"open_issues":31,"watchers":9928,"default_branch":"master"}},"base":{"label":"progrium:master","ref":"master","sha":"0904c3d4585db2e3923ebed9402cdb5fe5475ef3","user":{"login":"progrium","id":647,"avatar_url":"https://avatars.githubusercontent.com/u/647?v=3","gravatar_id":"","url":"https://api.github.com/users/progrium","html_url":"https://github.com/progrium","followers_url":"https://api.github.com/users/progrium/followers","following_url":"https://api.github.com/users/progrium/following{/other_user}","gists_url":"https://api.github.com/users/progrium/gists{/gist_id}","starred_url":"https://api.github.com/users/progrium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progrium/subscriptions","organizations_url":"https://api.github.com/users/progrium/orgs","repos_url":"https://api.github.com/users/progrium/repos","events_url":"https://api.github.com/users/progrium/events{/privacy}","received_events_url":"https://api.github.com/users/progrium/received_events","type":"User","site_admin":false},"repo":{"id":10567197,"name":"dokku","full_name":"progrium/dokku","owner":{"login":"progrium","id":647,"avatar_url":"https://avatars.githubusercontent.com/u/647?v=3","gravatar_id":"","url":"https://api.github.com/users/progrium","html_url":"https://github.com/progrium","followers_url":"https://api.github.com/users/progrium/followers","following_url":"https://api.github.com/users/progrium/following{/other_user}","gists_url":"https://api.github.com/users/progrium/gists{/gist_id}","starred_url":"https://api.github.com/users/progrium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progrium/subscriptions","organizations_url":"https://api.github.com/users/progrium/orgs","repos_url":"https://api.github.com/users/progrium/repos","events_url":"https://api.github.com/users/progrium/events{/privacy}","received_events_url":"https://api.github.com/users/progrium/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/progrium/dokku","description":"Docker powered mini-Heroku in around 100 lines of Bash","fork":false,"url":"https://api.github.com/repos/progrium/dokku","forks_url":"https://api.github.com/repos/progrium/dokku/forks","keys_url":"https://api.github.com/repos/progrium/dokku/keys{/key_id}","collaborators_url":"https://api.github.com/repos/progrium/dokku/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/progrium/dokku/teams","hooks_url":"https://api.github.com/repos/progrium/dokku/hooks","issue_events_url":"https://api.github.com/repos/progrium/dokku/issues/events{/number}","events_url":"https://api.github.com/repos/progrium/dokku/events","assignees_url":"https://api.github.com/repos/progrium/dokku/assignees{/user}","branches_url":"https://api.github.com/repos/progrium/dokku/branches{/branch}","tags_url":"https://api.github.com/repos/progrium/dokku/tags","blobs_url":"https://api.github.com/repos/progrium/dokku/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/progrium/dokku/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/progrium/dokku/git/refs{/sha}","trees_url":"https://api.github.com/repos/progrium/dokku/git/trees{/sha}","statuses_url":"https://api.github.com/repos/progrium/dokku/statuses/{sha}","languages_url":"https://api.github.com/repos/progrium/dokku/languages","stargazers_url":"https://api.github.com/repos/progrium/dokku/stargazers","contributors_url":"https://api.github.com/repos/progrium/dokku/contributors","subscribers_url":"https://api.github.com/repos/progrium/dokku/subscribers","subscription_url":"https://api.github.com/repos/progrium/dokku/subscription","commits_url":"https://api.github.com/repos/progrium/dokku/commits{/sha}","git_commits_url":"https://api.github.com/repos/progrium/dokku/git/commits{/sha}","comments_url":"https://api.github.com/repos/progrium/dokku/comments{/number}","issue_comment_url":"https://api.github.com/repos/progrium/dokku/issues/comments{/number}","contents_url":"https://api.github.com/repos/progrium/dokku/contents/{+path}","compare_url":"https://api.github.com/repos/progrium/dokku/compare/{base}...{head}","merges_url":"https://api.github.com/repos/progrium/dokku/merges","archive_url":"https://api.github.com/repos/progrium/dokku/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/progrium/dokku/downloads","issues_url":"https://api.github.com/repos/progrium/dokku/issues{/number}","pulls_url":"https://api.github.com/repos/progrium/dokku/pulls{/number}","milestones_url":"https://api.github.com/repos/progrium/dokku/milestones{/number}","notifications_url":"https://api.github.com/repos/progrium/dokku/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/progrium/dokku/labels{/name}","releases_url":"https://api.github.com/repos/progrium/dokku/releases{/id}","created_at":"2013-06-08T10:26:57Z","updated_at":"2015-09-04T03:43:24Z","pushed_at":"2015-09-04T04:18:47Z","git_url":"git://github.com/progrium/dokku.git","ssh_url":"git@github.com:progrium/dokku.git","clone_url":"https://github.com/progrium/dokku.git","svn_url":"https://github.com/progrium/dokku","homepage":"http://progrium.viewdocs.io/dokku","size":7575,"stargazers_count":9928,"watchers_count":9928,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":824,"mirror_url":null,"open_issues_count":31,"forks":824,"open_issues":31,"watchers":9928,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/progrium/dokku/pulls/1414"},"html":{"href":"https://github.com/progrium/dokku/pull/1414"},"issue":{"href":"https://api.github.com/repos/progrium/dokku/issues/1414"},"comments":{"href":"https://api.github.com/repos/progrium/dokku/issues/1414/comments"},"review_comments":{"href":"https://api.github.com/repos/progrium/dokku/pulls/1414/comments"},"review_comment":{"href":"https://api.github.com/repos/progrium/dokku/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/progrium/dokku/pulls/1414/commits"},"statuses":{"href":"https://api.github.com/repos/progrium/dokku/statuses/adfc3a8101cf362a59c4d3565539a44ec00d9d42"}}}}