mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 05:04:21 +01:00
This reverts commit ef8a6793f4.
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 1.4
|
||||
|
||||
- Adds support for srv-host records
|
||||
|
||||
## 1.3
|
||||
|
||||
- Rewrites add-on onto Bashio
|
||||
|
||||
@@ -32,12 +32,6 @@ forwards:
|
||||
hosts:
|
||||
- host: home.mydomain.io
|
||||
ip: 192.168.1.10
|
||||
services:
|
||||
- srv: _ldap._tcp.pdc._msdcs.mydomain.io
|
||||
host: dc.mydomain.io
|
||||
port: 389
|
||||
priority: 0
|
||||
weight: 100
|
||||
```
|
||||
|
||||
### Option: `defaults` (required)
|
||||
@@ -82,30 +76,6 @@ The hostname or domainname to resolve locally.
|
||||
|
||||
The IP address Dnsmasq should respond with in its DNS answer.
|
||||
|
||||
### Option: `services` (optional)
|
||||
|
||||
This option allows you to provide srv-host records.
|
||||
|
||||
#### Option: `services.srv`
|
||||
|
||||
The service to resolve.
|
||||
|
||||
#### Option: `services.host`
|
||||
|
||||
The host that contain the service.
|
||||
|
||||
#### Option: `services.port`
|
||||
|
||||
The port number for the service.
|
||||
|
||||
#### Option: `services.priority`
|
||||
|
||||
The priority for the service.
|
||||
|
||||
#### Option: `services.weight`
|
||||
|
||||
The weight for the service.
|
||||
|
||||
## Support
|
||||
|
||||
Got questions?
|
||||
|
||||
@@ -8,5 +8,7 @@ ENV LANG C.UTF-8
|
||||
RUN apk add --no-cache dnsmasq
|
||||
|
||||
# Copy data
|
||||
COPY rootfs /
|
||||
COPY data/run.sh /
|
||||
COPY data/dnsmasq.conf /etc/
|
||||
|
||||
CMD [ "/run.sh" ]
|
||||
|
||||
@@ -2,27 +2,6 @@
|
||||
|
||||
profile dnsmasq flags=(attach_disconnected,mediate_deleted) {
|
||||
#include <abstractions/base>
|
||||
|
||||
/usr/lib/bashio/bashio ix,
|
||||
|
||||
# S6-Overlay
|
||||
/bin/** ix,
|
||||
/usr/bin/** ix,
|
||||
/usr/lib/bashio/** ix,
|
||||
/etc/s6/** ix,
|
||||
/run/s6/** ix,
|
||||
/etc/services.d/** rwix,
|
||||
/etc/cont-init.d/** rwix,
|
||||
/etc/cont-finish.d/** rwix
|
||||
|
||||
# Data access
|
||||
/data/** rw,
|
||||
|
||||
/usr/sbin/dnsmasq cx,
|
||||
}
|
||||
|
||||
profile /usr/sbin/dnsmasq flags=(attach_disconnected,mediate_deleted) {
|
||||
#include <abstractions/base>
|
||||
#include <abstractions/nameservice>
|
||||
|
||||
capability net_bind_service,
|
||||
@@ -32,9 +11,20 @@ profile /usr/sbin/dnsmasq flags=(attach_disconnected,mediate_deleted) {
|
||||
network inet raw,
|
||||
network inet6 raw,
|
||||
|
||||
/bin/busybox ix,
|
||||
/bin/bash ix,
|
||||
/usr/bin/jq ix,
|
||||
/usr/sbin/dnsmasq ix,
|
||||
|
||||
/etc/dnsmasq.conf rw,
|
||||
/run/*dnsmasq*.pid w,
|
||||
/run/dnsmasq/ r,
|
||||
/run/dnsmasq/* rw,
|
||||
/{,var/}run/*dnsmasq*.pid w,
|
||||
/{,var/}run/dnsmasq/ r,
|
||||
/{,var/}run/dnsmasq/* rw,
|
||||
|
||||
/usr/lib/bashio/bashio ix,
|
||||
/dev/tty rw,
|
||||
/tmp/* rw,
|
||||
|
||||
/run.sh rix,
|
||||
/data/** r,
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"build_from": {
|
||||
"aarch64": "homeassistant/aarch64-base:3.13",
|
||||
"amd64": "homeassistant/amd64-base:3.13",
|
||||
"armhf": "homeassistant/armhf-base:3.13",
|
||||
"armv7": "homeassistant/armv7-base:3.13",
|
||||
"i386": "homeassistant/i386-base:3.13"
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "Dnsmasq",
|
||||
"version": "1.4",
|
||||
"version": "1.3",
|
||||
"slug": "dnsmasq",
|
||||
"description": "A simple DNS server",
|
||||
"url": "https://github.com/home-assistant/hassio-addons/tree/master/dnsmasq",
|
||||
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
|
||||
"advanced": true,
|
||||
"startup": "system",
|
||||
"init": false,
|
||||
"ports": {
|
||||
"53/tcp": 53,
|
||||
"53/udp": 53
|
||||
@@ -15,8 +14,7 @@
|
||||
"options": {
|
||||
"defaults": ["8.8.8.8", "8.8.4.4"],
|
||||
"forwards": [],
|
||||
"hosts": [],
|
||||
"services": []
|
||||
"hosts": []
|
||||
},
|
||||
"schema": {
|
||||
"defaults": ["str"],
|
||||
@@ -31,15 +29,6 @@
|
||||
"host": "str",
|
||||
"ip": "str"
|
||||
}
|
||||
],
|
||||
"services": [
|
||||
{
|
||||
"srv": "str",
|
||||
"host": "str",
|
||||
"port": "str",
|
||||
"priority": "int",
|
||||
"weight": "int"
|
||||
}
|
||||
]
|
||||
},
|
||||
"image": "homeassistant/{arch}-addon-dnsmasq"
|
||||
|
||||
7
dnsmasq/data/dnsmasq.conf
Normal file
7
dnsmasq/data/dnsmasq.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
no-resolv
|
||||
no-hosts
|
||||
keep-in-foreground
|
||||
log-queries
|
||||
log-facility=-
|
||||
no-poll
|
||||
user=root
|
||||
31
dnsmasq/data/run.sh
Executable file
31
dnsmasq/data/run.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bashio
|
||||
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}"
|
||||
done
|
||||
|
||||
# Create domain forwards
|
||||
for forward in $(bashio::config 'forwards|keys'); do
|
||||
DOMAIN=$(bashio::config "forwards[${forward}].domain")
|
||||
SERVER=$(bashio::config "forwards[${forward}].server")
|
||||
|
||||
echo "server=/${DOMAIN}/${SERVER}" >> "${CONFIG}"
|
||||
done
|
||||
|
||||
# Create static hosts
|
||||
for host in $(bashio::config 'hosts|keys'); do
|
||||
HOST=$(bashio::config "hosts[${host}].host")
|
||||
IP=$(bashio::config "hosts[${host}].ip")
|
||||
|
||||
echo "address=/${HOST}/${IP}" >> "${CONFIG}"
|
||||
done
|
||||
|
||||
# Run dnsmasq
|
||||
bashio::log.info "Starting dnsmasq..."
|
||||
exec dnsmasq -C "${CONFIG}" -z < /dev/null
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# DNSMASQ config
|
||||
# ==============================================================================
|
||||
|
||||
CONFIG="/etc/dnsmasq.conf"
|
||||
bashio::log.info "Configuring dnsmasq..."
|
||||
tempio \
|
||||
-conf /data/options.json \
|
||||
-template /usr/share/tempio/dnsmasq.config \
|
||||
-out "${CONFIG}"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/execlineb -S0
|
||||
# ==============================================================================
|
||||
# Take down the S6 supervision tree when dnsmasq fails
|
||||
# ==============================================================================
|
||||
if { s6-test ${1} -ne 0 }
|
||||
if { s6-test ${1} -ne 256 }
|
||||
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
CONFIG="/etc/dnsmasq.conf"
|
||||
|
||||
# Run dnsmasq
|
||||
bashio::log.info "Starting dnsmasq..."
|
||||
exec dnsmasq -C "${CONFIG}" -z < /dev/null
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
# Automatically generated do not edit
|
||||
|
||||
no-resolv
|
||||
no-hosts
|
||||
keep-in-foreground
|
||||
log-queries
|
||||
log-facility=-
|
||||
no-poll
|
||||
user=root
|
||||
|
||||
# Default forward servers
|
||||
{{ range .defaults }}
|
||||
server={{ . }}
|
||||
{{ end }}
|
||||
|
||||
# Domain forwards
|
||||
{{ range .forwards }}
|
||||
server=/{{ .domain }}/{{ .server }}
|
||||
{{ end }}
|
||||
|
||||
# Static hosts
|
||||
{{ range .hosts }}
|
||||
address=/{{ .host }}/{{ .ip }}
|
||||
{{ end }}
|
||||
|
||||
# Static srv-hosts
|
||||
{{ range .services }}
|
||||
srv-host={{ .srv }},{{ .host }},{{ .port }},{{ .priority }},{{ .weight }}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user