gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: debian: compat level, removal of user un


From: gnunet
Subject: [gnunet] branch master updated: debian: compat level, removal of user units, tweaks
Date: Sun, 01 Aug 2021 12:29:53 +0200

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

dold pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 2032f3ce3 debian: compat level, removal of user units, tweaks
2032f3ce3 is described below

commit 2032f3ce3ed0ed7a6c1c6fb9df6222d85758bf70
Author: Florian Dold <florian@dold.me>
AuthorDate: Sun Aug 1 12:26:20 2021 +0200

    debian: compat level, removal of user units, tweaks
---
 debian/changelog       |   8 +++
 debian/control         |   2 +-
 debian/gnunet.postinst | 178 ++++++++++++++++---------------------------------
 3 files changed, 65 insertions(+), 123 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f27aba2af..b78688984 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gnunet (0.14.1-12) unstable; urgency=low
+
+  * Lower debhelper compatibility level to 12.
+  * Do not inject user units in postinst for now.
+  * Tweaks to packaging.
+
+ -- Florian Dold <florian@dold.me>  Sat, 31 Jul 2021 20:04:42 +0200
+
 gnunet (0.14.1-11) unstable; urgency=low
 
   * Make configuration parsing more permissive.
diff --git a/debian/control b/debian/control
index 01b549286..57acc6e1e 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Build-Depends:
  autoconf (>=2.59),
  automake (>=1.11.1),
  autopoint,
- debhelper-compat (= 13),
+ debhelper-compat (= 12),
  gettext,
  iptables,
  libbluetooth-dev,
diff --git a/debian/gnunet.postinst b/debian/gnunet.postinst
index b6317f5be..091feb223 100644
--- a/debian/gnunet.postinst
+++ b/debian/gnunet.postinst
@@ -108,114 +108,63 @@ case "${1}" in
                        echo " done."
                fi
 
-                # Install GNUnet configuration for all users provided non 
exists
-               userlist=$(awk -F ':' '$3>=1000 && $3<2000 {print $1}' 
/etc/passwd)
-               users=($userlist)
-               homedirlist=$(awk -F ':' '$3>=1000 && $3<2000 {print $6}' 
/etc/passwd)
-                homedirs=($homedirlist)
-
-               for (( i=0; i<${#users[@]}; i++ )); do
-                   usermod -aG gnunet ${users[$i]}
-                    if [ -n "$i" ]  && [ -d "${homedirs[$i]}" ]; then
-                                   mkdir -p 
${homedirs[$i]}/.config/systemd/user/
-
-                                   cat > 
"${homedirs[$i]}/.config/systemd/user/gnunet-user.service" << EOF
-# Copyright (C) 2019 GNUnet e.V.
+#      # Change the proxy settings for Firefox and Chromium if desired
+#              if ${_PROXY}
+#        then
+#                  mkdir -p /etc/X11/xinit/xinitrc.d/
+#cat > "/etc/X11/xinit/xinitrc.d/80-gnunet-user-services" << "EOF"
+##!/bin/bash
+#systemctl --user daemon-reload
+#systemctl --user start gnunet-user
+#systemctl --user enable gnunet-user
+#user=$(whoami)
+#gnunet_proxy=$(gnunet-config -c /etc/skel/.config/gnunet.conf -s gns-proxy | 
grep 'IMMEDIATE_START = YES')
 #
-# Copying and distribution of this file, with or without modification,
-# are permitted in any medium without royalty provided the copyright
-# notice and this notice are preserved.  This file is offered as-is,
-# without any warranty.
-
-[Unit]
-Description=Service that runs a GNUnet for the user gnunet
-After=network.target
-
-[Service]
-Type=forking
-ExecStart=/usr/bin/gnunet-arm -s -c ${homedirs[$i]}/.config/gnunet.conf
-ExecStop=/usr/bin/gnunet-arm -e -c ${homedirs[$i]}/.config/gnunet.conf
-
-[Install]
-WantedBy=multi-user.target
-EOF
-
-                                   chown "${users[$i]}":"${users[$i]}" 
"${homedirs[$i]}/.config/systemd/user/gnunet-user.service"
-                        if [ ! -f "${homedirs[$i]}/.config/gnunet.conf" ]; then
-                                           mkdir -p ${homedirs[$i]}/.config/
-                                           cp /etc/skel/.config/gnunet.conf 
"${homedirs[$i]}/.config/gnunet.conf"
-                                           chmod 644 
"${homedirs[$i]}/.config/gnunet.conf"
-                        fi
-                    fi
-                    port=$((8000+$(id -u "${users[$i]}")))
-                    gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \
-                         --section=gns-proxy \
-                         --option=IMMEDIATE_START \
-                         --value=YES
-                    gnunet-config -c "${homedirs[$i]}/.config/gnunet.conf" \
-                         --section=gns-proxy \
-                         --option=OPTIONS \
-                                    --value="-p $port"
-                               chown "${users[$i]}":"${users[$i]}" 
"${homedirs[$i]}/.config/gnunet.conf"
-               done
-
-                # Change the proxy settings for Firefox and Chromium if desired
-               if ${_PROXY}
-        then
-                   mkdir -p /etc/X11/xinit/xinitrc.d/
-cat > "/etc/X11/xinit/xinitrc.d/80-gnunet-user-services" << "EOF"
-#!/bin/bash
-systemctl --user daemon-reload
-systemctl --user start gnunet-user
-systemctl --user enable gnunet-user
-user=$(whoami)
-gnunet_proxy=$(gnunet-config -c /etc/skel/.config/gnunet.conf -s gns-proxy | 
grep 'IMMEDIATE_START = YES')
-
-# Enable GNS proxy for new users informed by /etc/skel.
-if [ "$gnunet_proxy" ]; then
-
-        # Calculate user specific port
-        port=$((8000+$(id -u $user)))
-
-        gnunet-config -c $HOME/.config/gnunet.conf \
-                --section=gns-proxy \
-                --option=OPTIONS \
-                --value="-p $port"
-
-        # Firefox
-        defaultprofile=$(ls $HOME/.mozilla/firefox/*.default)
-        if [ ! "$defaultprofile" ];then
-                timeout 3s firefox --headless # dirty: create profile if not 
existent
-        fi
-        for ffprofile in $HOME/.mozilla/firefox/*.*/; do
-                js=$ffprofile/user.js
-                if [ -f "$js" ]; then
-                        sed -i '/Preferences for using the GNU Name System/d' 
"$js"
-                        sed -i '/network.proxy.socks/d' "$js"
-                        sed -i '/network.proxy.socks_port/d' "$js"
-                        sed -i '/network.proxy.socks_remote_dns/d' "$js"
-                        sed -i '/network.proxy.type/d' "$js"
-                fi
-                echo "// Preferences for using the GNU Name System" >> "$js"
-                echo "user_pref(\"network.proxy.socks\", \"localhost\");" >> 
"$js"
-                echo "user_pref(\"network.proxy.socks_port\", $port);" >> "$js"
-                echo "user_pref(\"network.proxy.socks_remote_dns\", true);" >> 
"$js"
-                echo "user_pref(\"network.proxy.type\", 1);" >> "$js"
-        done
-
-        # Chromium
-        profile="$HOME/.profile"
-        if [ -f "$profile" ]; then
-                sed -i '/CHROMIUM_USER_FLAGS/d' "$profile"
-        fi
-        echo "export 
CHROMIUM_USER_FLAGS=--proxy-server=socks5://localhost:$port" \
-                >> "$profile"
-fi
-
-# Create/Renew GNS certificate authority (CA) per user.
-gnunet-gns-proxy-setup-ca
-EOF
-                fi
+## Enable GNS proxy for new users informed by /etc/skel.
+#if [ "$gnunet_proxy" ]; then
+#
+#        # Calculate user specific port
+#        port=$((8000+$(id -u $user)))
+#
+#        gnunet-config -c $HOME/.config/gnunet.conf \
+#                --section=gns-proxy \
+#                --option=OPTIONS \
+#                --value="-p $port"
+#
+#        # Firefox
+#        defaultprofile=$(ls $HOME/.mozilla/firefox/*.default)
+#        if [ ! "$defaultprofile" ];then
+#                timeout 3s firefox --headless # dirty: create profile if not 
existent
+#        fi
+#        for ffprofile in $HOME/.mozilla/firefox/*.*/; do
+#                js=$ffprofile/user.js
+#                if [ -f "$js" ]; then
+#                        sed -i '/Preferences for using the GNU Name System/d' 
"$js"
+#                        sed -i '/network.proxy.socks/d' "$js"
+#                        sed -i '/network.proxy.socks_port/d' "$js"
+#                        sed -i '/network.proxy.socks_remote_dns/d' "$js"
+#                        sed -i '/network.proxy.type/d' "$js"
+#                fi
+#                echo "// Preferences for using the GNU Name System" >> "$js"
+#                echo "user_pref(\"network.proxy.socks\", \"localhost\");" >> 
"$js"
+#                echo "user_pref(\"network.proxy.socks_port\", $port);" >> 
"$js"
+#                echo "user_pref(\"network.proxy.socks_remote_dns\", true);" 
>> "$js"
+#                echo "user_pref(\"network.proxy.type\", 1);" >> "$js"
+#        done
+#
+#        # Chromium
+#        profile="$HOME/.profile"
+#        if [ -f "$profile" ]; then
+#                sed -i '/CHROMIUM_USER_FLAGS/d' "$profile"
+#        fi
+#        echo "export 
CHROMIUM_USER_FLAGS=--proxy-server=socks5://localhost:$port" \
+#                >> "$profile"
+#fi
+#
+## Create/Renew GNS certificate authority (CA) per user.
+#gnunet-gns-proxy-setup-ca
+#EOF
+#                fi
 
                # Update files and directories permissions.
                # Assuming default values, this *should* not be changed.
@@ -265,21 +214,6 @@ cat > "${CONFIG_NEW}" <<EOF
 GNUNET_USER=${_USERNAME}
 GNUNET_GROUP=${_GROUPNAME}
 GNUNET_AUTOSTART="${_AUTOSTART}"
-EOF
-
-cat > "/etc/systemd/system/gnunet.service" <<EOF
-[Unit]
-Description=A framework for secure peer-to-peer networking
-
-[Service]
-EnvironmentFile=/etc/default/gnunet
-User=${_USERNAME}
-Type=forking
-ExecStart=/usr/bin/gnunet-arm -s -c /etc/gnunet.conf
-ExecStop=/usr/bin/gnunet-arm -e -c /etc/gnunet.conf
-
-[Install]
-WantedBy=multi-user.target
 EOF
 
                cp -f "${CONFIG_NEW}" "${CONFIG_FILE}"

-- 
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]