various fixes
authorIan Kelling <ian@iankelling.org>
Sun, 15 Nov 2020 22:41:29 +0000 (17:41 -0500)
committerIan Kelling <ian@iankelling.org>
Sun, 15 Nov 2020 22:41:29 +0000 (17:41 -0500)
14 files changed:
brc2
btrbk-run
distro-end
dynamic-ip-update
filesystem/etc/systemd/system/openvpn-client-tr@.service
filesystem/etc/systemd/system/transmission-daemon-nn.service [new file with mode: 0644]
filesystem/etc/tr-resolv/stub-resolv.conf [new file with mode: 0644]
i3-sway/common.conf
install-my-scripts
mail-setup
mailtest-check
subdir_files/.config/i3/config
subdir_files/.config/sway/config
system-status

diff --git a/brc2 b/brc2
index 5d20970f823d73c93285ff7c532f301667a727e3..34fb1dca03bfcb68a5093f82b7aae2edae11d1b0 100644 (file)
--- a/brc2
+++ b/brc2
@@ -175,14 +175,14 @@ anki() {
 
 acat() {
   ngset
-  hrcat /m/md/alerts/new/*
+  hrcat /m/md/alerts/{cur,new}/*
   ngreset
   hr; echo bk; hr
   ssh bk.b8.nz "shopt -s nullglob; hrcat /m/md/INBOX/new/* /m/md/INBOX/cur/*"
 }
 aclear() {
   ngset
-  rm -f /m/md/alerts/new/*
+  rm -f /m/md/alerts/{cur,new}/*
   ngreset
   ssh bk.b8.nz "shopt -s nullglob; rm -f /m/md/INBOX/new/* /m/md/INBOX/cur/*"
   system-status _
@@ -201,7 +201,7 @@ aw() {
 }
 ad() {
   pushd /a/bin/distro-setup/a >/dev/null
-  ansible-playbook site.yml
+  ansible-playbook site.yml "$@"
   popd >/dev/null
 }
 
index 499ec883ecacaaa5c0e134c3a8336a9867227b9a..7de9255227d7bae9651e4da3de896fd0c60440d6 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -406,7 +406,7 @@ subvolume $sub
 target send-receive $vol/btrbk
 EOF
   fi
-  if (( ${#target[@]} )); then
+  if (( ${#targets[@]} )); then
     cat >>/etc/btrbk.conf <<EOF
 volume $vol
 subvolume $sub
index 1c6af3bc784a63948bbead7ea7a67b21d3df3313..390bf55d23b8dcf46a13a6f657822e2a715dff77 100755 (executable)
@@ -1197,31 +1197,6 @@ if [[ ! -e $f ]]; then
 fi
 
 
-
-# trisquel 8 = openvpn, debian stretch = openvpn-client
-sd /etc/systemd/system/transmission-daemon-nn.service <<EOF
-[Unit]
-Description=Transmission BitTorrent Daemon netns
-After=network.target
-Requires=openvpn-client-tr@client.service
-After=openvpn-client-tr@client.service
-JoinsNamespaceOf=openvpn-client-tr@client.service
-
-[Service]
-User=debian-transmission
-Type=notify
-ExecStart=/usr/bin/transmission-daemon -f --log-error
-ExecReload=/bin/kill -s HUP \$MAINPID
-ExecStop=/bin/kill -s STOP \$MAINPID
-PrivateNetwork=true
-Nice=19
-BindReadOnlyPaths=/etc/nn-resolv:/run/systemd/resolve:norbind /etc/nn-resolv:/etc/nsswitch:norbind
-
-[Install]
-WantedBy=multi-user.target
-EOF
-ser daemon-reload
-
 case $HOSTNAME in
   kd|rp)
     sgo transmission-daemon-nn
index 710c11e9435aad3d9939478fe29fd6b299196655..1f9fe4c301f13acfaf2efe77a393f3bc8a08dbe8 100755 (executable)
@@ -11,9 +11,6 @@ case $gateway in
   10.2.0.1)
     dynhost=b8.nz
     ;;
-  10.0.0.1)
-    dynhost=t.b8.nz
-    ;;
   *)
     exit 0
     ;;
@@ -73,16 +70,14 @@ EOF
 fi
 
 if $up6; then
-  if [[ $HOSTNAME == tp ]]; then
-    cat >>$f <<EOF
-update delete $dynhost. AAAA
-update add $dynhost. 60 AAAA $ip6
-EOF
-  fi
   cat >>$f <<EOF
 update delete $fqdn. AAAA
 update add $fqdn. 60 AAAA $ip6
 EOF
+else
+  cat >>$f <<EOF
+update delete $fqdn. AAAA
+EOF
 fi
 
 cat >>$f <<EOF
index fdd71b18baf7a978460ada885e181b7767527a14..7a7d13097f25248a8cd7bcc1830519378941c23d 100644 (file)
@@ -26,7 +26,7 @@ ExecStartPre=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns -n 10.173.
 ExecStartPre=/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules
 ExecStopPost=/usr/bin/flock -w 20 /tmp/newns.flock /a/bin/newns/newns stop %i
 PrivateNetwork=true
-BindReadOnlyPaths=/etc/nn-resolv:/run/systemd/resolve:norbind /etc/nn-resolv:/etc/nsswitch:norbind
+BindReadOnlyPaths=/etc/tr-resolv:/run/systemd/resolve:norbind /etc/nn-resolv:/etc/nsswitch:norbind
 
 [Install]
 WantedBy=multi-user.target
diff --git a/filesystem/etc/systemd/system/transmission-daemon-nn.service b/filesystem/etc/systemd/system/transmission-daemon-nn.service
new file mode 100644 (file)
index 0000000..4f16ec4
--- /dev/null
@@ -0,0 +1,19 @@
+[Unit]
+Description=Transmission BitTorrent Daemon netns
+After=network.target
+Requires=openvpn-client-tr@client.service
+After=openvpn-client-tr@client.service
+JoinsNamespaceOf=openvpn-client-tr@client.service
+
+[Service]
+User=debian-transmission
+Type=notify
+ExecStart=/usr/bin/transmission-daemon -f --log-error
+ExecReload=/bin/kill -s HUP $MAINPID
+ExecStop=/bin/kill -s STOP $MAINPID
+PrivateNetwork=true
+Nice=19
+BindReadOnlyPaths=/etc/tr-resolv:/run/systemd/resolve:norbind /etc/nn-resolv:/etc/nsswitch:norbind
+
+[Install]
+WantedBy=multi-user.target
diff --git a/filesystem/etc/tr-resolv/stub-resolv.conf b/filesystem/etc/tr-resolv/stub-resolv.conf
new file mode 100644 (file)
index 0000000..54f0edd
--- /dev/null
@@ -0,0 +1,2 @@
+nameserver 8.8.8.8
+options edns0
index b69c26a50cbff053383b9a33a84cbf98e1117a6e..f263a3bd9c228132e2290a43e541dfa8aea89222 100644 (file)
@@ -11,10 +11,10 @@ bindsym $mod+3 exec "x-www-browser"
 bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
 bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
 bindsym $mod+6 exec "/a/bin/redshift.sh"
-bindsym $mod+equal exec "t s w; t in"
-bindsym $mod+Home exec "t out"
-#bindsym $mod+End exec "t s x; t in"
-bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
+bindsym $mod+equal exec "t s w; t in"
+bindsym $mod+Home exec "t out"
+# #bindsym $mod+End exec "t s x; t in"
+bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
 
 
 bindsym $mod+w focus parent
index ada75a34c5678d1219316f47c0100e1be2a6dece..25e9c8edb2061d63d61e234317ec6e83820ea355 100755 (executable)
@@ -35,5 +35,5 @@ x="$(readlink -f -- "${BASH_SOURCE[0]}")"; cd ${x%/*} # directory of this file
 # ran. Very strange, dunno why, but rsync won't do anything unless these
 # changed, so that should fix it.
 rsync -t --chmod=755 --chown=root:root /a/bin/log-quiet/log-once switch-mail-host btrbk-run mount-latest-subvol \
-      check-subvol-stale system-status myi3status /usr/local/bin
+      check-subvol-stale system-status myi3status mailtest-check /usr/local/bin
 rsync -t --chmod=755 --chown=root:root /a/bin/errhandle/err /usr/local/lib
index 3bfc8b29a3fd3886584d60fd2b8060f2c75c5307..ea7ee4683ea2ba61ec1677ffe6c2f2f7759781ab 100755 (executable)
@@ -808,14 +808,19 @@ cat >/etc/exim4/conf.d/rcpt_local_acl <<'EOF'
 # I might add somethign later.
 EOF
 
+i /etc/exim4/conf.d/local_deny_exceptions_acl <<'EOF'
 # This acl already exists in rcpt, this just makes it more widespread.
 # See the comment there for its rationale. The reason it needs to be
 # more widespread is that I've turned on sender verification, but cron
 # emails can fail sender verification since I may be in a network that
 # doesn't have my local dns.
-i /etc/exim4/conf.d/local_deny_exceptions_acl <<'EOF'
 accept
   authenticated = *
+
+# i setup a local programs smtp to mail.iankelling.org, this
+# skips sender verification for it.
+accept
+  hosts = 10.173.8.1
 EOF
 
 rm -fv /etc/exim4/data_local_acl # old path
@@ -1853,14 +1858,13 @@ EOF
 # I originally set this to li.iankelling.org, but then ended up with errors when li tried to send
 # mail to kd, so this should basically be a name that no host has as their
 # canonical hostname since the actual host sits behind a nat and changes.
-# Seems logical for this to be the same as mailname.
 MAIN_HARDCODE_PRIMARY_HOSTNAME = mail.iankelling.org
+# I used this to avoid sender verification, didnt work but it still
+# makes sense based on the spec.
+hosts_treat_as_local = defaultnn.b8.nz
 EOF
 
     /a/exe/cedit defaultnn /etc/hosts <<'EOF' || [[ $? == 1 ]]
-# this is just here to avoid mainlog errors, however, it doesnt seem to work
-# todo: look into it more. nsswitch.conf? cached result? i dunno
-# list matching forced to fail: failed to find host name for 10.173.8.1
 10.173.8.1 defaultnn.b8.nz
 EOF
     ;;&
@@ -1955,9 +1959,7 @@ EOF
     # file, so I've saved that into ./mail-notes.conf.
     cat >>/etc/exim4/update-exim4.conf.conf <<EOF
 # man page: is used to build the local_domains list, together with "localhost"
-# iank.bid is for testing
-# mail.iankelling.org is for machines i own
-# this is duplicated in a later router
+# this is duplicated in a later router.
 dc_other_hostnames='iankelling.org;zroe.org;r2e.iankelling.org'
 EOF
 
@@ -1989,7 +1991,7 @@ EOF
 vpnmanual:
   debug_print = "R: dnslookup for $local_part@$domain"
   driver = manualroute
-  domains = iankelling.org:zroe.org:r2e.iankelling.org
+  domains = iankelling.org : zroe.org:r2e.iankelling.org
   transport = remote_smtp
   same_domain_copy_routing = yes
   route_list = * 10.8.0.4
index e8f146d274e30736432aee0646d36479fe3a6cbf..38cfc91f41a12519c6b08da194c529626a1ca3d5 100755 (executable)
@@ -110,7 +110,7 @@ for folder in ${folders[@]}; do
             fi
           done
           if (( ${#results[@]} || ${#missing[@]} )); then
-            printf "$HOSTNAME spamtest %s %s/%s\n" "$folder" "$latest"
+            printf "$HOSTNAME spamtest %s/%s\n" "$folder" "$latest"
             if (( ${#results[@]} )); then
               printf "unexpected %s" "${!results[*]} "
             fi
@@ -118,6 +118,7 @@ for folder in ${folders[@]}; do
               printf "missing %s" "${missing[*]}"
             fi
             echo
+            spamassassin -D <"$latest"
           fi
         else
           echo $HOSTNAME mailtest spamd pid not found
index 4ba06742692f272beab9ea77eace8c0ba6405c60..9948f389fa4cd7b892e2586fac1083a73c68feb4 100644 (file)
@@ -11,10 +11,10 @@ bindsym $mod+3 exec "x-www-browser"
 bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
 bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
 bindsym $mod+6 exec "/a/bin/redshift.sh"
-bindsym $mod+equal exec "t s w; t in"
-bindsym $mod+Home exec "t out"
-#bindsym $mod+End exec "t s x; t in"
-bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
+bindsym $mod+equal exec "t s w; t in"
+bindsym $mod+Home exec "t out"
+# #bindsym $mod+End exec "t s x; t in"
+bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
 
 
 bindsym $mod+w focus parent
index 71a7fd3110aafafa946a164f5e412ce44f9a991c..bb9712ef384cdcbf00ae5ae7506021c1335a4ce2 100644 (file)
@@ -11,10 +11,10 @@ bindsym $mod+3 exec "x-www-browser"
 bindsym $mod+4 exec "x-www-browser -no-remote -P firefox-main-profile"
 bindsym $mod+5 exec "/usr/local/bin/start-tor-browser"
 bindsym $mod+6 exec "/a/bin/redshift.sh"
-bindsym $mod+equal exec "t s w; t in"
-bindsym $mod+Home exec "t out"
-#bindsym $mod+End exec "t s x; t in"
-bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
+bindsym $mod+equal exec "t s w; t in"
+bindsym $mod+Home exec "t out"
+# #bindsym $mod+End exec "t s x; t in"
+bindsym $mod+grave exec "t s lunch; t in; t out -a '45 minutes from now'"
 
 
 bindsym $mod+w focus parent
index 93d31e4462b414166ef33f17bc5fd30378d7ef75..adf8dd57592ed342f29f5e8b26f519a892c26649 100644 (file)
@@ -63,7 +63,7 @@ write-status() {
     bouncemsg="message in /m/md/bounces/new"
   fi
   lo -1 bounce $bouncemsg
-  glob=(/m/md/alerts/new/*)
+  glob=(/m/md/alerts/{new,cur}/*)
   if [[ -e ${glob[0]} ]]; then
     chars+=("A")
   fi