Coder Social home page Coder Social logo

pixeldrew / hero-masq Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.36 MB

Frontend for dnsmasq, written with reactjs, next.js and apollo graphql. Easily deployable to a docker container.

License: MIT License

Dockerfile 1.29% JavaScript 95.99% Shell 2.72%
dnsmasq nextjs reactjs docker graphql apollo

hero-masq's Introduction

hero-masq

Copyright 2020 Drew Foehn [email protected] License: MIT

Lightweight web frontend for dnsmasq.

Built with Next.js, Apollo GraphQL, React and Material Ui

Node.js CIcodecovDependabot Status

To test locally:

git clone https://github.com/pixeldrew/hero-masq.git
cd hero-masq/
cp .env.default .env
npm install
npm run dev

ENV Options are as follows:

PORT=3000 # port to access webapp
USER_NAME=admin #admin username
PASSWORD=dnsMasq01 #admin password
JWT_SECRET=auniquetokenmakeitcomplex123 #jwt encoding token, keep this secret
HOST_IP=192.168.0.2/24 # host ip
ROUTER_IP=192.168.0.1 # gateway ip to send to DHCP clients
DNSMASQ_CONF_LOCATION="/usr/local/etc/dnsmasq.d/" # location to save configuration
SERVICE_MANAGER=service # supports "service" for freebsd/debian installs or the docker controller "supervisor"
DNS=1.1.1.1 # upstream dns server used by dnsmasq

How This Works

Dnsmasq should be running on the host you're running the frontend from.

Dnsmasq configuration is written to ${DNSMASQ_CONF_LOCATION}/hero-masq.conf. The dnsmasq service is then restarted. In order for this to work, make sure you have correctly configure the env property SERVICE_MANAGER, also the default dnsmasq.conf should have a conf-dir line like this:

conf-dir=/etc/dnsmasq.d,*.conf

Docker

A standalone docker image with dnsmasq has been created. If you want dnsmasq to give dhcp replies it requires the docker container to have it's network to be configured as host. See the docker-compose.yml example for more advanced example like using a dns-crypt proxy as the upstream dns server. From 1.0.4 builds for pixeldrew/hero-masq are being made for both armv7 and amd64.

To run in docker:

# docker run --name hero-masq_hero-masq_1 --network=host --cap-add=NET_ADMIN -P -e ROUTER_IP=192.168.0.1 -e PASSWORD=adminpassword -e JWT_SECRET=somethingrandom -e HOST_IP=192.168.0.2/24 -d pixeldrew/hero-masq

Docker-compose (make sure you update the environment section in the supplied docker-compose.yml to match yours)

# docker-compose up --build

If you're not running in Docker, I suggest running this in an iocage or something similar as root permissions are needed to write dnsmasq configs and to reload the configs.

Why?

I built this when I found out my new router couldn't run DD-WRT and only had a DHCP server with no integragated DNS. I like having a local dns so I have user friendly machine name access.

Future

See .plan if you're looking to help out

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.