{"action":"created","comment":{"url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/comments/138415804","pull_request_review_id":62207798,"id":138415804,"diff_hunk":"@@ -0,0 +1,23 @@\n+#python2\n+\n+import re\n+import os\n+from overviewer_core import configParser\n+\n+if __name__ == '__main__':\n+    # Parse the overviewer's config file\n+    my_parser = configParser.MultiWorldParser()\n+    try:\n+        my_parser.parse(os.path.expanduser('config.py'))\n+    except configParser.MissingConfigException as e:\n+        os.exit(-1)\n+    config = my_parser.get_validated_config()\n+\n+    # Open the index.html in the output directory and add the key\n+    with open(os.path.join(config['outputdir'], 'index.html'), 'r+') as fd:","path":"utils/replace.py","position":17,"original_position":17,"commit_id":"5fefd07b400ec65af0a6b86568bdc00192b5749e","original_commit_id":"7536107cff0eb92986fda3de437c0be7d4ab990f","user":{"login":"StefanBossbaly","id":828855,"avatar_url":"https://avatars0.githubusercontent.com/u/828855?v=4","gravatar_id":"","url":"https://api.github.com/users/StefanBossbaly","html_url":"https://github.com/StefanBossbaly","followers_url":"https://api.github.com/users/StefanBossbaly/followers","following_url":"https://api.github.com/users/StefanBossbaly/following{/other_user}","gists_url":"https://api.github.com/users/StefanBossbaly/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanBossbaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanBossbaly/subscriptions","organizations_url":"https://api.github.com/users/StefanBossbaly/orgs","repos_url":"https://api.github.com/users/StefanBossbaly/repos","events_url":"https://api.github.com/users/StefanBossbaly/events{/privacy}","received_events_url":"https://api.github.com/users/StefanBossbaly/received_events","type":"User","site_admin":false},"body":"When I created the pull request I was debating on if I should hardcode the value of the output directory or use the `configParser`. The tradeoff is a hardcoded value or an extra dependency. ","created_at":"2017-09-12T17:29:58Z","updated_at":"2017-09-12T17:29:58Z","html_url":"https://github.com/mide/minecraft-overviewer/pull/5#discussion_r138415804","pull_request_url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/comments/138415804"},"html":{"href":"https://github.com/mide/minecraft-overviewer/pull/5#discussion_r138415804"},"pull_request":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5"}},"in_reply_to_id":138395651},"pull_request":{"url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5","id":140225754,"html_url":"https://github.com/mide/minecraft-overviewer/pull/5","diff_url":"https://github.com/mide/minecraft-overviewer/pull/5.diff","patch_url":"https://github.com/mide/minecraft-overviewer/pull/5.patch","issue_url":"https://api.github.com/repos/mide/minecraft-overviewer/issues/5","number":5,"state":"open","locked":false,"title":"Added script to modify index.html with provided GMaps API Key","user":{"login":"StefanBossbaly","id":828855,"avatar_url":"https://avatars0.githubusercontent.com/u/828855?v=4","gravatar_id":"","url":"https://api.github.com/users/StefanBossbaly","html_url":"https://github.com/StefanBossbaly","followers_url":"https://api.github.com/users/StefanBossbaly/followers","following_url":"https://api.github.com/users/StefanBossbaly/following{/other_user}","gists_url":"https://api.github.com/users/StefanBossbaly/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanBossbaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanBossbaly/subscriptions","organizations_url":"https://api.github.com/users/StefanBossbaly/orgs","repos_url":"https://api.github.com/users/StefanBossbaly/repos","events_url":"https://api.github.com/users/StefanBossbaly/events{/privacy}","received_events_url":"https://api.github.com/users/StefanBossbaly/received_events","type":"User","site_admin":false},"body":"I created a small Python script that takes a GMaps API Key in the environment variable \"API_KEY\" add modifies the `index.html` file to include the key so that the map renders properly. The script uses the `configParser` class from the `overviewer_core` module. This means that the script can handle custom config files. This addresses issue #4. \r\n\r\nHere is an example of my docker-compose.yml file.\r\n```\r\nminecraft-overviewer:\r\n  image: stefan_overviewer\r\n  container_name: minecraft-overviewer\r\n  environment:\r\n    - MINECRAFT_VERSION=1.12.1\r\n    - API_KEY=XXX\r\n  volumes:\r\n    - ./minecraft-data:/home/minecraft/server/:ro\r\n    - ./minecraft-overviewer-data:/home/minecraft/render/:rw\r\n    - ./minecraft-overviewer-conf/config.py:/home/minecraft/config.py:rw\r\n```","created_at":"2017-09-10T21:16:11Z","updated_at":"2017-09-12T17:29:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1f830030cd0c83daf3affbf1c0e80a6bb79a847","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5/commits","review_comments_url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5/comments","review_comment_url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mide/minecraft-overviewer/issues/5/comments","statuses_url":"https://api.github.com/repos/mide/minecraft-overviewer/statuses/5fefd07b400ec65af0a6b86568bdc00192b5749e","head":{"label":"StefanBossbaly:master","ref":"master","sha":"5fefd07b400ec65af0a6b86568bdc00192b5749e","user":{"login":"StefanBossbaly","id":828855,"avatar_url":"https://avatars0.githubusercontent.com/u/828855?v=4","gravatar_id":"","url":"https://api.github.com/users/StefanBossbaly","html_url":"https://github.com/StefanBossbaly","followers_url":"https://api.github.com/users/StefanBossbaly/followers","following_url":"https://api.github.com/users/StefanBossbaly/following{/other_user}","gists_url":"https://api.github.com/users/StefanBossbaly/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanBossbaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanBossbaly/subscriptions","organizations_url":"https://api.github.com/users/StefanBossbaly/orgs","repos_url":"https://api.github.com/users/StefanBossbaly/repos","events_url":"https://api.github.com/users/StefanBossbaly/events{/privacy}","received_events_url":"https://api.github.com/users/StefanBossbaly/received_events","type":"User","site_admin":false},"repo":{"id":103001275,"name":"minecraft-overviewer","full_name":"StefanBossbaly/minecraft-overviewer","owner":{"login":"StefanBossbaly","id":828855,"avatar_url":"https://avatars0.githubusercontent.com/u/828855?v=4","gravatar_id":"","url":"https://api.github.com/users/StefanBossbaly","html_url":"https://github.com/StefanBossbaly","followers_url":"https://api.github.com/users/StefanBossbaly/followers","following_url":"https://api.github.com/users/StefanBossbaly/following{/other_user}","gists_url":"https://api.github.com/users/StefanBossbaly/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanBossbaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanBossbaly/subscriptions","organizations_url":"https://api.github.com/users/StefanBossbaly/orgs","repos_url":"https://api.github.com/users/StefanBossbaly/repos","events_url":"https://api.github.com/users/StefanBossbaly/events{/privacy}","received_events_url":"https://api.github.com/users/StefanBossbaly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StefanBossbaly/minecraft-overviewer","description":"Docker Container to Run Minecraft Overviewer","fork":true,"url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer","forks_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/forks","keys_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/teams","hooks_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/hooks","issue_events_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/issues/events{/number}","events_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/events","assignees_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/assignees{/user}","branches_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/branches{/branch}","tags_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/tags","blobs_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/statuses/{sha}","languages_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/languages","stargazers_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/stargazers","contributors_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/contributors","subscribers_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/subscribers","subscription_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/subscription","commits_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/contents/{+path}","compare_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/merges","archive_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/downloads","issues_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/issues{/number}","pulls_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/pulls{/number}","milestones_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/milestones{/number}","notifications_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/labels{/name}","releases_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/releases{/id}","deployments_url":"https://api.github.com/repos/StefanBossbaly/minecraft-overviewer/deployments","created_at":"2017-09-10T03:41:43Z","updated_at":"2017-09-10T03:41:45Z","pushed_at":"2017-09-12T16:48:26Z","git_url":"git://github.com/StefanBossbaly/minecraft-overviewer.git","ssh_url":"git@github.com:StefanBossbaly/minecraft-overviewer.git","clone_url":"https://github.com/StefanBossbaly/minecraft-overviewer.git","svn_url":"https://github.com/StefanBossbaly/minecraft-overviewer","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mide:master","ref":"master","sha":"d629e9bbe1a0288c175fe48da474b924908c7cfe","user":{"login":"mide","id":546518,"avatar_url":"https://avatars3.githubusercontent.com/u/546518?v=4","gravatar_id":"","url":"https://api.github.com/users/mide","html_url":"https://github.com/mide","followers_url":"https://api.github.com/users/mide/followers","following_url":"https://api.github.com/users/mide/following{/other_user}","gists_url":"https://api.github.com/users/mide/gists{/gist_id}","starred_url":"https://api.github.com/users/mide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mide/subscriptions","organizations_url":"https://api.github.com/users/mide/orgs","repos_url":"https://api.github.com/users/mide/repos","events_url":"https://api.github.com/users/mide/events{/privacy}","received_events_url":"https://api.github.com/users/mide/received_events","type":"User","site_admin":false},"repo":{"id":61923285,"name":"minecraft-overviewer","full_name":"mide/minecraft-overviewer","owner":{"login":"mide","id":546518,"avatar_url":"https://avatars3.githubusercontent.com/u/546518?v=4","gravatar_id":"","url":"https://api.github.com/users/mide","html_url":"https://github.com/mide","followers_url":"https://api.github.com/users/mide/followers","following_url":"https://api.github.com/users/mide/following{/other_user}","gists_url":"https://api.github.com/users/mide/gists{/gist_id}","starred_url":"https://api.github.com/users/mide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mide/subscriptions","organizations_url":"https://api.github.com/users/mide/orgs","repos_url":"https://api.github.com/users/mide/repos","events_url":"https://api.github.com/users/mide/events{/privacy}","received_events_url":"https://api.github.com/users/mide/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mide/minecraft-overviewer","description":"Docker Container to Run Minecraft Overviewer","fork":false,"url":"https://api.github.com/repos/mide/minecraft-overviewer","forks_url":"https://api.github.com/repos/mide/minecraft-overviewer/forks","keys_url":"https://api.github.com/repos/mide/minecraft-overviewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mide/minecraft-overviewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mide/minecraft-overviewer/teams","hooks_url":"https://api.github.com/repos/mide/minecraft-overviewer/hooks","issue_events_url":"https://api.github.com/repos/mide/minecraft-overviewer/issues/events{/number}","events_url":"https://api.github.com/repos/mide/minecraft-overviewer/events","assignees_url":"https://api.github.com/repos/mide/minecraft-overviewer/assignees{/user}","branches_url":"https://api.github.com/repos/mide/minecraft-overviewer/branches{/branch}","tags_url":"https://api.github.com/repos/mide/minecraft-overviewer/tags","blobs_url":"https://api.github.com/repos/mide/minecraft-overviewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mide/minecraft-overviewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mide/minecraft-overviewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mide/minecraft-overviewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mide/minecraft-overviewer/statuses/{sha}","languages_url":"https://api.github.com/repos/mide/minecraft-overviewer/languages","stargazers_url":"https://api.github.com/repos/mide/minecraft-overviewer/stargazers","contributors_url":"https://api.github.com/repos/mide/minecraft-overviewer/contributors","subscribers_url":"https://api.github.com/repos/mide/minecraft-overviewer/subscribers","subscription_url":"https://api.github.com/repos/mide/minecraft-overviewer/subscription","commits_url":"https://api.github.com/repos/mide/minecraft-overviewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mide/minecraft-overviewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mide/minecraft-overviewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mide/minecraft-overviewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mide/minecraft-overviewer/contents/{+path}","compare_url":"https://api.github.com/repos/mide/minecraft-overviewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mide/minecraft-overviewer/merges","archive_url":"https://api.github.com/repos/mide/minecraft-overviewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mide/minecraft-overviewer/downloads","issues_url":"https://api.github.com/repos/mide/minecraft-overviewer/issues{/number}","pulls_url":"https://api.github.com/repos/mide/minecraft-overviewer/pulls{/number}","milestones_url":"https://api.github.com/repos/mide/minecraft-overviewer/milestones{/number}","notifications_url":"https://api.github.com/repos/mide/minecraft-overviewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mide/minecraft-overviewer/labels{/name}","releases_url":"https://api.github.com/repos/mide/minecraft-overviewer/releases{/id}","deployments_url":"https://api.github.com/repos/mide/minecraft-overviewer/deployments","created_at":"2016-06-25T02:32:21Z","updated_at":"2017-09-11T04:37:06Z","pushed_at":"2017-09-12T16:48:28Z","git_url":"git://github.com/mide/minecraft-overviewer.git","ssh_url":"git@github.com:mide/minecraft-overviewer.git","clone_url":"https://github.com/mide/minecraft-overviewer.git","svn_url":"https://github.com/mide/minecraft-overviewer","homepage":null,"size":19,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5"},"html":{"href":"https://github.com/mide/minecraft-overviewer/pull/5"},"issue":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/issues/5"},"comments":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/mide/minecraft-overviewer/statuses/5fefd07b400ec65af0a6b86568bdc00192b5749e"}},"author_association":"NONE"}}
{"actor":{"display_login":"StefanBossbaly"}}