{"action":"created","comment":{"url":"https://api.github.com/repos/vimc/bb8/pulls/comments/179750099","pull_request_review_id":110054001,"id":179750099,"diff_hunk":"@@ -1,36 +1,30 @@\n #!/usr/bin/env bash\n set -e\n \n-HERE=${BASH_SOURCE%/*}\n-source ${HERE}/vault_auth.sh\n-\n-echo \"Installing Pip and required Python packages\"\n-apt-get install python3-pip -y > /dev/null\n-pip3 install -q -r ${HERE}/requirements.txt\n-\n-echo \"-------------------------------------------\"\n-echo \"Installing bb8 user and group\"\n-\n-if ! id -u bb8 > /dev/null 2>&1; then\n-    useradd bb8 -U -d /var/lib/bb8\n-    password=$(vault read --field password secret/backup/bb8/user)\n-    echo \"bb8:$password\" | chpasswd\n-\n-    mkdir -p /var/lib/bb8/.ssh\n-    \n-    # add to docker group\n-    usermod -aG docker bb8\n+if [[ ($# -eq 0) ]]; then\n+    echo \"Usage: ./setup.sh PATH_TO_SOURCE_CONFIG [TARGET ...]\"\n+    exit -1;\n fi\n \n-# give bb8 group ownership of this dir\n-chgrp -R bb8 $HERE\n-chmod -R g+w $HERE\n+source_config_path=$1\n+shift && targets=\"$@\"   # Targets is all the args after the first\n+\n+# Get secrets and put them in secrets/\n+# (where the Dockerfile looks for them)\n+HERE=${BASH_SOURCE%/*}\n+source ${HERE}/vault_auth.sh\n+./obtain_secrets.py","path":"setup.sh","position":null,"original_position":38,"commit_id":"ff8a1bc551030ea10035508b7e286350f5eb80db","original_commit_id":"99e1195f395076ec5c8c08aabea0ab77746b11f6","user":{"login":"MartinEden","id":1148055,"avatar_url":"https://avatars3.githubusercontent.com/u/1148055?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinEden","html_url":"https://github.com/MartinEden","followers_url":"https://api.github.com/users/MartinEden/followers","following_url":"https://api.github.com/users/MartinEden/following{/other_user}","gists_url":"https://api.github.com/users/MartinEden/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinEden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinEden/subscriptions","organizations_url":"https://api.github.com/users/MartinEden/orgs","repos_url":"https://api.github.com/users/MartinEden/repos","events_url":"https://api.github.com/users/MartinEden/events{/privacy}","received_events_url":"https://api.github.com/users/MartinEden/received_events","type":"User","site_admin":false},"body":"It was missing, I've added it to `setup.sh` now","created_at":"2018-04-06T13:02:45Z","updated_at":"2018-04-06T13:02:45Z","html_url":"https://github.com/vimc/bb8/pull/13#discussion_r179750099","pull_request_url":"https://api.github.com/repos/vimc/bb8/pulls/13","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/vimc/bb8/pulls/comments/179750099"},"html":{"href":"https://github.com/vimc/bb8/pull/13#discussion_r179750099"},"pull_request":{"href":"https://api.github.com/repos/vimc/bb8/pulls/13"}},"in_reply_to_id":175072273},"pull_request":{"url":"https://api.github.com/repos/vimc/bb8/pulls/13","id":174040979,"html_url":"https://github.com/vimc/bb8/pull/13","diff_url":"https://github.com/vimc/bb8/pull/13.diff","patch_url":"https://github.com/vimc/bb8/pull/13.patch","issue_url":"https://api.github.com/repos/vimc/bb8/issues/13","number":13,"state":"open","locked":false,"title":"i1584: Backup and restore using Docker","user":{"login":"MartinEden","id":1148055,"avatar_url":"https://avatars3.githubusercontent.com/u/1148055?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinEden","html_url":"https://github.com/MartinEden","followers_url":"https://api.github.com/users/MartinEden/followers","following_url":"https://api.github.com/users/MartinEden/following{/other_user}","gists_url":"https://api.github.com/users/MartinEden/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinEden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinEden/subscriptions","organizations_url":"https://api.github.com/users/MartinEden/orgs","repos_url":"https://api.github.com/users/MartinEden/repos","events_url":"https://api.github.com/users/MartinEden/events{/privacy}","received_events_url":"https://api.github.com/users/MartinEden/received_events","type":"User","site_admin":false},"body":"This PR doesn't do scheduling yet - which means that scheduling is broken on this branch - but the PR was already getting quite long.\r\n\r\nWe now have `setup.sh`, which builds a Docker image with the secrets and the chosen config inside it. This has an entry point, main.py, which either backs up or restores depending on what args you give it.\r\n\r\nYou can then run the built image with `./bb8`, which passes args through to `main.py`.\r\n\r\n","created_at":"2018-03-09T15:58:14Z","updated_at":"2018-04-06T13:02:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66a5fe9182a2a0b5d9b7d010a86ddc4ab27ef663","assignee":{"login":"MartinEden","id":1148055,"avatar_url":"https://avatars3.githubusercontent.com/u/1148055?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinEden","html_url":"https://github.com/MartinEden","followers_url":"https://api.github.com/users/MartinEden/followers","following_url":"https://api.github.com/users/MartinEden/following{/other_user}","gists_url":"https://api.github.com/users/MartinEden/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinEden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinEden/subscriptions","organizations_url":"https://api.github.com/users/MartinEden/orgs","repos_url":"https://api.github.com/users/MartinEden/repos","events_url":"https://api.github.com/users/MartinEden/events{/privacy}","received_events_url":"https://api.github.com/users/MartinEden/received_events","type":"User","site_admin":false},"assignees":[{"login":"MartinEden","id":1148055,"avatar_url":"https://avatars3.githubusercontent.com/u/1148055?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinEden","html_url":"https://github.com/MartinEden","followers_url":"https://api.github.com/users/MartinEden/followers","following_url":"https://api.github.com/users/MartinEden/following{/other_user}","gists_url":"https://api.github.com/users/MartinEden/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinEden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinEden/subscriptions","organizations_url":"https://api.github.com/users/MartinEden/orgs","repos_url":"https://api.github.com/users/MartinEden/repos","events_url":"https://api.github.com/users/MartinEden/events{/privacy}","received_events_url":"https://api.github.com/users/MartinEden/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vimc/bb8/pulls/13/commits","review_comments_url":"https://api.github.com/repos/vimc/bb8/pulls/13/comments","review_comment_url":"https://api.github.com/repos/vimc/bb8/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vimc/bb8/issues/13/comments","statuses_url":"https://api.github.com/repos/vimc/bb8/statuses/ff8a1bc551030ea10035508b7e286350f5eb80db","head":{"label":"vimc:i1584","ref":"i1584","sha":"ff8a1bc551030ea10035508b7e286350f5eb80db","user":{"login":"vimc","id":26278316,"avatar_url":"https://avatars1.githubusercontent.com/u/26278316?v=4","gravatar_id":"","url":"https://api.github.com/users/vimc","html_url":"https://github.com/vimc","followers_url":"https://api.github.com/users/vimc/followers","following_url":"https://api.github.com/users/vimc/following{/other_user}","gists_url":"https://api.github.com/users/vimc/gists{/gist_id}","starred_url":"https://api.github.com/users/vimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimc/subscriptions","organizations_url":"https://api.github.com/users/vimc/orgs","repos_url":"https://api.github.com/users/vimc/repos","events_url":"https://api.github.com/users/vimc/events{/privacy}","received_events_url":"https://api.github.com/users/vimc/received_events","type":"Organization","site_admin":false},"repo":{"id":118003111,"name":"bb8","full_name":"vimc/bb8","owner":{"login":"vimc","id":26278316,"avatar_url":"https://avatars1.githubusercontent.com/u/26278316?v=4","gravatar_id":"","url":"https://api.github.com/users/vimc","html_url":"https://github.com/vimc","followers_url":"https://api.github.com/users/vimc/followers","following_url":"https://api.github.com/users/vimc/following{/other_user}","gists_url":"https://api.github.com/users/vimc/gists{/gist_id}","starred_url":"https://api.github.com/users/vimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimc/subscriptions","organizations_url":"https://api.github.com/users/vimc/orgs","repos_url":"https://api.github.com/users/vimc/repos","events_url":"https://api.github.com/users/vimc/events{/privacy}","received_events_url":"https://api.github.com/users/vimc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vimc/bb8","description":"Backs up files from one local server to another","fork":false,"url":"https://api.github.com/repos/vimc/bb8","forks_url":"https://api.github.com/repos/vimc/bb8/forks","keys_url":"https://api.github.com/repos/vimc/bb8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vimc/bb8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vimc/bb8/teams","hooks_url":"https://api.github.com/repos/vimc/bb8/hooks","issue_events_url":"https://api.github.com/repos/vimc/bb8/issues/events{/number}","events_url":"https://api.github.com/repos/vimc/bb8/events","assignees_url":"https://api.github.com/repos/vimc/bb8/assignees{/user}","branches_url":"https://api.github.com/repos/vimc/bb8/branches{/branch}","tags_url":"https://api.github.com/repos/vimc/bb8/tags","blobs_url":"https://api.github.com/repos/vimc/bb8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vimc/bb8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vimc/bb8/git/refs{/sha}","trees_url":"https://api.github.com/repos/vimc/bb8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vimc/bb8/statuses/{sha}","languages_url":"https://api.github.com/repos/vimc/bb8/languages","stargazers_url":"https://api.github.com/repos/vimc/bb8/stargazers","contributors_url":"https://api.github.com/repos/vimc/bb8/contributors","subscribers_url":"https://api.github.com/repos/vimc/bb8/subscribers","subscription_url":"https://api.github.com/repos/vimc/bb8/subscription","commits_url":"https://api.github.com/repos/vimc/bb8/commits{/sha}","git_commits_url":"https://api.github.com/repos/vimc/bb8/git/commits{/sha}","comments_url":"https://api.github.com/repos/vimc/bb8/comments{/number}","issue_comment_url":"https://api.github.com/repos/vimc/bb8/issues/comments{/number}","contents_url":"https://api.github.com/repos/vimc/bb8/contents/{+path}","compare_url":"https://api.github.com/repos/vimc/bb8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vimc/bb8/merges","archive_url":"https://api.github.com/repos/vimc/bb8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vimc/bb8/downloads","issues_url":"https://api.github.com/repos/vimc/bb8/issues{/number}","pulls_url":"https://api.github.com/repos/vimc/bb8/pulls{/number}","milestones_url":"https://api.github.com/repos/vimc/bb8/milestones{/number}","notifications_url":"https://api.github.com/repos/vimc/bb8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vimc/bb8/labels{/name}","releases_url":"https://api.github.com/repos/vimc/bb8/releases{/id}","deployments_url":"https://api.github.com/repos/vimc/bb8/deployments","created_at":"2018-01-18T15:46:17Z","updated_at":"2018-03-16T16:57:09Z","pushed_at":"2018-04-06T12:50:18Z","git_url":"git://github.com/vimc/bb8.git","ssh_url":"git@github.com:vimc/bb8.git","clone_url":"https://github.com/vimc/bb8.git","svn_url":"https://github.com/vimc/bb8","homepage":null,"size":122,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"vimc:master","ref":"master","sha":"1cd31e007db6979378091648c7723de5bb8221fa","user":{"login":"vimc","id":26278316,"avatar_url":"https://avatars1.githubusercontent.com/u/26278316?v=4","gravatar_id":"","url":"https://api.github.com/users/vimc","html_url":"https://github.com/vimc","followers_url":"https://api.github.com/users/vimc/followers","following_url":"https://api.github.com/users/vimc/following{/other_user}","gists_url":"https://api.github.com/users/vimc/gists{/gist_id}","starred_url":"https://api.github.com/users/vimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimc/subscriptions","organizations_url":"https://api.github.com/users/vimc/orgs","repos_url":"https://api.github.com/users/vimc/repos","events_url":"https://api.github.com/users/vimc/events{/privacy}","received_events_url":"https://api.github.com/users/vimc/received_events","type":"Organization","site_admin":false},"repo":{"id":118003111,"name":"bb8","full_name":"vimc/bb8","owner":{"login":"vimc","id":26278316,"avatar_url":"https://avatars1.githubusercontent.com/u/26278316?v=4","gravatar_id":"","url":"https://api.github.com/users/vimc","html_url":"https://github.com/vimc","followers_url":"https://api.github.com/users/vimc/followers","following_url":"https://api.github.com/users/vimc/following{/other_user}","gists_url":"https://api.github.com/users/vimc/gists{/gist_id}","starred_url":"https://api.github.com/users/vimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vimc/subscriptions","organizations_url":"https://api.github.com/users/vimc/orgs","repos_url":"https://api.github.com/users/vimc/repos","events_url":"https://api.github.com/users/vimc/events{/privacy}","received_events_url":"https://api.github.com/users/vimc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vimc/bb8","description":"Backs up files from one local server to another","fork":false,"url":"https://api.github.com/repos/vimc/bb8","forks_url":"https://api.github.com/repos/vimc/bb8/forks","keys_url":"https://api.github.com/repos/vimc/bb8/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vimc/bb8/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vimc/bb8/teams","hooks_url":"https://api.github.com/repos/vimc/bb8/hooks","issue_events_url":"https://api.github.com/repos/vimc/bb8/issues/events{/number}","events_url":"https://api.github.com/repos/vimc/bb8/events","assignees_url":"https://api.github.com/repos/vimc/bb8/assignees{/user}","branches_url":"https://api.github.com/repos/vimc/bb8/branches{/branch}","tags_url":"https://api.github.com/repos/vimc/bb8/tags","blobs_url":"https://api.github.com/repos/vimc/bb8/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vimc/bb8/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vimc/bb8/git/refs{/sha}","trees_url":"https://api.github.com/repos/vimc/bb8/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vimc/bb8/statuses/{sha}","languages_url":"https://api.github.com/repos/vimc/bb8/languages","stargazers_url":"https://api.github.com/repos/vimc/bb8/stargazers","contributors_url":"https://api.github.com/repos/vimc/bb8/contributors","subscribers_url":"https://api.github.com/repos/vimc/bb8/subscribers","subscription_url":"https://api.github.com/repos/vimc/bb8/subscription","commits_url":"https://api.github.com/repos/vimc/bb8/commits{/sha}","git_commits_url":"https://api.github.com/repos/vimc/bb8/git/commits{/sha}","comments_url":"https://api.github.com/repos/vimc/bb8/comments{/number}","issue_comment_url":"https://api.github.com/repos/vimc/bb8/issues/comments{/number}","contents_url":"https://api.github.com/repos/vimc/bb8/contents/{+path}","compare_url":"https://api.github.com/repos/vimc/bb8/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vimc/bb8/merges","archive_url":"https://api.github.com/repos/vimc/bb8/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vimc/bb8/downloads","issues_url":"https://api.github.com/repos/vimc/bb8/issues{/number}","pulls_url":"https://api.github.com/repos/vimc/bb8/pulls{/number}","milestones_url":"https://api.github.com/repos/vimc/bb8/milestones{/number}","notifications_url":"https://api.github.com/repos/vimc/bb8/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vimc/bb8/labels{/name}","releases_url":"https://api.github.com/repos/vimc/bb8/releases{/id}","deployments_url":"https://api.github.com/repos/vimc/bb8/deployments","created_at":"2018-01-18T15:46:17Z","updated_at":"2018-03-16T16:57:09Z","pushed_at":"2018-04-06T12:50:18Z","git_url":"git://github.com/vimc/bb8.git","ssh_url":"git@github.com:vimc/bb8.git","clone_url":"https://github.com/vimc/bb8.git","svn_url":"https://github.com/vimc/bb8","homepage":null,"size":122,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vimc/bb8/pulls/13"},"html":{"href":"https://github.com/vimc/bb8/pull/13"},"issue":{"href":"https://api.github.com/repos/vimc/bb8/issues/13"},"comments":{"href":"https://api.github.com/repos/vimc/bb8/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/vimc/bb8/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/vimc/bb8/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vimc/bb8/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/vimc/bb8/statuses/ff8a1bc551030ea10035508b7e286350f5eb80db"}},"author_association":"OWNER"}}
{"actor":{"display_login":"MartinEden"}}