various fixes, internal mail server
[distro-setup] / distro-end
index 22e732683bb1244b7c2dba3f5eb2dc395a0b0fda..a0a6608f667696fe9619943f1b1e4cf7eb039d44 100755 (executable)
@@ -32,7 +32,6 @@ spa() { # simple package add
     simple_packages+=($@)
 }
 
-
 distro=$(distro-name)
 
 pending_reboot=false
@@ -78,6 +77,7 @@ case $HOSTNAME in
             gnome-screenshot
             i3lock
             jq
+            linux-doc
             locate
             manpages
             manpages-dev
@@ -254,6 +254,27 @@ case $HOSTNAME in
         s sed -ri "s/^ *(serverpassword=).*/\1$(< /a/bin/bash_unpublished/mumble_pass)/" /etc/mumble-server.ini
         sgo mumble-server
 
+        vpn-server-setup -d
+
+        sudo dd of=/etc/systemd/system/vpnmail.service <<EOF
+[Unit]
+Description=Turns on iptables mail nat
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.8.0.4:25
+ExecStop=/sbin/iptables -t nat -D PREROUTING -i eth0 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.8.0.4:25
+
+[Install]
+WantedBy=openvpn.service
+EOF
+        ser daemon-reload
+        ser enable vpnmail.service
+        acme-tiny-wrapper mail.iankelling.org
+        sgo openvpn
+
+
         echo "$0: $(date): ending now)"
         exit 0
         ;;
@@ -262,7 +283,15 @@ esac
 
 ########### end section including li/lj ###############
 
-
+if private-host; then
+    vpn-mk-client-cert -n mail li
+    echo "ifconfig-push 10.8.0.4 255.255.255.0" | ssh root@li dd of=/etc/openvpn/client-config/$(openssl x509 -noout -subject -in mail.crt | sed -r 's/.*CN *= *([^,]+).*/\1/')
+fi
+ser enable mailroute
+if [[ $HOSTNAME == treetowl ]]; then
+    # note, this will need to be changed when the mail host changes
+    sgo openvpn-client@mail
+fi
 
 ## android studio setup
 # this contains the setting for android sdk to point to
@@ -276,19 +305,6 @@ lnf /a/opt/.AndroidStudio2.2 ~
 spa lib32stdc++6 default-jdk
 
 
-if [[ $HOSTNAME == frodo ]]; then
-    case $distro in
-        ubunut|debian)
-            pi libsqlite3-dev
-            cd /a/opt/duperemove
-            make clean
-            make
-            s make install
-            ;;
-        #others unknown
-    esac
-fi
-
 case $distro in
     arch) pi syncthing ;;
     ubuntu|debian)