mostly fix mail bugs
authorIan Kelling <ian@iankelling.org>
Thu, 30 Mar 2017 22:58:39 +0000 (15:58 -0700)
committerIan Kelling <ian@iankelling.org>
Thu, 30 Mar 2017 22:58:39 +0000 (15:58 -0700)
btrbk-run
distro-end
mail-route
mail-setup
radicale-setup [moved from radicale-setup.sh with 98% similarity]
vpn-mail-forward

index 97b83e026f55379fddfa3c08de2b98bc4952dce1..4642a708c1328198fb1cad6a66c5f75a8349dda2 100755 (executable)
--- a/btrbk-run
+++ b/btrbk-run
@@ -28,21 +28,23 @@ script_dir=$(dirname $(readlink -f "$BASH_SOURCE"))
 # note q is owned by root:1000
 # note p/m is owned 1000:1000 and chmod 700
 mountpoints=(/a)
-private_mountpoints=(/q /m)
+private_mountpoints=(/q)
 rsync_mountpoint=/q
 
 conf_only=false
 dry_run=false # mostly for testing
 resume_arg=
 do_i=true
+do_o=true
 
-temp=$(getopt -l help hcinprt: "$@") || usage 1
+temp=$(getopt -l help hcinoprt: "$@") || usage 1
 eval set -- "$temp"
 while true; do
     case $1 in
         -c) conf_only=true; shift ;;
         -i) do_i=false; shift ;;
         -n) dry_run=true; dry_run_arg=-n; shift ;;
+        -o) do_o=false; shift ;;
         -p) progress_arg="--progress"; shift ;;
         # btrbk arg: Resume only. Skips snapshot creation.
         -r) resume_arg=-r; shift ;;
@@ -52,7 +54,11 @@ while true; do
         *) echo "$0: Internal error!" ; exit 1 ;;
     esac
 done
-read primary <<<"$@"
+
+if $do_o; then
+    private_mountpoints+=(/o)
+fi
+read primary <<<"$@" # not yet used
 
 ##### end command line parsing ########
 
index 2317edd9df5c46e607d6204c8f8d6a48805ce279..202f85fee2c6ea401a23a872715fa884bf9051de 100755 (executable)
@@ -332,7 +332,7 @@ ser enable mailroute
 if [[ $HOSTNAME == treetowl ]]; then
     # note, this will need to be changed when the mail/contacts host changes
     sgo openvpn-client@mail
-    /a/bin/distro-setup/radicale-setup.sh
+    /a/bin/distro-setup/radicale-setup
 fi
 
 ## android studio setup
@@ -373,10 +373,12 @@ if [[ $HOSTNAME == treetowl ]]; then
             pi syncthing
             ;;
     esac
+    lnf -T /w/syncthing /home/ian/.config/syncthing
     sgo syncthing@ian # runs as ian
 
     # these things persist in ~/.config/syncthing, which I save in
-    # /p/c/machine_specific
+    # /w/syncthing (not in /p, because syncthing should continue to
+    # run on home server even when using laptop as primary device)
     # open http://localhost:8384/
     # change listen address from default to tcp://:22001,
     # this is because we do port forward so it doesn\'t have to use
@@ -452,7 +454,7 @@ EOF
             # it contains runtime data,
             # plus a simple symlink to the config file which it's
             # not worth separating out.
-            s lnf -T /q/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon
+            s lnf -T /i/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon
             #
             # config file documented here, and it's the same config
             # for daemon vs client, so it's documented in the gui.
index f896bfec495dcd27758fd44da90a487846941ec9..dc74c7b5adb6f73912d442cea652b66ab2d2e453 100755 (executable)
@@ -62,8 +62,9 @@ esac
 # match source or dest port. when we send to 25, it picks a random high port as
 # the source.
 
-for port in 25 993; do # smtp and imap with ssl.
-e iptables -t mangle $iptables_op OUTPUT -m tcp -p tcp -m multiport --ports $port -j MARK --set-mark 0x1
+for port in 25 143; do # smtp and imap.
+    e iptables -t mangle $iptables_op \
+      OUTPUT -m tcp -p tcp -m multiport --ports $port -j MARK --set-mark 0x1
 done
 e iptables -t nat $iptables_op POSTROUTING -o tun0 -m mark --mark 0x1 -j SNAT --to-source 10.8.0.4
 e ip rule $ip_op fwmark 1 table 1
index da91b1cf9a013846f7ee15a4aed51b1bee16c9e3..716a8b17ddfcd10628fef84adca377004656824d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash -l
+#!/bin/bash
 # Copyright (C) 2016 Ian Kelling
 
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -430,6 +430,7 @@ Description=Offlineimap sync
 After=multi-user.target
 
 [Service]
+User=ian
 Type=oneshot
 ExecStart=/a/bin/log-quiet/sysd-mail-once offlineimap-sync /a/bin/distro-setup/offlineimap-sync
 EOF
similarity index 98%
rename from radicale-setup.sh
rename to radicale-setup
index 620096a6170ee2ba0adc14169f986980a46d7988..826ddb92f91b9940afad82a72f914318868477c7 100755 (executable)
@@ -20,7 +20,7 @@ pi nginx python-dulwich radicale
 # I moved /var/lib/radicale after it's initialization.
 # I did a sudo -u radicale git init in the collections subfolder
 # after it gets created, per the git docs.
-lnf -T /q/radicale /var/lib/radicale
+lnf -T /o/radicale /var/lib/radicale
 
 acme-tiny -n cal.iank.pw
 
index 9a86e690bb29f3916121c3ec15e86ef79f19dcd1..76da42481e041fad201295ce24a2e1f875621a1d 100755 (executable)
@@ -10,7 +10,7 @@ do-forward() {
     done
 }
 
-ports=(25 993)
+ports=(25 143)
 case $1 in
     start)
         do-forward -A ${ports[@]}