{"action":"created","comment":{"url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/comments/227496424","pull_request_review_id":167551866,"id":227496424,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzQ5NjQyNA==","diff_hunk":"@@ -0,0 +1,95 @@\n+# iprepd-nginx module\n+\n+`iprepd-nginx` is an openresty module for integrating with [iprepd](https://github.com/mozilla-services/iprepd).\n+\n+You can use the example configuration in this repo for a standalone proxy or install using [opm](https://github.com/openresty/opm)\n+and integrate it yourself.\n+\n+*Note:* If nginx is behind a load balancer, make sure to use something like\n+[ngx_http_realip_module](https://nginx.org/en/docs/http/ngx_http_realip_module.html).\n+\n+\n+## Installation\n+\n+Install using [opm](https://github.com/openresty/opm)\n+\n+```\n+opm get ajvb/iprepd-nginx\n+```\n+\n+## Example\n+\n+Note: Check out `/etc` in this repo for a working example.\n+\n+```\n+init_by_lua_block {\n+  client = require(\"resty.iprepd\").new({\n+    url = os.getenv(\"IPREPD_URL\") or \"http://127.0.0.1:8080\",\n+    api_key = os.getenv(\"IPREPD_API_KEY\"),\n+    cache_ttl = os.getenv(\"IPREPD_CACHE_TTL\") or 30,\n+    threshold = tonumber(os.getenv(\"IPREPD_REPUTATION_THRESHOLD\")),","path":"README.md","position":30,"original_position":30,"commit_id":"3665c4fa1be474507ef91a4a4e94a3a6c5b2281b","original_commit_id":"a6bf318fcb10dd91244a6413c8c3e65ed00a0412","user":{"login":"ameihm0912","id":9889986,"node_id":"MDQ6VXNlcjk4ODk5ODY=","avatar_url":"https://avatars3.githubusercontent.com/u/9889986?v=4","gravatar_id":"","url":"https://api.github.com/users/ameihm0912","html_url":"https://github.com/ameihm0912","followers_url":"https://api.github.com/users/ameihm0912/followers","following_url":"https://api.github.com/users/ameihm0912/following{/other_user}","gists_url":"https://api.github.com/users/ameihm0912/gists{/gist_id}","starred_url":"https://api.github.com/users/ameihm0912/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ameihm0912/subscriptions","organizations_url":"https://api.github.com/users/ameihm0912/orgs","repos_url":"https://api.github.com/users/ameihm0912/repos","events_url":"https://api.github.com/users/ameihm0912/events{/privacy}","received_events_url":"https://api.github.com/users/ameihm0912/received_events","type":"User","site_admin":false},"body":"No hard rules for this; in the past we've used 50 (start warning/logging) and 25 (start blocking). But it is intended to be configurable for whatever the application wants to go with.\r\n\r\nIf we want defaults 50 is a good place to start here, but we should definitely document too because it should always be deliberately selected for any given app. ","created_at":"2018-10-23T17:44:40Z","updated_at":"2018-10-23T17:44:40Z","html_url":"https://github.com/ajvb/iprepd-nginx/pull/1#discussion_r227496424","pull_request_url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/comments/227496424"},"html":{"href":"https://github.com/ajvb/iprepd-nginx/pull/1#discussion_r227496424"},"pull_request":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1"}},"in_reply_to_id":227416755},"pull_request":{"url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1","id":224421937,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NDIxOTM3","html_url":"https://github.com/ajvb/iprepd-nginx/pull/1","diff_url":"https://github.com/ajvb/iprepd-nginx/pull/1.diff","patch_url":"https://github.com/ajvb/iprepd-nginx/pull/1.patch","issue_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/1","number":1,"state":"open","locked":false,"title":"V1 iprepd openresty module + example standalone proxy","user":{"login":"ajvb","id":1144310,"node_id":"MDQ6VXNlcjExNDQzMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1144310?v=4","gravatar_id":"","url":"https://api.github.com/users/ajvb","html_url":"https://github.com/ajvb","followers_url":"https://api.github.com/users/ajvb/followers","following_url":"https://api.github.com/users/ajvb/following{/other_user}","gists_url":"https://api.github.com/users/ajvb/gists{/gist_id}","starred_url":"https://api.github.com/users/ajvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajvb/subscriptions","organizations_url":"https://api.github.com/users/ajvb/orgs","repos_url":"https://api.github.com/users/ajvb/repos","events_url":"https://api.github.com/users/ajvb/events{/privacy}","received_events_url":"https://api.github.com/users/ajvb/received_events","type":"User","site_admin":false},"body":"This follows what is described in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1497600\r\n\r\nNote: This is not in `mozilla-services` because [opm](https://github.com/openresty/opm) requires that you are an owner of the organization to upload the package (which makes sense).\r\n\r\nYou can integrate it into an nginx configuration or use the `Dockerfile` to create a standalone proxy that will check if the IP is in `iprepd` and has a reputation above the configured threshold.\r\n\r\nAs well, there is a built in cache of responses that has a configurable TTL (with a default of 30 seconds).\r\n\r\nA follow-up item will be creating a `compose.yml` or similar that can be used to run a set of integration tests.","created_at":"2018-10-19T22:05:22Z","updated_at":"2018-10-23T17:44:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11b48e4a39ab6c06c1fd44b8b2cccbfd228fc2ec","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/1/comments","statuses_url":"https://api.github.com/repos/ajvb/iprepd-nginx/statuses/3665c4fa1be474507ef91a4a4e94a3a6c5b2281b","head":{"label":"ajvb:v1","ref":"v1","sha":"3665c4fa1be474507ef91a4a4e94a3a6c5b2281b","user":{"login":"ajvb","id":1144310,"node_id":"MDQ6VXNlcjExNDQzMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1144310?v=4","gravatar_id":"","url":"https://api.github.com/users/ajvb","html_url":"https://github.com/ajvb","followers_url":"https://api.github.com/users/ajvb/followers","following_url":"https://api.github.com/users/ajvb/following{/other_user}","gists_url":"https://api.github.com/users/ajvb/gists{/gist_id}","starred_url":"https://api.github.com/users/ajvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajvb/subscriptions","organizations_url":"https://api.github.com/users/ajvb/orgs","repos_url":"https://api.github.com/users/ajvb/repos","events_url":"https://api.github.com/users/ajvb/events{/privacy}","received_events_url":"https://api.github.com/users/ajvb/received_events","type":"User","site_admin":false},"repo":{"id":153834865,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM4MzQ4NjU=","name":"iprepd-nginx","full_name":"ajvb/iprepd-nginx","private":false,"owner":{"login":"ajvb","id":1144310,"node_id":"MDQ6VXNlcjExNDQzMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1144310?v=4","gravatar_id":"","url":"https://api.github.com/users/ajvb","html_url":"https://github.com/ajvb","followers_url":"https://api.github.com/users/ajvb/followers","following_url":"https://api.github.com/users/ajvb/following{/other_user}","gists_url":"https://api.github.com/users/ajvb/gists{/gist_id}","starred_url":"https://api.github.com/users/ajvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajvb/subscriptions","organizations_url":"https://api.github.com/users/ajvb/orgs","repos_url":"https://api.github.com/users/ajvb/repos","events_url":"https://api.github.com/users/ajvb/events{/privacy}","received_events_url":"https://api.github.com/users/ajvb/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ajvb/iprepd-nginx","description":null,"fork":false,"url":"https://api.github.com/repos/ajvb/iprepd-nginx","forks_url":"https://api.github.com/repos/ajvb/iprepd-nginx/forks","keys_url":"https://api.github.com/repos/ajvb/iprepd-nginx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajvb/iprepd-nginx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajvb/iprepd-nginx/teams","hooks_url":"https://api.github.com/repos/ajvb/iprepd-nginx/hooks","issue_events_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/events{/number}","events_url":"https://api.github.com/repos/ajvb/iprepd-nginx/events","assignees_url":"https://api.github.com/repos/ajvb/iprepd-nginx/assignees{/user}","branches_url":"https://api.github.com/repos/ajvb/iprepd-nginx/branches{/branch}","tags_url":"https://api.github.com/repos/ajvb/iprepd-nginx/tags","blobs_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajvb/iprepd-nginx/statuses/{sha}","languages_url":"https://api.github.com/repos/ajvb/iprepd-nginx/languages","stargazers_url":"https://api.github.com/repos/ajvb/iprepd-nginx/stargazers","contributors_url":"https://api.github.com/repos/ajvb/iprepd-nginx/contributors","subscribers_url":"https://api.github.com/repos/ajvb/iprepd-nginx/subscribers","subscription_url":"https://api.github.com/repos/ajvb/iprepd-nginx/subscription","commits_url":"https://api.github.com/repos/ajvb/iprepd-nginx/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajvb/iprepd-nginx/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajvb/iprepd-nginx/contents/{+path}","compare_url":"https://api.github.com/repos/ajvb/iprepd-nginx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajvb/iprepd-nginx/merges","archive_url":"https://api.github.com/repos/ajvb/iprepd-nginx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajvb/iprepd-nginx/downloads","issues_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues{/number}","pulls_url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls{/number}","milestones_url":"https://api.github.com/repos/ajvb/iprepd-nginx/milestones{/number}","notifications_url":"https://api.github.com/repos/ajvb/iprepd-nginx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajvb/iprepd-nginx/labels{/name}","releases_url":"https://api.github.com/repos/ajvb/iprepd-nginx/releases{/id}","deployments_url":"https://api.github.com/repos/ajvb/iprepd-nginx/deployments","created_at":"2018-10-19T19:55:49Z","updated_at":"2018-10-19T19:55:51Z","pushed_at":"2018-10-23T17:42:45Z","git_url":"git://github.com/ajvb/iprepd-nginx.git","ssh_url":"git@github.com:ajvb/iprepd-nginx.git","clone_url":"https://github.com/ajvb/iprepd-nginx.git","svn_url":"https://github.com/ajvb/iprepd-nginx","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":null,"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":1,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ajvb:master","ref":"master","sha":"b3f169010066aba90601b38c9b9d52c28c3318a8","user":{"login":"ajvb","id":1144310,"node_id":"MDQ6VXNlcjExNDQzMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1144310?v=4","gravatar_id":"","url":"https://api.github.com/users/ajvb","html_url":"https://github.com/ajvb","followers_url":"https://api.github.com/users/ajvb/followers","following_url":"https://api.github.com/users/ajvb/following{/other_user}","gists_url":"https://api.github.com/users/ajvb/gists{/gist_id}","starred_url":"https://api.github.com/users/ajvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajvb/subscriptions","organizations_url":"https://api.github.com/users/ajvb/orgs","repos_url":"https://api.github.com/users/ajvb/repos","events_url":"https://api.github.com/users/ajvb/events{/privacy}","received_events_url":"https://api.github.com/users/ajvb/received_events","type":"User","site_admin":false},"repo":{"id":153834865,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM4MzQ4NjU=","name":"iprepd-nginx","full_name":"ajvb/iprepd-nginx","private":false,"owner":{"login":"ajvb","id":1144310,"node_id":"MDQ6VXNlcjExNDQzMTA=","avatar_url":"https://avatars3.githubusercontent.com/u/1144310?v=4","gravatar_id":"","url":"https://api.github.com/users/ajvb","html_url":"https://github.com/ajvb","followers_url":"https://api.github.com/users/ajvb/followers","following_url":"https://api.github.com/users/ajvb/following{/other_user}","gists_url":"https://api.github.com/users/ajvb/gists{/gist_id}","starred_url":"https://api.github.com/users/ajvb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajvb/subscriptions","organizations_url":"https://api.github.com/users/ajvb/orgs","repos_url":"https://api.github.com/users/ajvb/repos","events_url":"https://api.github.com/users/ajvb/events{/privacy}","received_events_url":"https://api.github.com/users/ajvb/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ajvb/iprepd-nginx","description":null,"fork":false,"url":"https://api.github.com/repos/ajvb/iprepd-nginx","forks_url":"https://api.github.com/repos/ajvb/iprepd-nginx/forks","keys_url":"https://api.github.com/repos/ajvb/iprepd-nginx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ajvb/iprepd-nginx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ajvb/iprepd-nginx/teams","hooks_url":"https://api.github.com/repos/ajvb/iprepd-nginx/hooks","issue_events_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/events{/number}","events_url":"https://api.github.com/repos/ajvb/iprepd-nginx/events","assignees_url":"https://api.github.com/repos/ajvb/iprepd-nginx/assignees{/user}","branches_url":"https://api.github.com/repos/ajvb/iprepd-nginx/branches{/branch}","tags_url":"https://api.github.com/repos/ajvb/iprepd-nginx/tags","blobs_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/refs{/sha}","trees_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ajvb/iprepd-nginx/statuses/{sha}","languages_url":"https://api.github.com/repos/ajvb/iprepd-nginx/languages","stargazers_url":"https://api.github.com/repos/ajvb/iprepd-nginx/stargazers","contributors_url":"https://api.github.com/repos/ajvb/iprepd-nginx/contributors","subscribers_url":"https://api.github.com/repos/ajvb/iprepd-nginx/subscribers","subscription_url":"https://api.github.com/repos/ajvb/iprepd-nginx/subscription","commits_url":"https://api.github.com/repos/ajvb/iprepd-nginx/commits{/sha}","git_commits_url":"https://api.github.com/repos/ajvb/iprepd-nginx/git/commits{/sha}","comments_url":"https://api.github.com/repos/ajvb/iprepd-nginx/comments{/number}","issue_comment_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/comments{/number}","contents_url":"https://api.github.com/repos/ajvb/iprepd-nginx/contents/{+path}","compare_url":"https://api.github.com/repos/ajvb/iprepd-nginx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ajvb/iprepd-nginx/merges","archive_url":"https://api.github.com/repos/ajvb/iprepd-nginx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ajvb/iprepd-nginx/downloads","issues_url":"https://api.github.com/repos/ajvb/iprepd-nginx/issues{/number}","pulls_url":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls{/number}","milestones_url":"https://api.github.com/repos/ajvb/iprepd-nginx/milestones{/number}","notifications_url":"https://api.github.com/repos/ajvb/iprepd-nginx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ajvb/iprepd-nginx/labels{/name}","releases_url":"https://api.github.com/repos/ajvb/iprepd-nginx/releases{/id}","deployments_url":"https://api.github.com/repos/ajvb/iprepd-nginx/deployments","created_at":"2018-10-19T19:55:49Z","updated_at":"2018-10-19T19:55:51Z","pushed_at":"2018-10-23T17:42:45Z","git_url":"git://github.com/ajvb/iprepd-nginx.git","ssh_url":"git@github.com:ajvb/iprepd-nginx.git","clone_url":"https://github.com/ajvb/iprepd-nginx.git","svn_url":"https://github.com/ajvb/iprepd-nginx","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":null,"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":1,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1"},"html":{"href":"https://github.com/ajvb/iprepd-nginx/pull/1"},"issue":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/1"},"comments":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ajvb/iprepd-nginx/statuses/3665c4fa1be474507ef91a4a4e94a3a6c5b2281b"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ameihm0912"}}