This application was built to monitor the DNS resolutions of MyEtherWallet.com across every known nameserver. It continuously retrieves an updated list of nameservers from public-dns.info, and checks their resolved A records against a configureable list of valid ips for MyEtherWallet.com. The results of each nameserver resolution are stored in Redis for live, up-to-date status reports of each nameserver.
This application also includes a lightweight frontend to interface with the results of the DNS results. It is built in VueJS and uses Superstatic to both serve the built static pages, and operate as a very minimal backend to retrieve the status updates from Redis.
This application requires a .env file be located in the root of the project. Below are the required variables:
# Domain to check/validate
DOMAIN=myetherwallet.com
# URL of production website
PRODUCTION_SITE=https://www.myetherwallet.com
# Name/URL of status site (for title purposes mostly)
STATUS_SITE=status.myetherwallet.com
# URL of github source for file validation
GITHUB_SITE=https://api.github.com/repos/kvhnuke/etherwallet/contents?ref=gh-pages
# Telegram Info
TELEGRAM_KEY=key_here
TELEGRAM_CHAT_ID=chat_id_here
# Twilio Info
TWILIO_ID=twilio_id_here
TWILIO_TOKEN=twilio_token_here
TWILIO_TO_NUMBER=+18001112222
TWILIO_FROM_NUMBER=+18003334444
# Allowed IPs JSON
ALLOWED_IPS=allowed-mew-ips.json
# Force override of local github file check
FORCE_KEY=keyexample
By default, this application runs on port 8080
By default, the application includes an allowed-mew-ips.json
file with an array of valid ips of A record resolutions for MyEtherWallet.com. This file can either be altered to include a desired array of valid ips for a different domain name, or the .env
file can be updated with the variable ALLOWED_IPS to point to a different .json
file containing a similarly formatted array of ips.
To work on changes to this application, the following commands are recommended. Because Redis is used in this application, it is required that it be installed. Although the production setup uses a Docker image of Redis, it is also possible to use redis-server for development purposes.
npm install
sudo apt install redis-server
npm run start:watcher
npm run start:dev
The recommended way to run this application in a production environment is with Docker and Docker Compose, although it is perfectly plausible to run without it.
docker-compose build --no-cache
docker-compose up
npm run start:watcher
npm run build:prod
npm run start:prod
The package.json
file has some options: RES_OPTIONS='retrans:2500 retry:2'
This is to override some default options when looking up DNS records. See: https://stackoverflow.com/questions/10777657/node-js-dns-lookup-how-to-set-timeout