]> gitweb.fluxo.info Git - trashman.git/commitdiff
Adds OpenBSD autoupgrade and tor-relay recipes thanks to a contribution
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 2 Aug 2018 18:50:37 +0000 (15:50 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 2 Aug 2018 18:50:37 +0000 (15:50 -0300)
share/trashman/autoupgrade/info [new file with mode: 0644]
share/trashman/autoupgrade/unix/openbsd/install [new file with mode: 0755]
share/trashman/tor-relay/info [new file with mode: 0644]
share/trashman/tor-relay/unix/openbsd/install [new file with mode: 0755]

diff --git a/share/trashman/autoupgrade/info b/share/trashman/autoupgrade/info
new file mode 100644 (file)
index 0000000..7883790
--- /dev/null
@@ -0,0 +1 @@
+makes your system self-update automatically
diff --git a/share/trashman/autoupgrade/unix/openbsd/install b/share/trashman/autoupgrade/unix/openbsd/install
new file mode 100755 (executable)
index 0000000..219798d
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+#
+# Automated upgrades, base system and packages.
+#
+
+# Add upgrade commands into root's crontab
+echo 5 0 * * * syspatch      >> /var/cron/tabs/root
+echo 5 1 * * * pkg_check     >> /var/cron/tabs/root
+echo 5 2 * * * pkg_add -u    >> /var/cron/tabs/root
+echo 5 3 * * * pkg_delete -a >> /var/cron/tabs/root
diff --git a/share/trashman/tor-relay/info b/share/trashman/tor-relay/info
new file mode 100644 (file)
index 0000000..b89fc0f
--- /dev/null
@@ -0,0 +1 @@
+tor daemon configured as a relay
diff --git a/share/trashman/tor-relay/unix/openbsd/install b/share/trashman/tor-relay/unix/openbsd/install
new file mode 100755 (executable)
index 0000000..0455300
--- /dev/null
@@ -0,0 +1,35 @@
+#!/usr/bin/env sh
+#
+# Configure a tor daemon system-wide.
+#
+
+# Firewall config
+echo set limit states = 100000 >> /etc/pf.conf
+echo pass in log on egress proto tcp from any to any port { 9001 9030 }  >> /etc/pf.conf
+echo pass out log on egress proto tcp from any to any port { 9001 9030 } >> /etc/pf.conf
+
+# Apply firewall rules
+pfctl -f /etc/pf.conf
+
+# Set 
+echo https://ftp.openbsd.org >> /etc/installurl
+
+# Install Tor
+pkg_add -vv tor
+
+# Configure Tor
+echo SOCKSPort 0         >> /etc/tor/torrc
+echo ORPort 9001         >> /etc/tor/torrc
+echo Nickname Baiacu     >> /etc/tor/torrc
+echo Exitrelay 0         >> /etc/tor/torrc
+echo DirPort 9030        >> /etc/tor/torrc
+
+# Sysctl config
+echo kern.maxfiles=20000 >> /etc/sysctl.conf
+# Login config
+echo -e "tor:\/n:openfiles-max=8192:\ :tc=daemon:" >> /etc/login.conf
+
+# Run Tor
+rcctl enable tor
+rcctl start tor