Skip to content

Commit

Permalink
more config
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed May 8, 2024
1 parent 02eaec1 commit 0e2fe35
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM docker.io/fedora:40

RUN dnf -y update && dnf -y install unbound
RUN dnf -y update && dnf -y install unbound openssl bind-utils

ADD entrypoint.sh /

Expand All @@ -9,4 +9,6 @@ EXPOSE 53/tcp
EXPOSE 443/tcp
EXPOSE 853/tcp

ENTRYPOINT sh /entrypoint.sh
COPY local.d/* /etc/unbound/local.d/

ENTRYPOINT sh /entrypoint.sh
14 changes: 12 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/sh

if [ ! -f /etc/unbound/unbound_control.key ]; then
unbound-control-setup
if [ ! -f /etc/pki/tls/private/unbound.pem ]; then
openssl ecparam -name prime256v1 -genkey -noout -out /etc/pki/tls/private/unbound.pem
chown unbound /etc/pki/tls/private/unbound.pem
fi


if [ ! -f /etc/pki/tls/certs/unbound.pem ]; then
openssl req -new -x509 \
-key /etc/pki/tls/private/unbound.pem \
-out /etc/pki/tls/certs/unbound.pem \
-subj "/CN=unbound" \
-days 1000
fi

/usr/sbin/unbound -d
6 changes: 6 additions & 0 deletions local.d/listen.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface: 0.0.0.0@53
interface: ::@53
interface: 0.0.0.0@443
interface: ::@443
interface: 0.0.0.0@853
interface: ::@853
3 changes: 3 additions & 0 deletions local.d/logging.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
statistics-interval: 0
logfile: ""
use-syslog: no
2 changes: 2 additions & 0 deletions local.d/tls.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tls-service-key: /etc/pki/tls/private/unbound.pem
tls-service-pem: /etc/pki/tls/certs/unbound.pem
14 changes: 0 additions & 14 deletions unbound.conf

This file was deleted.

0 comments on commit 0e2fe35

Please sign in to comment.