From: Ian Kelling Date: Tue, 16 Feb 2021 06:42:02 +0000 (-0500) Subject: mostly nabia and mail fixes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=c79d0ece5eba58540b9a19a0d39de1b9970969c0;p=distro-setup mostly nabia and mail fixes --- diff --git a/a/site.yml b/a/site.yml index e9e48ed..f9c14b6 100644 --- a/a/site.yml +++ b/a/site.yml @@ -45,6 +45,7 @@ hello: 'defaultnn.b8.nz' alertmanager_route: receiver: defaultreceiver + repeat_interval: 7d alertmanager_receivers: - name: defaultreceiver email_configs: diff --git a/brc b/brc index 5579fc4..92bb543 100644 --- a/brc +++ b/brc @@ -802,14 +802,6 @@ gn() { g -n "$@" } -gh() { - # i got an error, gh not found when doing a pull request, it seems like it wants itself in it\'s path. - local _oldpath="$PATH" - PATH="$PATH:$HOME/node_modules/.bin" - command gh "$@" - PATH="$_oldpath" -} - gmacs() { # quit will prompt if the program crashes. gdb -ex=r -ex=quit --args emacs "$@"; r; diff --git a/brc2 b/brc2 index 31de004..ef5fb0a 100644 --- a/brc2 +++ b/brc2 @@ -119,8 +119,8 @@ users=$USER,user2 EOF if [[ -e $d/bin ]]; then sudo chroot $d apt-get update - sudo chroot $d apt-get -y dist-upgrade --purge --auto-remove - cd; sudo schroot -c $n -- apt-get install --allow-unauthenticated -y ${apps[@]} + sudo chroot $d DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade --purge --auto-remove + cd; sudo schroot -c $n -- DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y ${apps[@]} else sudo mkdir -p $d # resolvconf otherwise schroot fails with @@ -798,7 +798,11 @@ gitian() { # at least in flidas, things rely on gpg being gpg1 gpg() { - command gpg2 "$@" + if type -P gpg2 &>/dev/null; then + command gpg2 "$@" + else + command gpg "$@" + fi } gse() { @@ -992,6 +996,13 @@ mdt() { mo() { xset dpms force off; } # monitor off +mpvd() { + mpv --profile=d "$@"; +} +mpvs() { + mpv --profile=s "$@"; +} + myirc() { if [[ ! $1 ]]; then set -- fsf-office @@ -1250,9 +1261,9 @@ testexim() { # /etc/default/exim4 # # to specify recipients other than those in to, cc, bcc, you can use the cli args, eg: - # exim -i 'test@zroe.org, t2@zroe.org' <<'EOF' - # + # exim -t 'test@zroe.org, t2@zroe.org' <<'EOF' # + # -t = get recipient from header exim -d -t <<'EOF' From: i@dmarctest.b8.nz To: mailman@dev.fsf.org @@ -1532,7 +1543,7 @@ path-add --end ~/.npm-global path-add --end $HOME/.cargo/bin if type -P rg &>/dev/null; then - rg() { command rg -i -M 200 "$@"; } + rg() { command rg -i -M 200 --no-ignore "$@"; } complete -r rg else alias rg=grr diff --git a/conflink b/conflink index 60d0372..1e0c767 100755 --- a/conflink +++ b/conflink @@ -52,9 +52,9 @@ subdir-link-r() { local root="$1" local targets=() if [[ $2 ]]; then - targets=( "$2"/!(.git|..|.) ) + targets=( "$2"/!(.git|..|.|.#*) ) else - for f in "$1"/!(.git|..|.); do + for f in "$1"/!(.git|..|.|.#*); do if [[ -d $f ]]; then targets+=("$f"); fi done fi @@ -113,7 +113,7 @@ common-file-setup() { if [[ -e $dir/subdir_files ]]; then m subdir-link-r $dir/subdir_files fi - local x=( $dir/!(binds|subdir_files|filesystem|machine_specific|..|.) ) + local x=( $dir/!(binds|subdir_files|filesystem|machine_specific|..|.|.#*) ) (( ${#x[@]} >= 1 )) || continue m lnf ${x[@]} ~ done @@ -125,7 +125,6 @@ common-file-setup() { m s systemctl restart $service fi done - } user=$(id -un) @@ -141,9 +140,9 @@ case $user in iank) /a/bin/ds/install-my-scripts files=(/p/c/machine_specific/*/filesystem/etc/ssh/*_key + /p/c/machine_specific/*/filesystem/etc/openvpn/client/*.key /p/c/filesystem/etc/openvpn/client/*.key /p/c/filesystem/etc/openvpn/easy-rsa/keys/*.key - /p/c/machine_specific/kw/filesystem/etc/openvpn/client/*.key ) if [[ -e ${files[0]} ]]; then chmod 600 ${files[@]} diff --git a/distro-begin b/distro-begin index 5dcdd61..144d8a5 100755 --- a/distro-begin +++ b/distro-begin @@ -613,7 +613,8 @@ if has_monitor; then # recommends gets us geoclue (for darkening automatically at night i assume), # which recommends modemmanager, which is annoying to fix for the model01 keyboard. - pi --no-install-recommends gtk-redshift + # commented because I dont use it much, and in nabia its named changed to redshift-gtk + #pi --no-install-recommends gtk-redshift ##### setup X autostart # install for multiple display managers in case we use one @@ -629,8 +630,10 @@ EOF sudo mkdir -p $dir/PostLogin sudo cp /a/bin/distro-setup/desktop-20-autostart.sh $dir/PostLogin/Default sudo mkdir -p /etc/lightdm/lightdm.conf.d + # etiona lightdm.log: + # [SeatDefaults] is now called [Seat:*], please update this configuration sudo dd of=/etc/lightdm/lightdm.conf.d/12-iank.conf <<'EOF' -[SeatDefaults] +[Seat:*] display-setup-script=/a/bin/ds/lightdm-start session-setup-script=/a/bin/distro-setup/desktop-20-autostart.sh EOF diff --git a/distro-end b/distro-end index a0ac545..9d207e3 100755 --- a/distro-end +++ b/distro-end @@ -143,7 +143,7 @@ esac pi debootstrap ######### begin universal pinned packages ###### case $(debian-codename) in - etiona|flidas) + nabia|etiona|flidas) sd /etc/apt/preferences.d/etiona-buster <$t <<'EOF' +deb http://mirror.fsf.org/trisquel/ nabia main +deb-src http://mirror.fsf.org/trisquel/ nabia main + +deb http://mirror.fsf.org/trisquel/ nabia-updates main +deb-src http://mirror.fsf.org/trisquel/ nabia-updates main + +deb http://archive.trisquel.info/trisquel/ nabia-security main +deb-src http://archive.trisquel.info/trisquel/ nabia-security main + +# Uncomment this lines to enable the backports optional repository +deb http://mirror.fsf.org/trisquel/ nabia-backports main +deb-src http://mirror.fsf.org/trisquel/ nabia-backports main +EOF + if ! diff -q $t $f; then + sudo dd if=$t of=$f 2>/dev/null + p update + fi + # for ziva #p install --no-install-recommends minetest/buster libleveldb1d/buster libncursesw6/buster libtinfo6/buster f=/etc/apt/sources.list.d/buster.list @@ -668,9 +697,9 @@ case $codename_compat in # todo: figure out mate for buster # pi task-gnome-desktop ;; - bionic) - - pi xorg lightdm mate-desktop-environment mate-desktop-environment-extras mate-indicator-applet anacron + bionic|focal) + # i had installing mate-indicator-applet, but im not sure why so i removed + pi xorg lightdm mate-desktop-environment mate-desktop-environment-extras anacron # pi gnome-core # # apt-get update periodically fails with an appstream error. @@ -680,12 +709,27 @@ case $codename_compat in # by default, it sleeps when not logged in to x/wayland and on ac power. # stop that. - if id -u gdm &>/dev/null; then sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing' m systemctl --user stop gvfs-daemon m systemctl --user disable gvfs-daemon fi + ;;& + focal) + # lightdm startup fails without this. on etiona, we got unity-greeter installed automatically, + # it would probably work on nabia too, but google just lead me to this and it works fine. + pi lightdm-gtk-greeter + # ok, this is really weird + # normally this file has + cat >/etc/X11/Xsession.d/99x11-common_start <<'EOF' +# this is very odd. +# this file normally just has: exec $STARTUP +# but then ~/.xsession-errors +# says $STARTUP is not found, which appears to be the real +# error, but normal bash doesnt operate that way. +# https://bugs.launchpad.net/ubuntu/+source/im-config/+bug/1879352 +eval exec $STARTUP +EOF ;; esac @@ -695,12 +739,56 @@ if [[ $codename_compat == flidas ]]; then pi gnupg-doc fi -# abrowser is not in etiona yet, abrowser version is 68, -# abrowser won't run on a firefox profile that was on firefox -# version 70. firefox in ubuntu is at version 70. -# have to rm compabibility.ini to even try downgrade. -pi firefox -sudo update-alternatives --set x-www-browser /usr/bin/abrowser + +case $distro in + trisquel) + case $codename in + nabia) + # abrowser not available yet + pi firefox + ;; + *) + # firefox would work here too, apt would select abrowser. + # and the update-alternatives thing i think is becuz firefox is + # generally available before abrowser and this helps fix things + # up when we have both. + pi abrowser + sudo update-alternatives --set x-www-browser /usr/bin/abrowser + ;; + esac + ;; + ubuntu) + pi firefox + ;; + debian) + pi firefox-esr + ;; +esac + +# newer distros just use adb for package name it seems +case $codename_compat in + bionic|stretch) + pi android-tools-adbd + ;; +esac + + +case $codename_compat in + bionic) + pi python-vte + ;; + *) + pi reportbug-gtk + ;; +esac + +# not packaged in newer distros it seems +case $codename_compat in + bionic|buster|stretch) + pi dtrx + ;; +esac + # TODO: some of the X programs can be removed from pall when using wayland @@ -853,7 +941,7 @@ fi if [[ -e /p/c/machine_specific/$HOSTNAME/etc/openvpn/client/hole.crt ]]; then sgo openvpn-client@hole - fi +fi if [[ $HOSTNAME == frodo ]]; then vpn-mk-client-cert -b frodo -n hole iankelling.org @@ -960,7 +1048,7 @@ m reset-xscreensaver # also, i assume syncing this between machines somehow messed up the data. if mountpoint /p &>/dev/null; then case $codename in - etiona) + etiona|nabia) pi arbtt seru enable arbtt seru start arbtt @@ -987,8 +1075,8 @@ if mountpoint /p &>/dev/null; then perldir=(/usr/lib/x86_64-linux-gnu/perl/5.*) m sudo ln -sf ../../../perl/5.18.2/SPD/ ${perldir[0]} # newer distro had gpg2 as default, older one, flidas, need to make it that way - gpgpath=$(which gpg2) - if [[ $x ]]; then + gpgpath=$(which gpg2) ||: + if [[ $gpgpath ]]; then sudo mkdir -p /usr/local/spdhackfix s lnf -T $gpgpath /usr/local/spdhackfix/gpg fi @@ -1077,7 +1165,8 @@ case $distro in trisquel) m mkschroot debian buster firefox-esr pulseaudio chromium anki case $(debian-codename) in - etiona) + etiona|nabia) + # we have a lot of t8 stuff, useful to have mkschroot trisquel flidas tu /nocow/schroot/flidas/etc/sudoers </etc/exim4/conf.d/rcpt_local_acl <<'EOF' -# i had a thing here so alerts would only come from -# authed hosts. I ditched it, but leaving this here since -# 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. @@ -998,7 +994,6 @@ dc_minimaldns='false' dc_relay_nets='' CFILEMODE='644' dc_use_split_config='true' -dc_local_interfaces='' dc_mailname_in_oh='true' EOF @@ -1169,8 +1164,8 @@ EOF { cat <>/etc/exim4/update-exim4.conf.conf <>/etc/exim4/update-exim4.conf.conf < /etc/mailname /a/exe/cedit nn /etc/hosts <<'EOF' || [[ $? == 1 ]] @@ -2136,9 +2148,23 @@ EOF dc_other_hostnames='je.b8.nz' EOF + echo|i /etc/exim4/conf.d/rcpt_local_acl + echo|i /etc/exim4/conf.d/router/880_universal_forward + ;; # ** not MAIL_HOST|bk|je *) + echo|i /etc/exim4/conf.d/rcpt_local_acl + + # catches things like cronjob email + i /etc/exim4/conf.d/router/880_universal_forward <<'EOF' +universal_forward: + driver = redirect + domains = +local_domains + data = alerts@iankelling.org +EOF + + for unit in ${nn_progs[@]}; do f=/etc/systemd/system/$unit.service.d/nn.conf rm -fv $f @@ -2150,6 +2176,10 @@ EOF echo | /a/exe/cedit mail /etc/dnsmasq-servers.conf || [[ $? == 1 ]] cat >>/etc/exim4/update-exim4.conf.conf <