Skip to content

Commit

Permalink
dnsmasq: Collection of small improvements (home-assistant#899)
Browse files Browse the repository at this point in the history
* dnsmasq: Prettier YAML & JSON files

* dnsmasq: Update add-on URL

* dnsmasq: Pin add-on base images

* dnsmasq: Move data files into data folder

* dnsmasq: Tweaks documentation
  • Loading branch information
frenck authored and pvizeli committed Dec 18, 2019
1 parent f56d653 commit 4fd5cf5
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 31 deletions.
4 changes: 2 additions & 2 deletions dnsmasq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV LANG C.UTF-8
RUN apk add --no-cache dnsmasq

# Copy data
COPY run.sh /
COPY dnsmasq.conf /etc/
COPY data/run.sh /
COPY data/dnsmasq.conf /etc/

CMD [ "/run.sh" ]
10 changes: 5 additions & 5 deletions dnsmasq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ an internal address inside your network.

## Installation

The installation of this add-on is straightforward and easy to do.
Follow these steps to get the add-on installed on your system:

1. Navigate in your Home Assistant frontend to **Hass.io** -> **Add-on Store**.
2. Find the "Dnsmasq" add-on and click it.
Expand Down Expand Up @@ -55,11 +55,11 @@ Google's public DNS servers: `"8.8.8.8", "8.8.4.4".
This option allows you to list domain that are forwarded to a different
(not the default) upstream DNS server.

#### Option: `forwards` -> `domain`
#### Option: `forwards.domain`

The domain to forward to a different upstream DNS server.

#### Option: `forwards` -> `server`
#### Option: `forwards.server`

The DNS server to forward the request for this domain to.

Expand All @@ -76,11 +76,11 @@ it would resolve normally.

This options allows you to create a so called: Split DNS.

#### Option: `hosts` -> `host`
#### Option: `hosts.host`

The hostname or domainname to resolve locally.

#### Option: `hosts` -> `ip`
#### Option: `hosts.ip`

The IP address Dnsmasq should respond with in its DNS answer.

Expand Down
15 changes: 7 additions & 8 deletions dnsmasq/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
trigger:
branches:
include:
- master
- master
paths:
include:
- dnsmasq/*
- dnsmasq/*
pr: none

variables:
- name: versionBuilder
value: '2.0'
value: "2.0"
- group: docker


jobs:
- template: /.azure/azp-template-addon.yml
parameters:
addon: 'dnsmasq'
arch: '--all'
- template: /.azure/azp-template-addon.yml
parameters:
addon: "dnsmasq"
arch: "--all"
9 changes: 9 additions & 0 deletions dnsmasq/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"build_from": {
"aarch64": "homeassistant/aarch64-base:3.10",
"amd64": "homeassistant/amd64-base:3.10",
"armhf": "homeassistant/armhf-base:3.10",
"armv7": "homeassistant/armv7-base:3.10",
"i386": "homeassistant/i386-base:3.10"
}
}
19 changes: 4 additions & 15 deletions dnsmasq/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,21 @@
"version": "1.3",
"slug": "dnsmasq",
"description": "A simple DNS server",
"url": "https://home-assistant.io/addons/dnsmasq/",
"arch": [
"armhf",
"armv7",
"aarch64",
"amd64",
"i386"
],
"url": "https://github.com/home-assistant/hassio-addons/tree/master/dnsmasq",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
"startup": "system",
"boot": "auto",
"ports": {
"53/tcp": 53,
"53/udp": 53
},
"options": {
"defaults": [
"8.8.8.8",
"8.8.4.4"
],
"defaults": ["8.8.8.8", "8.8.4.4"],
"forwards": [],
"hosts": []
},
"schema": {
"defaults": [
"str"
],
"defaults": ["str"],
"forwards": [
{
"domain": "str",
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion dnsmasq/run.sh → dnsmasq/data/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e
CONFIG="/etc/dnsmasq.conf"

bashio::log.info "Configuring dnsmasq..."

# Add default forward servers
for server in $(bashio::config 'defaults'); do
echo "server=${server}" >> "${CONFIG}"
Expand All @@ -25,6 +26,6 @@ for host in $(bashio::config 'hosts|keys'); do
echo "address=/${HOST}/${IP}" >> "${CONFIG}"
done

# run dnsmasq
# Run dnsmasq
bashio::log.info "Starting dnsmasq..."
exec dnsmasq -C "${CONFIG}" -z < /dev/null

0 comments on commit 4fd5cf5

Please sign in to comment.