This guide provides instructions on how to set up and use the project.
- Create a new database and user:
CREATE DATABASE whynoipv6;
CREATE USER whynoipv6 with encrypted password '<removed>';
GRANT ALL PRIVILEGES ON DATABASE whynoipv6 TO whynoipv6;
GRANT USAGE ON SCHEMA public TO whynoipv6;
GRANT CREATE ON SCHEMA public TO whynoipv6;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO whynoipv6;
CREATE EXTENSION pgcrypto;
Create a new user and install folders
useradd -m -d /opt/whynoipv6/ ipv6
mkdir -p /opt/whynoipv6/{whynoipv6,whynoipv6-web,whynoipv6-campaign}
chown -R ipv6:ipv6 /opt/whynoipv6
Clone all the repo's
su - ipv6
git clone https://github.com/lasseh/whynoipv6.git /opt/whynoipv6/whynoipv6/
git clone https://github.com/lasseh/whynoipv6-web.git /opt/whynoipv6/whynoipv6-web/
git clone https://github.com/lasseh/whynoipv6-campaign /opt/whynoipv6/whynoipv6-campaign/
- Edit the env file:
cp app.env.example app.env
vim app.env
- Run the database migrations:
make migrateup
- Start Tranco List downloader
Edit the tldbwriter.toml file with database details
cp tldbwriter.toml.example tldbwriter.toml
vim tldbwriter.toml
make tldbwriter
ctrl-c after: time until next check: 1h0m9s
- Copy the service files
cp /opt/whynoipv6/whynoipv6/extra/systemd/* /etc/systemd/system
systemctl daemon-reload
- Import data:
/opt/whynoipv6/go/bin/v6manage import
/opt/whynoipv6/go/bin/v6manage campaign import
- Start services
systemctl enable --now whynoipv6-api
systemctl enable --now whynoipv6-crawler
systemctl enable --now whynoipv6-campaign-crawler
Create folder for the html
mkdir /var/www/whynoipv6.com/
chown ipv6:ipv6 /var/www/whynoipv6.com/
-
Download the latest MaxMind Geo database from the following link:
https://github.com/P3TERX/GeoLite.mmdb/releases
-
Replace the existing database file with the downloaded file to update the database.
journalctl -o cat -fu whynoipv6-c* | ccze -A
journalctl -o cat -fu whynoipv6-api | ccze -A
- Create a read-only sql user:
CREATE USER whynoipv6_read WITH PASSWORD '<removed>';
GRANT CONNECT ON DATABASE whynoipv6 TO whynoipv6_read;
GRANT USAGE ON SCHEMA public TO whynoipv6_read;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO whynoipv6_read;
- Add the following to the
pg_hba.conf
file:
host graph.domain.com whynoipv6_read