Project: requestbin.net
Demo: https://requestbin.net
Author: cuongmx@gmail.com
Repository: https://github.com/requestbin/requestbin.net
Blog: https://requestbin.net/post/whats-new-in-the-next-gen-requestbin
Release date: 05 May 2022
Current verion: 2.0
Features:
- Support both DNS and HTTP on an unique ID
- Support automatically storing the list of IDs
- Blog
To install an instance like requestbin.net, you need some bellow things:
- A domain with full DNS control
- A Heroku account
- A VPS run linux server
- A mongodb server
There are 3 parts in a requestbin.net system:
- Main website run on Heroku
- DNS server for DNSBin
- Blog
First, clone this repo using git:
$ git clone https://github.com/requestbin/requestbin.net.git
From the project directory, create a Heroku application:
$ heroku create
Set an environment variable to indicate production:
$ heroku config:set SERVER_NAME=requestbin.net
$ heroku config:set MONGODB_URI=mongodb://user:Passsword@exampleserver:port/db?retryWrites=true
Now just deploy via git:
$ git push heroku master
It will push to Heroku and give you a URL that your own private RequestBin will be running.
Important: The RequestBin Next Gen run like "Multi-Tenant". So, the domain config step bellow is very important: Set main domain as normal:
$ heroku domains:add requestbin.net
The CNAME got after this command like whispering-xxx.herokudns.com. is use for DNS config.
Next, add wildcard subdomain for "Multi-Tenant"
$ heroku domains:add *.b.requestbin.net
The CNAME got after this command like whispering-example.herokudns.com. must be memory for next step.
This step must be done on the prepared server.
$ git clone https://github.com/requestbin/requestbin.net.git
$ cd dnsbin/
$ mv dnsbin.sh.example dnsbin.sh
Change MONGODB_URI and WORK_PATH as your system. Especially, change the CNAME as the CNAME which you got after config *.b.requestbin.net at last step.
Because you cannot open directly port 53, you must open another and forward port via Iptables via bellow rules:
-A PREROUTING -i eth0 -p tcp -m tcp --dport 53 -j REDIRECT --to-ports 8853
-A PREROUTING -i eth0 -p udp -m udp --dport 53 -j REDIRECT --to-ports 8853
-A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8853 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 8853 -j ACCEPT
Read here for the guide to install supervisor
After that, use the file at dnsbin/supervisor.conf
for the dnsbin application.
On this step, you must use the DNS controller to add 2 records bellow:
- Add a "A" record for the domain "ns1.requestbin.net" that points to "the server ip".
- Add a "NS" record for the domain "b.requestbin.net" with the value "the server ip".
The blog on requestbin.net/blog is automatically synchronized from our Github repo https://github.com/requestbin/blog
You can setup a repo like the requestbin/blog with bellow steps:
$ cd blogsync
$ mv blogsync.sh.example blogsync.sh
Change MONGODB_URI, BLOG_REPO as yours. The BLOG_REPO's format is requestbin/blog
$ bash blogsync.sh
You can run it periodically by installing via crontab.