From 14962037bb8038dcd87eaa9bf84107750395ba55 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 26 Nov 2020 15:27:39 -0500 Subject: [PATCH] various fixes --- bk-backup | 7 +++++-- brc | 2 +- brc2 | 16 +++++++++------- mail-setup | 25 ++++++++++++++++++------- mailtest-check | 12 +++++++----- 5 files changed, 40 insertions(+), 22 deletions(-) diff --git a/bk-backup b/bk-backup index a71e77f..67759fa 100755 --- a/bk-backup +++ b/bk-backup @@ -24,8 +24,11 @@ if $restore; then for ncdir in /var/www/ncexpertpath /var/www/ncninja; do ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on ||: # might not be running rsync -ra /p/bkbackup/$ncbase/ root@$host:$ncdir || ret=$? + # https://docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html#maintenance-commands-label + ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:data-fingerprint + ssh root@$host sudo -u www-data php $ncdir/occ -q maintenance:mode --on done - rsync -ravi /p/bkbackup/rc/ root@$host:/m/rc + rsync -ravi /p/bkbackup/m root@$host:/ exit 0 fi @@ -43,6 +46,6 @@ if [[ $HOSTNAME == $MAIL_HOST ]]; then ret=1 fi done - rsync -rai --delete root@$host:/m/rc /p/bkbackup + rsync -rai --delete root@$host:/m /p/bkbackup fi exit $ret diff --git a/brc b/brc index fcc17eb..b2eac3f 100644 --- a/brc +++ b/brc @@ -1154,7 +1154,7 @@ resolvcat() { fi hr echo /etc/nsswitch.conf: - grep '^ *files' /etc/nsswitch.conf + grep '^ *hosts:' /etc/nsswitch.conf if systemctl is-enabled systemd-resolved &>/dev/null || [[ $(systemctl is-active systemd-resolved ||:) != inactive ]]; then hr; m ser status systemd-resolved | cat || : hr; m systemd-resolve --status | cat diff --git a/brc2 b/brc2 index 744a92c..d505e90 100644 --- a/brc2 +++ b/brc2 @@ -1111,13 +1111,6 @@ r2eadd() { # usage: name url } r2e() { command r2e -d /p/c/rss2email.json -c /p/c/rss2email.cfg "$@"; } -if type -P rg &>/dev/null; then - rg() { command rg -i -M 200 "$@"; } - complete -r rg -else - alias rg=grr -fi - rspicy() { # usage: HOST DOMAIN # connect to spice vm remote host. use vspicy for local host local port @@ -1494,6 +1487,15 @@ path-add --end ~/.npm-global path-add --end $HOME/.cargo/bin +if type -P rg &>/dev/null; then + rg() { command rg -i -M 200 "$@"; } + complete -r rg +else + alias rg=grr +fi + + + # taken from default changes to bashrc and bash_profile path-add --end --ifexists $HOME/.rvm/bin # also had ruby bin dir, but moved that to environment.sh diff --git a/mail-setup b/mail-setup index 4e277ef..8ae33ba 100755 --- a/mail-setup +++ b/mail-setup @@ -1,11 +1,21 @@ #!/bin/bash - -# todo: figure out - # * intro # Copyright (C) 2019 Ian Kelling # SPDX-License-Identifier: AGPL-3.0-or-later +# todo: notification of updates for nextcloud. +# this should do it: +# if ! timeout 10 sudo -u www-data php /var/www/ncninja/updater/updater.phar + +# todo setup better backup/sync of MAIL_HOST emails + +# todo: reinstall bk with bigger filesystem + +# fix so i dont have to do this every reboot: +# /a/f/ans A D PANIC! $ s mkdir /var/run/clamav +# +#/a/f/ans A D PANIC! $ s chown clamav /var/run/clamav + # todo: monitor for msft unblock, and then remove on bk: # /etc/exim4/conf.d/router/190_msft # dnslookup_msft @@ -40,8 +50,8 @@ # in 2 or 3 days or something. todo, test cron mail on li. # todo: look at mailinabox extra dns records, note these changelogs: -# * An MTA-STS policy for incoming mail is now published (in DNS and over HTTPS) when the primary hostname and email address domain both have a signed TLS certificate installed, allowing senders to know that an encrypted connection should be enforced. -# * The per-IP connection limit to the IMAP server has been doubled to allow more devices to connect at once, especially with multiple users behind a NAT. +# - An MTA-STS policy for incoming mail is now published (in DNS and over HTTPS) when the primary hostname and email address domain both have a signed TLS certificate installed, allowing senders to know that an encrypted connection should be enforced. +# - The per-IP connection limit to the IMAP server has been doubled to allow more devices to connect at once, especially with multiple users behind a NAT. # # todo: mailtest-check failure on remote hosts is not going to alert me. @@ -1553,7 +1563,9 @@ EOF m mkdir -p $rclogdir m chmod 750 $rclogdir m chown www-data:adm $rclogdir - # todo rss subscribe to carddav plugin + # note: subscribed to updates: + # r2e add rcmcarddav https://github.com/blind-coder/rcmcarddav/commits/master.atom ian@iankelling.org + # r2e add roundcube https://github.com/roundcube/roundcubemail/releases.atom ian@iankelling.org m mkdir -p $rctmpdir /m/rc m chown -R www-data.www-data $rctmpdir /m/rc m chmod 750 $rctmpdir @@ -2306,7 +2318,6 @@ EOF echo '#!/bin/bash' >/usr/local/bin/send-test-forward for test_from in ${test_froms[@]}; do cat >>/usr/local/bin/send-test-forward <