Giter Club home page Giter Club logo

cf-temp-whitelist's Introduction


CloudFlare temporary IP whitelist

The objective is to allow manualy add IP into CF whitelist to check site from geo restricted regions. For examples we block all customers form Ukraine as not relevant country, but we work from Ukraine. It's ok to whitelist office IP. But if you need some urjent check from mobile phone it would be a problem. To allow fast IP whitelist small opt-in form was created.

tech

Depolyed to Vercel.com, their FaaS used for connecting to CF API.

API methods

  • /api/add: will add yours ip to whitelist, in responce
{"listed":true,"ip":"x.x.x.x"}

or

{"listed":false,"err":"some error"}
  • /api/check: will return yours ip status, like is it already listed or not (permanent listing also will result true)
{"listed":true,"ip":"x.x.x.x"}

or

{"listed":false,"err":"some error"}
  • /api/clean: this method used for removing all temp ip's from cloudflare. It should be called in desired amount of time.
{"cleaned":true,"count":10}

or

{"cleaned":false,"err":"some error"}

Cron

There is no cron avalible at vercel. Read an issue That's why we use assertible.com, service for api monitoring as a solution for triggering /api/clean/ once a day. Also it validates amount of temp records added every day, and if amount will be suspicios will fire email alert.

CF API (#todo)

Unfortunately nodejs API for CF is not complete. Thats why PR from original repo currently used: cloudflare/node-cloudflare#78

cf-temp-whitelist's People

Contributors

nosovk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.