{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/comments/239640368","pull_request_review_id":182473627,"id":239640368,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTY0MDM2OA==","diff_hunk":"@@ -0,0 +1,454 @@\n+#!/bin/sh\n+\n+ssl_command=\"puppetdb ssl-setup\"\n+\n+#############\n+# FUNCTIONS #\n+#############\n+\n+# Display usage information and exit\n+#\n+# This function simply displays the usage information to the screen and exits\n+# with exit code 0.\n+#\n+# Example:\n+#\n+#   usage\n+#\n+function usage() {\n+  echo \"Usage: ${ssl_command} [-if]\"\n+  echo \"Configuration helper for enabling SSL for PuppetDB.\"\n+  echo\n+  echo \"This tool will attempt to copy the necessary Puppet SSL PEM files into \"\\\n+       \"place for use by the PuppetDB HTTPS service. It also is able to update \"\\\n+       \"the necessary PuppetDB configuration files if necessary to point to \"\\\n+       \"the location of these files and also configures the host and port for \"\\\n+       \"SSL to listen on.\"\n+  echo\n+  echo \"Options:\"\n+  echo \" -i  Interactive mode\"\n+  echo \" -f  Force configuration file update. By default if the configuration \"\\\n+       \"already exists in your jetty.ini or if your configuration is otherwise \"\\\n+       \"in a state we believe we shouldn't touch by default, you must use this \"\\\n+       \"option to override it\"\n+  echo \" -h  Help\"\n+  exit 0\n+}\n+\n+# Backs up a file, if it hasn't already been backed up\n+#\n+# $1 - file to backup\n+#\n+# Example:\n+#\n+#   backupfile \"/etc/myconfig\"\n+#\n+function backupfile() {\n+  # Create the global array if it doesn't already exist\n+  if [ -z $backupfile_list ]; then\n+    # backupfile_list=()\n+    backupfile_list=\"\"","path":"docker/puppetdb/ssl-setup.sh","position":50,"original_position":50,"commit_id":"f456726450cf09f213800500ab4efb62f2d5507e","original_commit_id":"f456726450cf09f213800500ab4efb62f2d5507e","user":{"login":"nwolfe","id":1787615,"node_id":"MDQ6VXNlcjE3ODc2MTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1787615?v=4","gravatar_id":"","url":"https://api.github.com/users/nwolfe","html_url":"https://github.com/nwolfe","followers_url":"https://api.github.com/users/nwolfe/followers","following_url":"https://api.github.com/users/nwolfe/following{/other_user}","gists_url":"https://api.github.com/users/nwolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/nwolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwolfe/subscriptions","organizations_url":"https://api.github.com/users/nwolfe/orgs","repos_url":"https://api.github.com/users/nwolfe/repos","events_url":"https://api.github.com/users/nwolfe/events{/privacy}","received_events_url":"https://api.github.com/users/nwolfe/received_events","type":"User","site_admin":false},"body":"Arrays aren't supported in `sh` but we can simulate them with a space-separated string.\r\n\r\nI had to do this in 5 or 6 places in this script.\r\n\r\nI left the original lines commented out so you can see the diff.","created_at":"2018-12-06T22:34:37Z","updated_at":"2018-12-06T22:45:46Z","html_url":"https://github.com/puppetlabs/puppetdb/pull/2738#discussion_r239640368","pull_request_url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/comments/239640368"},"html":{"href":"https://github.com/puppetlabs/puppetdb/pull/2738#discussion_r239640368"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738","id":236685910,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2Njg1OTEw","html_url":"https://github.com/puppetlabs/puppetdb/pull/2738","diff_url":"https://github.com/puppetlabs/puppetdb/pull/2738.diff","patch_url":"https://github.com/puppetlabs/puppetdb/pull/2738.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues/2738","number":2738,"state":"open","locked":false,"title":"(WIP) PuppetDB alpine image from source","user":{"login":"nwolfe","id":1787615,"node_id":"MDQ6VXNlcjE3ODc2MTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1787615?v=4","gravatar_id":"","url":"https://api.github.com/users/nwolfe","html_url":"https://github.com/nwolfe","followers_url":"https://api.github.com/users/nwolfe/followers","following_url":"https://api.github.com/users/nwolfe/following{/other_user}","gists_url":"https://api.github.com/users/nwolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/nwolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwolfe/subscriptions","organizations_url":"https://api.github.com/users/nwolfe/orgs","repos_url":"https://api.github.com/users/nwolfe/repos","events_url":"https://api.github.com/users/nwolfe/events{/privacy}","received_events_url":"https://api.github.com/users/nwolfe/received_events","type":"User","site_admin":false},"body":"The goal with this work is to reduce the size of the puppetdb image, and secondary is building out new patterns for acquiring SSL certs and running from source.\r\n\r\nThe ssl.sh script used in this is here: https://github.com/puppetlabs/pupperware/pull/33\r\n\r\nThis results in a final puppetdb image size of 116MB, down from the current size of 413MB.\r\n\r\nTo build this image locally, clone the branch and then **from the root of the repo**:\r\n    \r\n    docker build -t puppetdb:alpine -f Dockerfile.slim .\r\n\r\nYou can then try it out in the pupperware stack by cloning the repo, modifying the puppetdb image here https://github.com/puppetlabs/pupperware/blob/master/docker-compose.yml#L39 to be your newly-built `puppetdb:alpine` image and then doing `docker-compose up`.\r\n\r\nSample pupperware stack output:\r\n* Full output: https://gist.github.com/nwolfe/d4ec77618ce9e6672883bce706b56201\r\n* New ssl.sh and ssl-setup.sh script output is this part: https://gist.github.com/nwolfe/d4ec77618ce9e6672883bce706b56201#file-gistfile1-txt-L113-L140","created_at":"2018-12-06T21:56:15Z","updated_at":"2018-12-06T22:45:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e77fa3809d6a43a7fb35884543dcf373155c2b8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues/2738/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppetdb/statuses/f456726450cf09f213800500ab4efb62f2d5507e","head":{"label":"puppetlabs:51x/alpine-image","ref":"51x/alpine-image","sha":"f456726450cf09f213800500ab4efb62f2d5507e","user":{"login":"puppetlabs","id":234268,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDI2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":2193032,"node_id":"MDEwOlJlcG9zaXRvcnkyMTkzMDMy","name":"puppetdb","full_name":"puppetlabs/puppetdb","private":false,"owner":{"login":"puppetlabs","id":234268,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDI2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/puppetlabs/puppetdb","description":"Centralized Puppet Storage","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppetdb","forks_url":"https://api.github.com/repos/puppetlabs/puppetdb/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppetdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppetdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppetdb/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppetdb/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppetdb/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppetdb/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppetdb/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppetdb/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppetdb/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppetdb/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppetdb/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppetdb/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppetdb/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppetdb/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppetdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppetdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppetdb/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppetdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppetdb/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppetdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppetdb/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppetdb/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppetdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppetdb/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppetdb/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/puppetdb/deployments","created_at":"2011-08-11T18:54:46Z","updated_at":"2018-12-06T20:49:14Z","pushed_at":"2018-12-06T22:44:45Z","git_url":"git://github.com/puppetlabs/puppetdb.git","ssh_url":"git@github.com:puppetlabs/puppetdb.git","clone_url":"https://github.com/puppetlabs/puppetdb.git","svn_url":"https://github.com/puppetlabs/puppetdb","homepage":"http://docs.puppetlabs.com/puppetdb","size":19027,"stargazers_count":232,"watchers_count":232,"language":"Clojure","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":196,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":196,"open_issues":24,"watchers":232,"default_branch":"master"}},"base":{"label":"puppetlabs:5.1.x","ref":"5.1.x","sha":"679e78302750774e1c90c7bb22ab281023d8005c","user":{"login":"puppetlabs","id":234268,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDI2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":2193032,"node_id":"MDEwOlJlcG9zaXRvcnkyMTkzMDMy","name":"puppetdb","full_name":"puppetlabs/puppetdb","private":false,"owner":{"login":"puppetlabs","id":234268,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDI2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/puppetlabs/puppetdb","description":"Centralized Puppet Storage","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppetdb","forks_url":"https://api.github.com/repos/puppetlabs/puppetdb/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppetdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppetdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppetdb/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppetdb/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppetdb/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppetdb/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppetdb/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppetdb/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppetdb/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppetdb/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppetdb/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppetdb/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppetdb/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppetdb/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppetdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppetdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppetdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppetdb/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppetdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppetdb/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppetdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppetdb/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppetdb/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppetdb/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppetdb/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppetdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppetdb/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppetdb/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/puppetdb/deployments","created_at":"2011-08-11T18:54:46Z","updated_at":"2018-12-06T20:49:14Z","pushed_at":"2018-12-06T22:44:45Z","git_url":"git://github.com/puppetlabs/puppetdb.git","ssh_url":"git@github.com:puppetlabs/puppetdb.git","clone_url":"https://github.com/puppetlabs/puppetdb.git","svn_url":"https://github.com/puppetlabs/puppetdb","homepage":"http://docs.puppetlabs.com/puppetdb","size":19027,"stargazers_count":232,"watchers_count":232,"language":"Clojure","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":196,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":196,"open_issues":24,"watchers":232,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738"},"html":{"href":"https://github.com/puppetlabs/puppetdb/pull/2738"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/issues/2738"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/issues/2738/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/pulls/2738/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppetdb/statuses/f456726450cf09f213800500ab4efb62f2d5507e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nwolfe"}}