{"action":"created","comment":{"url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/comments/33396482","id":33396482,"diff_hunk":"@@ -4,9 +4,78 @@\n // @module config.js\n // ---------------------------------------------------------------------------------------------------------------------\n \n+var path = require('path');\n+\n+var _ = require('lodash');\n+\n+// ---------------------------------------------------------------------------------------------------------------------\n+\n module.exports = {\n-    DEBUG: true,\n-    port: 8008\n+    DEBUG: parseBool(process.env.DEBUG, true),\n+    logLevel: process.env.LOG_LEVEL || 'DEBUG',\n+\n+    port: 8008,\n+\n+    rethinkdb: {\n+        host: 'localhost',\n+        port: 28015,\n+        db: 'rfi_mmorpg'\n+    }\n }; // end exports\n \n-// ---------------------------------------------------------------------------------------------------------------------\n\\ No newline at end of file\n+// ---------------------------------------------------------------------------------------------------------------------\n+// Parse command-line options.\n+\n+var argv = require('minimist')(process.argv.slice(2), { alias: { help: 'h' }, boolean: true });\n+\n+if(argv.help)\n+{\n+    var e = console.error.bind(console);\n+    e('');\n+    e('  Usage: %s [options]', path.basename(process.argv[1]));\n+    e('');\n+    e('  Initialize the database with data');\n+    e('');\n+    e('  Options:');\n+    e('');\n+    e('    -h, --help                 output usage information');\n+    e('');\n+    e('    --<config.option>=<value>  set configuration option to <value>');\n+    e('    --<config.option>          set configuration option to `true`');\n+    e('');\n+\n+    // If another module has registered extra lines for the help message, display them.\n+    if(GLOBAL.extraHelp)\n+    {\n+        GLOBAL.extraHelp.forEach(function(extraHelpLine)\n+        {\n+            e(extraHelpLine);\n+        });\n+        e('');\n+    } // end if\n+\n+    process.exit(1);\n+} // end if\n+\n+_.merge(module.exports, _.omit(argv, '_'));\n+\n+// ---------------------------------------------------------------------------------------------------------------------\n+\n+// Parse a string as a boolean. (used to support boolean flags in environment variables)\n+function parseBool(boolString, defaultValue)","path":"config.js","position":66,"original_position":66,"commit_id":"40de1628a6544e4751a52f3d9121c19774750d1f","original_commit_id":"40de1628a6544e4751a52f3d9121c19774750d1f","user":{"login":"Morgul","id":770655,"avatar_url":"https://avatars.githubusercontent.com/u/770655?v=3","gravatar_id":"","url":"https://api.github.com/users/Morgul","html_url":"https://github.com/Morgul","followers_url":"https://api.github.com/users/Morgul/followers","following_url":"https://api.github.com/users/Morgul/following{/other_user}","gists_url":"https://api.github.com/users/Morgul/gists{/gist_id}","starred_url":"https://api.github.com/users/Morgul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morgul/subscriptions","organizations_url":"https://api.github.com/users/Morgul/orgs","repos_url":"https://api.github.com/users/Morgul/repos","events_url":"https://api.github.com/users/Morgul/events{/privacy}","received_events_url":"https://api.github.com/users/Morgul/received_events","type":"User","site_admin":false},"body":"Maybe pull this into a utility function?","created_at":"2015-06-26T21:12:33Z","updated_at":"2015-06-26T21:12:33Z","html_url":"https://github.com/SkewedAspect/rfi-server/pull/20#discussion_r33396482","pull_request_url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/comments/33396482"},"html":{"href":"https://github.com/SkewedAspect/rfi-server/pull/20#discussion_r33396482"},"pull_request":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20","id":38686495,"html_url":"https://github.com/SkewedAspect/rfi-server/pull/20","diff_url":"https://github.com/SkewedAspect/rfi-server/pull/20.diff","patch_url":"https://github.com/SkewedAspect/rfi-server/pull/20.patch","issue_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/20","number":20,"state":"open","locked":false,"title":"Docker support","user":{"login":"whitelynx","id":285264,"avatar_url":"https://avatars.githubusercontent.com/u/285264?v=3","gravatar_id":"","url":"https://api.github.com/users/whitelynx","html_url":"https://github.com/whitelynx","followers_url":"https://api.github.com/users/whitelynx/followers","following_url":"https://api.github.com/users/whitelynx/following{/other_user}","gists_url":"https://api.github.com/users/whitelynx/gists{/gist_id}","starred_url":"https://api.github.com/users/whitelynx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitelynx/subscriptions","organizations_url":"https://api.github.com/users/whitelynx/orgs","repos_url":"https://api.github.com/users/whitelynx/repos","events_url":"https://api.github.com/users/whitelynx/events{/privacy}","received_events_url":"https://api.github.com/users/whitelynx/received_events","type":"User","site_admin":false},"body":"This adds support for running the server in a Docker container, and also provides a RethinkDB container so developers don't need to install RethinkDB. See [Readme.md](https://github.com/SkewedAspect/rfi-server/blob/40de1628a6544e4751a52f3d9121c19774750d1f/Readme.md) for details.\r\n\r\nRequires #19.","created_at":"2015-06-26T20:30:23Z","updated_at":"2015-06-26T21:12:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b704b9f26456131d9711c0bd94dc4b5de02d038","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20/commits","review_comments_url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20/comments","review_comment_url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/20/comments","statuses_url":"https://api.github.com/repos/SkewedAspect/rfi-server/statuses/40de1628a6544e4751a52f3d9121c19774750d1f","head":{"label":"SkewedAspect:dbronke-docker","ref":"dbronke-docker","sha":"40de1628a6544e4751a52f3d9121c19774750d1f","user":{"login":"SkewedAspect","id":2968457,"avatar_url":"https://avatars.githubusercontent.com/u/2968457?v=3","gravatar_id":"","url":"https://api.github.com/users/SkewedAspect","html_url":"https://github.com/SkewedAspect","followers_url":"https://api.github.com/users/SkewedAspect/followers","following_url":"https://api.github.com/users/SkewedAspect/following{/other_user}","gists_url":"https://api.github.com/users/SkewedAspect/gists{/gist_id}","starred_url":"https://api.github.com/users/SkewedAspect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkewedAspect/subscriptions","organizations_url":"https://api.github.com/users/SkewedAspect/orgs","repos_url":"https://api.github.com/users/SkewedAspect/repos","events_url":"https://api.github.com/users/SkewedAspect/events{/privacy}","received_events_url":"https://api.github.com/users/SkewedAspect/received_events","type":"Organization","site_admin":false},"repo":{"id":24248868,"name":"rfi-server","full_name":"SkewedAspect/rfi-server","owner":{"login":"SkewedAspect","id":2968457,"avatar_url":"https://avatars.githubusercontent.com/u/2968457?v=3","gravatar_id":"","url":"https://api.github.com/users/SkewedAspect","html_url":"https://github.com/SkewedAspect","followers_url":"https://api.github.com/users/SkewedAspect/followers","following_url":"https://api.github.com/users/SkewedAspect/following{/other_user}","gists_url":"https://api.github.com/users/SkewedAspect/gists{/gist_id}","starred_url":"https://api.github.com/users/SkewedAspect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkewedAspect/subscriptions","organizations_url":"https://api.github.com/users/SkewedAspect/orgs","repos_url":"https://api.github.com/users/SkewedAspect/repos","events_url":"https://api.github.com/users/SkewedAspect/events{/privacy}","received_events_url":"https://api.github.com/users/SkewedAspect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SkewedAspect/rfi-server","description":"A nodejs implementation of the MMORPG server for RFI:Precursors.","fork":false,"url":"https://api.github.com/repos/SkewedAspect/rfi-server","forks_url":"https://api.github.com/repos/SkewedAspect/rfi-server/forks","keys_url":"https://api.github.com/repos/SkewedAspect/rfi-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkewedAspect/rfi-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkewedAspect/rfi-server/teams","hooks_url":"https://api.github.com/repos/SkewedAspect/rfi-server/hooks","issue_events_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/events{/number}","events_url":"https://api.github.com/repos/SkewedAspect/rfi-server/events","assignees_url":"https://api.github.com/repos/SkewedAspect/rfi-server/assignees{/user}","branches_url":"https://api.github.com/repos/SkewedAspect/rfi-server/branches{/branch}","tags_url":"https://api.github.com/repos/SkewedAspect/rfi-server/tags","blobs_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkewedAspect/rfi-server/statuses/{sha}","languages_url":"https://api.github.com/repos/SkewedAspect/rfi-server/languages","stargazers_url":"https://api.github.com/repos/SkewedAspect/rfi-server/stargazers","contributors_url":"https://api.github.com/repos/SkewedAspect/rfi-server/contributors","subscribers_url":"https://api.github.com/repos/SkewedAspect/rfi-server/subscribers","subscription_url":"https://api.github.com/repos/SkewedAspect/rfi-server/subscription","commits_url":"https://api.github.com/repos/SkewedAspect/rfi-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkewedAspect/rfi-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkewedAspect/rfi-server/contents/{+path}","compare_url":"https://api.github.com/repos/SkewedAspect/rfi-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkewedAspect/rfi-server/merges","archive_url":"https://api.github.com/repos/SkewedAspect/rfi-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkewedAspect/rfi-server/downloads","issues_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues{/number}","pulls_url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls{/number}","milestones_url":"https://api.github.com/repos/SkewedAspect/rfi-server/milestones{/number}","notifications_url":"https://api.github.com/repos/SkewedAspect/rfi-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkewedAspect/rfi-server/labels{/name}","releases_url":"https://api.github.com/repos/SkewedAspect/rfi-server/releases{/id}","created_at":"2014-09-19T23:39:25Z","updated_at":"2015-05-04T11:32:22Z","pushed_at":"2015-06-26T20:30:23Z","git_url":"git://github.com/SkewedAspect/rfi-server.git","ssh_url":"git@github.com:SkewedAspect/rfi-server.git","clone_url":"https://github.com/SkewedAspect/rfi-server.git","svn_url":"https://github.com/SkewedAspect/rfi-server","homepage":null,"size":454,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"base":{"label":"SkewedAspect:master","ref":"master","sha":"d84ee635116857792b589af0505706a8b1fc9c7e","user":{"login":"SkewedAspect","id":2968457,"avatar_url":"https://avatars.githubusercontent.com/u/2968457?v=3","gravatar_id":"","url":"https://api.github.com/users/SkewedAspect","html_url":"https://github.com/SkewedAspect","followers_url":"https://api.github.com/users/SkewedAspect/followers","following_url":"https://api.github.com/users/SkewedAspect/following{/other_user}","gists_url":"https://api.github.com/users/SkewedAspect/gists{/gist_id}","starred_url":"https://api.github.com/users/SkewedAspect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkewedAspect/subscriptions","organizations_url":"https://api.github.com/users/SkewedAspect/orgs","repos_url":"https://api.github.com/users/SkewedAspect/repos","events_url":"https://api.github.com/users/SkewedAspect/events{/privacy}","received_events_url":"https://api.github.com/users/SkewedAspect/received_events","type":"Organization","site_admin":false},"repo":{"id":24248868,"name":"rfi-server","full_name":"SkewedAspect/rfi-server","owner":{"login":"SkewedAspect","id":2968457,"avatar_url":"https://avatars.githubusercontent.com/u/2968457?v=3","gravatar_id":"","url":"https://api.github.com/users/SkewedAspect","html_url":"https://github.com/SkewedAspect","followers_url":"https://api.github.com/users/SkewedAspect/followers","following_url":"https://api.github.com/users/SkewedAspect/following{/other_user}","gists_url":"https://api.github.com/users/SkewedAspect/gists{/gist_id}","starred_url":"https://api.github.com/users/SkewedAspect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkewedAspect/subscriptions","organizations_url":"https://api.github.com/users/SkewedAspect/orgs","repos_url":"https://api.github.com/users/SkewedAspect/repos","events_url":"https://api.github.com/users/SkewedAspect/events{/privacy}","received_events_url":"https://api.github.com/users/SkewedAspect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SkewedAspect/rfi-server","description":"A nodejs implementation of the MMORPG server for RFI:Precursors.","fork":false,"url":"https://api.github.com/repos/SkewedAspect/rfi-server","forks_url":"https://api.github.com/repos/SkewedAspect/rfi-server/forks","keys_url":"https://api.github.com/repos/SkewedAspect/rfi-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkewedAspect/rfi-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkewedAspect/rfi-server/teams","hooks_url":"https://api.github.com/repos/SkewedAspect/rfi-server/hooks","issue_events_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/events{/number}","events_url":"https://api.github.com/repos/SkewedAspect/rfi-server/events","assignees_url":"https://api.github.com/repos/SkewedAspect/rfi-server/assignees{/user}","branches_url":"https://api.github.com/repos/SkewedAspect/rfi-server/branches{/branch}","tags_url":"https://api.github.com/repos/SkewedAspect/rfi-server/tags","blobs_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkewedAspect/rfi-server/statuses/{sha}","languages_url":"https://api.github.com/repos/SkewedAspect/rfi-server/languages","stargazers_url":"https://api.github.com/repos/SkewedAspect/rfi-server/stargazers","contributors_url":"https://api.github.com/repos/SkewedAspect/rfi-server/contributors","subscribers_url":"https://api.github.com/repos/SkewedAspect/rfi-server/subscribers","subscription_url":"https://api.github.com/repos/SkewedAspect/rfi-server/subscription","commits_url":"https://api.github.com/repos/SkewedAspect/rfi-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkewedAspect/rfi-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkewedAspect/rfi-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkewedAspect/rfi-server/contents/{+path}","compare_url":"https://api.github.com/repos/SkewedAspect/rfi-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkewedAspect/rfi-server/merges","archive_url":"https://api.github.com/repos/SkewedAspect/rfi-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkewedAspect/rfi-server/downloads","issues_url":"https://api.github.com/repos/SkewedAspect/rfi-server/issues{/number}","pulls_url":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls{/number}","milestones_url":"https://api.github.com/repos/SkewedAspect/rfi-server/milestones{/number}","notifications_url":"https://api.github.com/repos/SkewedAspect/rfi-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkewedAspect/rfi-server/labels{/name}","releases_url":"https://api.github.com/repos/SkewedAspect/rfi-server/releases{/id}","created_at":"2014-09-19T23:39:25Z","updated_at":"2015-05-04T11:32:22Z","pushed_at":"2015-06-26T20:30:23Z","git_url":"git://github.com/SkewedAspect/rfi-server.git","ssh_url":"git@github.com:SkewedAspect/rfi-server.git","clone_url":"https://github.com/SkewedAspect/rfi-server.git","svn_url":"https://github.com/SkewedAspect/rfi-server","homepage":null,"size":454,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20"},"html":{"href":"https://github.com/SkewedAspect/rfi-server/pull/20"},"issue":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/20"},"comments":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/SkewedAspect/rfi-server/statuses/40de1628a6544e4751a52f3d9121c19774750d1f"}}}}