From 5100809baa7e148abba1db6a3b1e5dbc120094d4 Mon Sep 17 00:00:00 2001 From: priv <140729444+scriptprivate@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:06:26 -0300 Subject: [PATCH] feat: add openSUSE support (#162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(config): create openSUSE torrc configurationĀ file * feat(device): add openSUSE detection * feat(install): add openSUSE installation command --- .configs/opensuse-torrc | 20 ++++++++++++++++++++ lib/Nipe/Utils/Device.pm | 7 ++++++- lib/Nipe/Utils/Install.pm | 5 +++-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .configs/opensuse-torrc diff --git a/.configs/opensuse-torrc b/.configs/opensuse-torrc new file mode 100644 index 0000000..4f5535d --- /dev/null +++ b/.configs/opensuse-torrc @@ -0,0 +1,20 @@ +DataDirectory /var/lib/tor +PidFile /var/run/tor/tor.pid +RunAsDaemon 1 +User tor + +ControlSocket /var/run/tor/control +ControlSocketsGroupWritable 1 + +CookieAuthentication 1 +CookieAuthFileGroupReadable 1 +CookieAuthFile /var/run/tor/control.authcookie + +Log notice file /var/log/tor/log + +ClientOnly 1 +TransPort 9051 +DNSPort 9061 + +VirtualAddrNetwork 10.66.0.0/255.255.0.0 +AutomapHostsOnResolve 1 diff --git a/lib/Nipe/Utils/Device.pm b/lib/Nipe/Utils/Device.pm index 23ade61..5747829 100644 --- a/lib/Nipe/Utils/Device.pm +++ b/lib/Nipe/Utils/Device.pm @@ -28,8 +28,13 @@ package Nipe::Utils::Device { $device{distribution} = "void"; } + elsif (($id_like =~ /[S,s]use/) || ($id_distro =~ /[O,o]pen[S,s]use/)) { + $device{username} = "tor"; + $device{distribution} = "opensuse"; + } + return %device; } } -1; \ No newline at end of file +1; diff --git a/lib/Nipe/Utils/Install.pm b/lib/Nipe/Utils/Install.pm index 1b2ff09..9b240f0 100644 --- a/lib/Nipe/Utils/Install.pm +++ b/lib/Nipe/Utils/Install.pm @@ -12,7 +12,8 @@ package Nipe::Utils::Install { "fedora" => "dnf install -y tor iptables", "centos" => "yum -y install epel-release tor iptables", "void" => "xbps-install -y tor iptables", - "arch" => "pacman -S --noconfirm tor iptables" + "arch" => "pacman -S --noconfirm tor iptables", + "opensuse" => "zypper install -y tor iptables" ); if ($device{distribution} eq "void") { @@ -29,4 +30,4 @@ package Nipe::Utils::Install { } } -1; \ No newline at end of file +1;