Skip to content

Commit

Permalink
feat: add openSUSE support (#162)
Browse files Browse the repository at this point in the history
* feat(config): create openSUSE torrc configuration file

* feat(device): add openSUSE detection

* feat(install): add openSUSE installation command
  • Loading branch information
scriptprivate committed Jun 3, 2024
1 parent 6ab39da commit 5100809
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .configs/opensuse-torrc
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion lib/Nipe/Utils/Device.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1;
5 changes: 3 additions & 2 deletions lib/Nipe/Utils/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -29,4 +30,4 @@ package Nipe::Utils::Install {
}
}

1;
1;

0 comments on commit 5100809

Please sign in to comment.