Source code for ipv4.fetus.jp.
Download allocation data from the Regional Internet Registry (RIR) and provide up-to-date information on the web.
The downloaded data is provided in the form of "start address" and "addresses from it", but this project converts them to CIDR format. In addition, it provides a consolidated list of adjacent blocks and address list that can be used for access control in Apache, Nginx, etc.
I think that it is sufficient to use the data provided on the site as usual, but if you really want to manage it yourself, you can build and operate the server from this source.
Check the following page for instructions on access intervals, etc. https://ipv4.fetus.jp/about#automation
https://github.com/fetus-hina/ipv4.fetus.jp-exports
Set up PHP, Node.js and PostgreSQL
Create a role(user)
and a database
on PostgreSQL.
See config/components/db/db.php for default settings.
Of course you can set them up differently than default configurations.
If you change the settings, adjust the configuration file after clone
and before make
in the next step.
Build the app
$ git clone https://github.com/fetus-hina/ipv4.fetus.jp.git
$ cd ipv4.fetus.jp
$ touch .production
$ make
$ ./yii migrate/up --interactive=0
Update the database (takes about 30 minutes).
./yii update
Set up a web server
$ git fetch --prune origin
$ git merge --ff-only origin/master
$ make
$ ./yii migrate/up --interactive=0
Use "cron" or "systemd timer" to run the following command about once a day.
/path/to/yii update --interactive=0
Copyright (C) AIZAWA Hina MIT License