From b15e5d8b23b9d8d369be289d0126275f25f1e1eb Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 2 Aug 2018 15:50:37 -0300 Subject: Adds OpenBSD autoupgrade and tor-relay recipes thanks to a contribution --- share/trashman/autoupgrade/info | 1 + share/trashman/autoupgrade/unix/openbsd/install | 10 +++++++ share/trashman/tor-relay/info | 1 + share/trashman/tor-relay/unix/openbsd/install | 35 +++++++++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 share/trashman/autoupgrade/info create mode 100755 share/trashman/autoupgrade/unix/openbsd/install create mode 100644 share/trashman/tor-relay/info create mode 100755 share/trashman/tor-relay/unix/openbsd/install (limited to 'share') diff --git a/share/trashman/autoupgrade/info b/share/trashman/autoupgrade/info new file mode 100644 index 0000000..7883790 --- /dev/null +++ b/share/trashman/autoupgrade/info @@ -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 index 0000000..219798d --- /dev/null +++ b/share/trashman/autoupgrade/unix/openbsd/install @@ -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 index 0000000..b89fc0f --- /dev/null +++ b/share/trashman/tor-relay/info @@ -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 index 0000000..0455300 --- /dev/null +++ b/share/trashman/tor-relay/unix/openbsd/install @@ -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 -- cgit v1.2.3