{"id":13930129,"url":"https://github.com/balucio/dnsmasq-webgui","last_synced_at":"2025-07-19T12:31:39.198Z","repository":{"id":41663209,"uuid":"257590192","full_name":"balucio/dnsmasq-webgui","owner":"balucio","description":"Simple web gui for dnsmasq","archived":false,"fork":false,"pushed_at":"2024-08-18T05:50:28.000Z","size":4789,"stargazers_count":35,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-18T06:44:45.023Z","etag":null,"topics":["dnsmasq","python","react-hooks","systemd-notify","typescript","webgui"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balucio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-21T12:34:51.000Z","updated_at":"2024-08-18T05:49:29.000Z","dependencies_parsed_at":"2023-02-08T06:31:22.098Z","dependency_job_id":"0d4165be-5c84-4844-b034-90e77a524c30","html_url":"https://github.com/balucio/dnsmasq-webgui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balucio%2Fdnsmasq-webgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balucio%2Fdnsmasq-webgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balucio%2Fdnsmasq-webgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balucio%2Fdnsmasq-webgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balucio","download_url":"https://codeload.github.com/balucio/dnsmasq-webgui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226607597,"owners_count":17658482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dnsmasq","python","react-hooks","systemd-notify","typescript","webgui"],"created_at":"2024-08-07T18:04:48.621Z","updated_at":"2024-11-26T19:30:52.331Z","avatar_url":"https://github.com/balucio.png","language":"TypeScript","funding_links":[],"categories":["typescript"],"sub_categories":[],"readme":"## *dnsmasq* Web Gui\n\nThis is a very simple project written in *Python* and *React* in order to manage the **dnsmasq** *hosts* file.\n\nThere are two folders:\n\n- `dns-backend`: contains the API written in python using Flask framework, and some others tools to sync the DNS hosts file.\n- `dns-webgui` folder contains the web gui itself. The Webgui is written in typescript using React Hooks.\n\n### Web-Gui\n\nActually the web-gui it is a very simple React application. It present all hosts in browser using a table with classic web editing button.\n\nIn order to use the Web-Gui, first of all you need to compile React application using `yarn build` command. Then put the compiled application (files created in build directory) on the root directory or other directory of WebServer.\n\n### Dns-Backend\n\nThe back-end is a Python application that use *flask* framework. The *dns-backend* uses an **sqlite3** database file in order to keep the list of DNS names (actually only `A` and `AAAA` records). All editing operation are performed on `hosts.db` **sqlite3** database file. The hosts file of *dnsmasq* is never directly updated.\n\n### Tools and sync service\n\nInside `dns-backend` folder, there are some others scripts and **systemd** descriptors files. These files are used in order to update the **dnsmasq** hosts file with modifications made on *web-gui*.\n\n- `dnsapplyconfig.sh` it is a bash script used to apply the new configuration and restart `dnsmasq` service. This script will generate a new `hosts` file for **dnsmasq**, then copy the new file on DNS server using `scp`, and then using  `ssh` restart the service. You have to edit this script and change the line `dns_host=\"dns.example.it\"` using the *hostname* or ip address of your DNS server. Also it is required a *passwordless* `ssh`, so that the computer where the script runs can connect to DNS server without password.\n- `dnsmasq-genhosts.py` this python script is used by `dnsapplyconfig.sh` in order to create a new `hosts` file from the **sqlite3** `hosts.db` database.\n- `dnsmonitor.path`: it is a **systemd** descriptor *path* used to keep monitored the `/var/www/cgi-bin/dnsapi/hosts.db` for modifications.\n\n- `dnsmonitor.service`: it is the **systemd** descriptor *service* triggered by `dnsmonitor.path` when a change to `hosts.db` occurs. This service will run the `dnsapplyconfig.sh` script in order to update the dns configuration.\n\n\n### Compilation\n\nHere a very short guide on how to compile the _front-end_\n\n```bash\ngit clone https://github.com/balucio/dnsmasq-webgui.git\ncd dnsmasq-webgui/dns-webgui\n# this will install the dependency\nyarn install\n# this will build the compiled web application, take a break because it requires time\nyarn build\n```\n\nFor latest `yarn` version you should add :\n\n```\nexport NODE_OPTIONS=--openssl-legacy-provider\nnpx update-browserslist-db@latest\n```\nsee [Stackoverflow](https://stackoverflow.com/questions/69394632/webpack-build-failing-with-err-ossl-evp-unsupported)\n\nAt end you should find the compiled application in build directory, you can test it using\n\n```\nDANGEROUSLY_DISABLE_HOST_CHECK=true yarn start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalucio%2Fdnsmasq-webgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalucio%2Fdnsmasq-webgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalucio%2Fdnsmasq-webgui/lists"}