exim and various improvements
authorIan Kelling <ian@iankelling.org>
Sun, 5 Feb 2017 04:03:43 +0000 (20:03 -0800)
committerIan Kelling <ian@iankelling.org>
Sun, 5 Feb 2017 04:03:43 +0000 (20:03 -0800)
filesystem/etc/exim4/conf.d/acl/30_exim4-config_check_mail [new file with mode: 0644]
filesystem/etc/exim4/conf.d/auth/29_exim4-config_auth [new file with mode: 0644]
filesystem/etc/exim4/conf.d/main/000_localmacros [new file with mode: 0644]
filesystem/etc/systemd/system/mailroute.service [new file with mode: 0644]
filesystem/etc/systemd/system/openvpn-client-nn@.service
machine_specific/treetowl/filesystem/etc/cron.d/treetowl
machine_specific/treetowl/filesystem/etc/cron.daily/mediawiki_backup [new file with mode: 0755]
machine_specific/treetowl/filesystem/etc/systemd/system/btrbk.service
subdir_files/.config/mpv/mpv.conf
subdir_files/.config/sakura/sakura.conf

diff --git a/filesystem/etc/exim4/conf.d/acl/30_exim4-config_check_mail b/filesystem/etc/exim4/conf.d/acl/30_exim4-config_check_mail
new file mode 100644 (file)
index 0000000..c51da90
--- /dev/null
@@ -0,0 +1,17 @@
+
+### acl/30_exim4-config_check_mail
+#################################
+
+# This access control list is used for every MAIL command in an incoming
+# SMTP message. The tests are run in order until the address is either
+# accepted or denied.
+#
+
+acl_check_mail:
+
+# ian: I added this require statement only. accept at the end is
+# needed as the default is deny.
+  require
+    message = ian auth
+    authenticated = *
+  accept
diff --git a/filesystem/etc/exim4/conf.d/auth/29_exim4-config_auth b/filesystem/etc/exim4/conf.d/auth/29_exim4-config_auth
new file mode 100644 (file)
index 0000000..bbfff3f
--- /dev/null
@@ -0,0 +1,11 @@
+# from 30_exim4-config_examples
+
+plain_server:
+  driver = plaintext
+  public_name = PLAIN
+  server_condition = "${if crypteq{$auth3}{${extract{1}{:}{${lookup{$auth2}lsearch{CONFDIR/passwd}{$value}{*:*}}}}}{1}{0}}"
+  server_set_id = $auth2
+  server_prompts = :
+  .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
+  server_advertise_condition = ${if eq{$tls_in_cipher}{}{}{*}}
+  .endif
diff --git a/filesystem/etc/exim4/conf.d/main/000_localmacros b/filesystem/etc/exim4/conf.d/main/000_localmacros
new file mode 100644 (file)
index 0000000..97945cb
--- /dev/null
@@ -0,0 +1 @@
+MAIN_TLS_ENABLE = true
diff --git a/filesystem/etc/systemd/system/mailroute.service b/filesystem/etc/systemd/system/mailroute.service
new file mode 100644 (file)
index 0000000..68a6655
--- /dev/null
@@ -0,0 +1,16 @@
+[Unit]
+# this unit is configured to start and stop whenever openvpn-client@mail.service
+# does
+Description=Routing for email vpn
+After=network.target
+BindsTo=openvpn-client@mail.service
+After=openvpn-client@mail.service
+
+[Service]
+Type=oneshot
+ExecStart=/a/bin/distro-setup/mail-route start
+ExecStop=/a/bin/distro-setup/mail-route stop
+RemainAfterExit=yes
+
+[Install]
+RequiredBy=openvpn-client@mail.service
index ef5941dcfcf2ec5a1a63339b58d07c068fe7218e..ba89ea020a15ce432b491192bfad55a5db997310 100644 (file)
@@ -22,7 +22,7 @@ LimitNPROC=10
 # DeviceAllow=/dev/net/tun rw
 
 # ian: added just these  lines from upstream
-ExecStartPre=+/a/bin/newns/newns start %i
+ExecStartPre=+/a/bin/newns/newns -n 10.173.0 start %i
 ExecStartPre=+/sbin/iptables-restore /a/bin/transmission-firewall/netns.rules
 ExecStopPost=+/a/bin/newns/newns stop %i
 PrivateNetwork=true
index a20f90ba03729f3b5e9b21a43ab6556896d2b2f2..e44ec1ccf612da190542d5d3433ae37684bab93a 100755 (executable)
@@ -7,7 +7,7 @@
 SHELL=/bin/bash
 0    4 * * * ian x=$(/a/exe/logq /a/bin/small-backup --retry daily 2M); [[ $? != 0 ]] && echo "$x"
 0    3 * * sun ian echo weekly backup results:; /a/bin/small-backup --retry weekly -batch -prefer ~/.mpv -silent 2>&1 | /a/exe/log-once unison-mpv
-*/5  * * * *   ian /a/bin/dynamic-ip-update.sh
+*/5  * * * *   ian /a/bin/distro-setup/dynamic-ip-update.sh | /a/exe/log-once -15
 */10 * * * *   ian /a/bin/small-backup 10minutes 3D 2>&1 | /a/exe/log-once small-backup-10min
 # put things we don't want to send mail about below this:
 # MAILTO=""
diff --git a/machine_specific/treetowl/filesystem/etc/cron.daily/mediawiki_backup b/machine_specific/treetowl/filesystem/etc/cron.daily/mediawiki_backup
new file mode 100755 (executable)
index 0000000..2d40618
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+# if we get an error, keep going but return it at the end
+last_error=0
+trap 'last_error=$?' ERR
+source ~/mw_vars
+# No strict because the host is likely not named the same as
+# the domain.
+ssh="ssh -oStrictHostKeyChecking=no"
+logfile=/var/log/${mwdomain}_backup.log
+{
+echo "#### starting backup at $(date) ####"
+$ssh root@$mwdomain <<ENDSSH
+set -x
+tee -a $mwc<<'EOF'
+\$wgReadOnly = 'Dumping Database, Access will be restored shortly';
+EOF
+mkdir -p ~/wiki_backups
+mysqldump -p$dbpass --default-character-set=binary my_wiki  > ~/wiki_backups/wiki_db_backup
+sed -i '\$ d' $mwc # delete read only setting
+ENDSSH
+# add no strict option to the defaults
+
+rdiff() { rdiff-backup --remote-schema "$ssh -C  %s rdiff-backup --server" "$@"; }
+set -x
+rdiff root@$mwdomain::/root/wiki_backups ~/backup/${mwdomain}_wiki_db_backup
+rdiff root@$mwdomain::$mw ~/backup/${mwdomain}_wiki_file_backup
+set +x
+echo "=== ending backup at $(date) ===="
+}  &>>$logfile
+if [[ $last_error != 0 ]]; then
+    echo "backup for $mwdomain failed. See $logfile"
+fi
+exit $last_error
index da692bb768707c700f54990edf8f5cfca56cc8bd..0d288c4e03ee080f235338895f95792eec7f9328 100644 (file)
@@ -1,7 +1,7 @@
 [Unit]
 Description=Btrbk backup
-After=network.target
+After=multi-user.target
 
 [Service]
 Type=oneshot
-ExecStart=/a/exe/btrbk-run
+ExecStart=/a/bin/log-quiet/sysd-mail-once /a/exe/btrbk-run
index a276cefde74a9f3f2f529b161aaa08d0c3dd8030..5e2d10787865733b989435f0aefc9e80ecb26592 100644 (file)
@@ -1,4 +1,4 @@
 #loop=inf
 loop-file=inf
 shuffle
-volume=20
\ No newline at end of file
+volume=80
\ No newline at end of file
index bb20089ad79866a7c4cfa420db66b02d1adddd68..5e27d085f8a5df27a256297b640a721010ebad0d 100644 (file)
@@ -73,3 +73,6 @@ disable_numbered_tabswitch=false
 scroll_lines=10000000
 increase_font_size_key=plus
 decrease_font_size_key=minus
+use_fading=false
+scrollable_tabs=true
+stop_tab_cycling_at_end_tabs=No