gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: PACKAGES: Update fedora configurations a


From: gnunet
Subject: [gnunet] branch master updated: PACKAGES: Update fedora configurations and scripts
Date: Sun, 16 Oct 2022 11:09:54 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 4ca81ff1a PACKAGES: Update fedora configurations and scripts
4ca81ff1a is described below

commit 4ca81ff1a80980044542d69c53ebb85c64d2435b
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Oct 16 18:09:48 2022 +0900

    PACKAGES: Update fedora configurations and scripts
---
 contrib/packages/fedora/10-dns2gns.sh      | 52 ++++++++++++++++++++++--------
 contrib/packages/fedora/gnunet-system.conf | 12 +++++++
 src/gns/gns.conf.in                        |  6 ++++
 3 files changed, 56 insertions(+), 14 deletions(-)

diff --git a/contrib/packages/fedora/10-dns2gns.sh 
b/contrib/packages/fedora/10-dns2gns.sh
index a27046548..82e97eeed 100644
--- a/contrib/packages/fedora/10-dns2gns.sh
+++ b/contrib/packages/fedora/10-dns2gns.sh
@@ -2,18 +2,42 @@
 interface=$1
 status=$2
 
-if [ "$interface" = "eth0" ]; then
-  case $status in
-    up)
-      if nc -u -z 127.0.0.1 5353; then
-        # Note: We add quad 9 here as a fallback in case our service is down.
-        resolvectl dns $interface 127.0.0.1:5353 9.9.9.9
-      elif
-        # Just in case DNS2GNS was already configured, revert to defaults
-        resolvectl revert $interface
-      fi
-    ;;
-    down)
-    ;;
-  esac
+do_it=$(gnunet-config -s dns2gns -o ENABLE_RESOLVECTL_NMDISPATCHER -c 
/etc/gnunet.conf)
+if [ $? != 0 ]; then
+  exit 1
+fi
+if [ $do_it = "NO" ]; then
+  echo "Setting DNS2GNS through resolvectl disabled."
+  exit 1
 fi
+
+case $status in
+  up)
+    if nc -u -z 127.0.0.1 5353; then
+      # Note: We add quad 9 as a fallback in case our service is down.
+      dns2gns=$(gnunet-config -s dns2gns -o BIND_TO)
+      if [ $? != 0 ]; then
+        exit 1
+      fi
+      dns2gns6=$(gnunet-config -s dns2gns -o BIND_TO6)
+      if [ $? != 0 ]; then
+        exit 1
+      fi
+      port=$(gnunet-config -s dns2gns -o PORT)
+      if [ $? != 0 ]; then
+        exit 1
+      fi
+      olddns=$(resolvectl status $interface | grep "DNS Servers" | cut -d':' 
-f2-)
+      if [ $? == 0 ]; then
+        #echo "Setting to $dns2gns:$port [$dns2gns6]:$port $olddns 9.9.9.9"
+        #resolvectl dns $interface $dns2gns:$port [$dns2gns6]:$port $olddns 
9.9.9.9
+        echo "Setting to $dns2gns:$port [$dns2gns6]:$port"
+        resolvectl dns $interface $dns2gns:$port [$dns2gns6]:$port
+      else
+        exit 1
+      fi
+    fi
+  ;;
+  down)
+  ;;
+esac
diff --git a/contrib/packages/fedora/gnunet-system.conf 
b/contrib/packages/fedora/gnunet-system.conf
new file mode 100644
index 000000000..a0b99dfeb
--- /dev/null
+++ b/contrib/packages/fedora/gnunet-system.conf
@@ -0,0 +1,12 @@
+[path]
+GNUNET_HOME = /var/lib/gnunet/
+GNUNET_DATA_HOME = /var/lib/gnunet/data/
+GNUNET_RUNTIME_DIR = /var/run/gnunet/
+
+[arm]
+START_SYSTEM_SERVICES = YES
+START_USER_SERVICES = NO
+OPTIONS = -l /var/log/gnunet.log
+
+[dns2gns]
+ENABLE_RESOLVECTL_NMDISPATCHER = YES
diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in
index 6cc5bd798..309c7ada2 100644
--- a/src/gns/gns.conf.in
+++ b/src/gns/gns.conf.in
@@ -46,3 +46,9 @@ BIND_TO6=::1
 # -d: DNS resolver to use
 OPTIONS = -d 9.9.9.9
 PORT = 15353
+
+# This setting is useful in combination with systemd-resolve and
+# NetworkManager-dispatcher. It allows the interfaces to automatically
+# configure the dns2gns server for interfaces going up
+# See also: contrib/packages/fedora/10-dns2gns.sh
+ENABLE_RESOLVECTL_NMDISPATCHER = NO

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]