aboutsummaryrefslogtreecommitdiffstats
path: root/config/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'config/hooks')
-rwxr-xr-xconfig/hooks/remove-packages.sh.chroot5
-rwxr-xr-xconfig/hooks/tor-usergroup.sh.chroot15
2 files changed, 20 insertions, 0 deletions
diff --git a/config/hooks/remove-packages.sh.chroot b/config/hooks/remove-packages.sh.chroot
new file mode 100755
index 0000000..10fa78b
--- /dev/null
+++ b/config/hooks/remove-packages.sh.chroot
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+apt-get -f -y remove --purge polipo minissdpd
+apt-get -y remove exim4-base exim4-config exim4-daemon-light dbus isc-dhcp-server
+
diff --git a/config/hooks/tor-usergroup.sh.chroot b/config/hooks/tor-usergroup.sh.chroot
new file mode 100755
index 0000000..e46ad16
--- /dev/null
+++ b/config/hooks/tor-usergroup.sh.chroot
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+export ADMINUSER="tor"
+export ADMINGROUP="tor"
+export TORADMINGROUP="debian-tor"
+
+# add users and groups (ignore failures if groups already exist)
+addgroup $ADMINGROUP
+useradd -g $ADMINGROUP -G $TORADMINGROUP -s /bin/bash $ADMINUSER
+# TODO: $ADMINUSER passwd?
+
+# give Tor permission to modify it's own configuration
+chgrp $TORADMINGROUP /etc/tor/ /etc/tor/*
+chmod g+rw /etc/tor/ /etc/tor/*
+