No description
src | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.yarnrc.yml | ||
asn_blacklist | ||
config.example.toml | ||
LICENSE.txt | ||
package.json | ||
README.md | ||
tsconfig.json | ||
whitelister.service | ||
yarn.lock |
Whitelister ETERNAL
A node.js server that can be used with Nginx Auth Requests to filter out VPN/Proxy/Datacenter IPs using a couple methods
Jumpstart
- Clone the repo
- Copy
config.example.toml
toconfig.toml
and fill out necessary fields - Install dependencies:
yarn
- Build the TypeScript:
yarn build
- Run it:
yarn serve
ornode ./dist/index.js
Nginx setup
This is designed to be used with Nginx Auth Requests. You can include it in your config as follows:
Make SURE that if your site is proxied with Cloudflare that you comment and uncomment the indicated lines, or you will be vulnerable to IP spoofing due to the non-standard way Cloudflare sets the X-Forwarded-For header.
upstream whitelister {
server 127.0.0.1:3000; # If you changed the port in config.toml, change here too
}
server {
# ...
location /whitelister/ {
internal;
proxy_pass http://whitelister/auth;
# Comment this if you use Cloudflare
proxy_set_header X-Forwarded-For $remote_addr;
# Uncomment this if you do NOT use Cloudflare
# proxy_set_header X-Forwarded-For $http_cf_connecting_ip;
}
location /path-i-want-protected/ {
# ...
auth_request /whitelister/;
}
}