From 273f5f51a05d10612377d54627d42e0c936a3b5d Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 23 Nov 2025 15:33:50 -0700 Subject: [PATCH] Update README.html. --- README.html | 781 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 469 insertions(+), 312 deletions(-) diff --git a/README.html b/README.html index 349d6c4..88be3f2 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Birchwood Abbey Networks @@ -24,8 +24,8 @@ idiosyncrasies. The roles herein are abbey specific, emphasized by the abbey- prefix on their names. These roles are applied after the generic institutional roles (again, documented here).

-
-

1. Overview

+
+

1. Overview

A Small Institute makes security and privacy top priorities but @@ -64,7 +64,7 @@ map is very similar, with differences mainly in terminology, philosophy, attitude.

-
+
                 |                                                   
                 =                                                   
               _|||_                                                 
@@ -103,8 +103,8 @@ philosophy, attitude.
 
-
-

2. The Abbey Particulars

+
+

2. The Abbey Particulars

The abbey's public particulars are included below. They are the @@ -134,8 +134,8 @@ into private_ex/vars-abbey.yml.

-
-

3. The Abbey Front Role

+
+

3. The Abbey Front Role

Birchwood Abbey's front door is a Digital Ocean Droplet configured as @@ -144,8 +144,8 @@ with Apache2, spooling email with Postfix and serving it with Dovecot-IMAPd, and hosting a VPN with WireGuard™.

-
-

3.1. Install Emacs

+
+

3.1. Install Emacs

The monks of the abbey are masters of the staff (bo) and Emacs. @@ -160,8 +160,8 @@ The monks of the abbey are masters of the staff (bo) and Emacs.

-
-

3.2. Configure Public Email Aliases

+
+

3.2. Configure Public Email Aliases

The abbey uses several additional email aliases. These are the public @@ -201,8 +201,8 @@ from there, forwarding sysadm to a real person.

-
-

3.3. Configure Git Daemon on Front

+
+

3.3. Configure Git Daemon on Front

The abbey publishes member Git repositories with git-daemon. If @@ -277,7 +277,7 @@ like git-tasks and git-handlers.

-git-tasks
- name: Install git daemon.
+git-tasks
- name: Install git daemon.
   become: yes
   apt: pkg=git-daemon-sysvinit
 
@@ -315,7 +315,7 @@ like git-tasks and git-handlers.
 
-git-handlers

+git-handlers

 - name: Restart git daemon.
   become: yes
   command: systemctl restart git-daemon
@@ -324,8 +324,8 @@ like git-tasks and git-handlers.
 
-
-

3.4. Configure Gitweb on Front

+
+

3.4. Configure Gitweb on Front

The abbey provides an HTML interface to members' public Git @@ -352,7 +352,7 @@ lists the repositories found in /var/www/git/.

-apache-gitweb

+apache-gitweb

 Alias /gitweb-static/ /usr/share/gitweb/static/
 <Directory "/usr/share/gitweb/static/">
     Options MultiViews
@@ -410,7 +410,7 @@ web site /favicon.ico.
 

-apache-gitweb-tasks
- name: Enable Apache2 rewrite module for Gitweb.
+apache-gitweb-tasks
- name: Enable Apache2 rewrite module for Gitweb.
   become: yes
   apache2_module: name=rewrite
   notify: Restart Apache2.
@@ -447,7 +447,7 @@ web site /favicon.ico.
 
-apache-gitweb-handlers
- name: Restart Apache2.
+apache-gitweb-handlers
- name: Restart Apache2.
   become: yes
   systemd:
     service: apache2
@@ -457,8 +457,8 @@ web site /favicon.ico.
 
-
-

3.5. Configure Apache for Abbey Documentation

+
+

3.5. Configure Apache for Abbey Documentation

Some of the directives added to the -vhost.conf file are needed by @@ -476,7 +476,7 @@ filename suffixes.

-apache-abbey
<Directory {{ docroot }}/Abbey/>
+apache-abbey
<Directory {{ docroot }}/Abbey/>
     AllowOverride Indexes FileInfo
     Options +Indexes +FollowSymLinks
 </Directory>
@@ -499,8 +499,8 @@ AddType text/plain private pub public_vpn req rev sample txt yml
 
-
-

3.6. Configure Photos URLs on Front

+
+

3.6. Configure Photos URLs on Front

Some of the directives added to the -vhost.conf file map the abbey's @@ -512,7 +512,7 @@ matching configurations for accurate previews and tests.

-apache-photos

+apache-photos

 RedirectMatch /Photos$ /Photos/
 RedirectMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])$ \
               /Photos/$1_$2_$3/
@@ -525,8 +525,8 @@ AliasMatch /Photos/$ {{ docroot }}/Photos/index.html
 
-
-

3.7. Configure Apache on Front

+
+

3.7. Configure Apache on Front

The abbey needs to add some Apache2 configuration directives to the @@ -537,11 +537,11 @@ The abbey simply creates a birchwood-abbey.net-vhost.conf file in

-The following task adds the apache-abbey, apache-photos, and -apache-gitweb directives described above to the -vhost.conf file, +The following task adds the apache-abbey, apache-photos, and +apache-gitweb directives described above to the -vhost.conf file, and includes options-ssl-apache.conf from /etc/letsencrypt/. The rest of the Let's Encrypt configuration is discussed in the following -Install Let's Encrypt section. +Install Let's Encrypt section.

@@ -571,8 +571,8 @@ rest of the Let's Encrypt configuration is discussed in the following
-
-

3.8. Configure Apache Log Archival

+
+

3.8. Configure Apache Log Archival

These tasks hack Apache's logrotate(8) configuration to rotate @@ -705,8 +705,8 @@ encrypting and sending to sendmail.

-
-

3.9. Install Let's Encrypt

+
+

3.9. Install Let's Encrypt

The abbey uses a Let's Encrypt certificate to authenticate its public @@ -715,7 +715,7 @@ certificate is a terminal session affair (with prompts and lines entered as shown below).

-
+
 $ sudo apt install python3-certbot-apache
 $ sudo certbot --apache -d birchwood-abbey.net
 ...
@@ -825,8 +825,8 @@ restarted manually.
 
-
-

3.10. Rotate Let's Encrypt Log

+
+

3.10. Rotate Let's Encrypt Log

The following task arranges to rotate Certbot's logs files. @@ -854,8 +854,8 @@ The following task arranges to rotate Certbot's logs files.

-
-

3.11. Archive Let's Encrypt Data

+
+

3.11. Archive Let's Encrypt Data

A backup copy of Let's Encrypt's data (/etc/letsencrypt/) is sent to @@ -934,8 +934,8 @@ imported into root@front's GnuPG key file.

-
-

4. The Abbey Core Role

+
+

4. The Abbey Core Role

Birchwood Abbey's core is a mini-PC (System76 Meerkat) configured as A @@ -945,8 +945,8 @@ with Postfix and Dovecot, and providing essential localnet services: NTP, DNS and DHCP.

-
-

4.1. Include Abbey Variables

+
+

4.1. Include Abbey Variables

In this abbey specific document, most abbey particulars are not @@ -965,8 +965,8 @@ directory, playbooks/.

-
-

4.2. Install Additional Packages

+
+

4.2. Install Additional Packages

The scripts that maintain the abbey's web site use a number of @@ -986,8 +986,8 @@ The house task list uses JQuery.

-
-

4.3. Configure Private Email Aliases

+
+

4.3. Configure Private Email Aliases

The abbey uses several additional email aliases. These are the campus @@ -1028,13 +1028,13 @@ e.g. mythtv@mythtv.birchwood.private, locally.)

-
-

4.4. Configure Git Daemon on Core

+
+

4.4. Configure Git Daemon on Core

These tasks are identical to those executed on Front, for similar Git -services on Front and Core. See 3.3 and -Configure Gitweb on Front for more information. +services on Front and Core. See 3.3 and +Configure Gitweb on Front for more information.

@@ -1050,14 +1050,14 @@ services on Front and Core. See 3.3 and
-
-

4.5. Configure Apache on Core

+
+

4.5. Configure Apache on Core

The Apache2 configuration on Core specifies three web sites (live, test, and campus). The live and test sites must operate just like the -site on Front. Their configurations include the same apache-abbey, -apache-photos, and apache-gitweb used on Front. +site on Front. Their configurations include the same apache-abbey, +apache-photos, and apache-gitweb used on Front.

@@ -1099,15 +1099,15 @@ site on Front. Their configurations include the same
-
-

4.6. Configure Documentation URLs

+
+

4.6. Configure Documentation URLs

The institute serves its /usr/share/doc/ on the house (campus) web site. This is a debugging convenience, making some HTML documentation more accessible, especially the documentation of software installed on Core and not on typical desktop clients. Also included: the Apache2 -directives that enable user Git publishing with Gitweb (defined here). +directives that enable user Git publishing with Gitweb (defined here).

-
-

4.8. Use Cloister Apt Cache

+
+

4.8. Use Cloister Apt Cache

Core itself will benefit from using the package cache, but should @@ -1170,8 +1170,8 @@ so caching their packages is not a priority.)

-
-

4.9. Configure NAGIOS

+
+

4.9. Configure NAGIOS

A small institute uses nagios4 to monitor the health of its network, @@ -1179,18 +1179,20 @@ with an initial smattering of monitors adopted from the Debian monitoring-plugins package. Thus a NAGIOS4 server on the abbey's Core monitors core network services, and uses nagios-nrpe-server to monitor Gate. The abbey adds several more monitors, installing -additional configuration files in /etc/nagios4/conf.d/, and another -customized check_sensors plugin (abbey_pisensors) in -/usr/local/sbin/ on the Raspberry Pis. +additional configuration files in /etc/nagios4/conf.d/, a +check_mdstat plugin from https://exchange.nagios.org/ on Core, and +another customized check_sensors plugin (abbey_pisensors) on the +Raspberry Pis.

-
-

4.9.1. Monitoring The Home Disk

+
+

4.9.1. Monitoring The Home Disk

The abbey adds monitoring of the space remaining on the volume at /home/ on Core. (The small institute only monitors the space -remaining on roots.) +remaining on roots.) The abbey also monitors of the state of the +RAID-5 array under /home/.

@@ -1205,8 +1207,25 @@ remaining on roots.) service_description Home Partition check_command check_local_disk!20%!10%!/home } + define service { + use local-service + host_name core + service_description Home RAID + check_command check_mdstat!md0!3 + } + define command { + command_name check_mdstat + command_line /usr/local/sbin/check_mdstat $ARG1$ $ARG2$ + } dest: /etc/nagios4/conf.d/abbey.cfg notify: Reload NAGIOS4. + +- name: Install NAGIOS monitor check_mdstat. + become: yes + copy: + src: ../abbey-core/files/check_mdstat + dest: /usr/local/sbin/check_mdstat + mode: u=rwx,g=rx,o=rx
@@ -1222,8 +1241,8 @@ remaining on roots.)
-
-

4.9.2. Custom NAGIOS Monitor abbey_pisensors

+
+

4.9.2. Custom NAGIOS Monitor abbey_pisensors

The check_sensors plugin is included in the package @@ -1318,10 +1337,98 @@ recognizable temperature in the sensors output.

-
-

4.9.3. Configure NAGIOS Monitoring of The Cloister

+
+

4.9.3. Stolen NAGIOS Monitor check_mdstat

+This check_mdstat plugin was copied from the NAGIOS Exchange (here). +It detects a failing disk in a multi-disk array. +

+ +
+roles_t/abbey-core/files/check_mdstat
#!/usr/bin/env bash
+
+# nagios script checks for failed raid device
+# linux software raid /proc/mdstat
+# karl@webmedianow.com 2013-10-01
+
+STATE_OK=0
+STATE_WARNING=1
+STATE_CRITICAL=2
+STATE_UNKNOWN=3
+STATE_DEPENDENT=4
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+usage() {
+cat <<-EOE
+Usage: $0 mdadm_device total_drives
+
+  mdadm_device is md0, md1, etc...
+  total_drives is 2 for mirror, or 3, 4 etc...
+
+Nagios script to check if failed drive in /proc/mdstat
+
+Example: raid 2 (2 disk mirror)
+  /opt/nagios/libexec/check_mdstat.sh md0 2
+
+Example: raid 5 with 8 disks
+  /opt/nagios/libexec/check_mdstat.sh md0 8
+
+EOE
+exit $STATE_UNKNOWN
+}
+
+if [ $# -lt 2 ]; then
+  usage
+fi
+
+cmd_device="$1"
+drive_num="$2"
+
+U=""
+for i in $(seq 1 $drive_num);
+do
+  U="${U}U"
+done
+
+uu="[${U}]"
+nn="[${drive_num}/${drive_num}]"
+
+#cat /proc/mdstat | grep -A 1 ^md1 | tail -1 | awk '{print ($(NF))}'
+# [UUUUUUUU] is OK raid
+# [_U] is Failed Drive
+
+# check if we have correct device...
+if cat /proc/mdstat | grep ^${cmd_device} | awk '{print $1}' | grep ^${cmd_device}$ >/dev/null 2>&1
+then
+  device=$cmd_device
+else
+  echo "Couldn't match $cmd_device"
+  exit $STATE_UNKNOWN 
+fi
+
+u_status=$(cat /proc/mdstat | grep -A 1 ^${device} | tail -1 | awk '{print ($(NF))}')
+n_status=$(cat /proc/mdstat | grep -A 1 ^${device} | tail -1 | awk '{print ($(NF-1))}')
+
+if [ $uu = $u_status ] && [ $nn = $n_status ]; then
+  echo "OK:  $device $n_status $u_status"
+  exit $STATE_OK
+else
+  echo "FAIL:  $device $n_status $u_status"
+  exit $STATE_CRITICAL
+fi
+
+
+
+
+
+
+
+

4.9.4. Configure NAGIOS Monitoring of The Cloister

+
+

The abbey adds monitoring for more servers: Dantooine and Kessel. They are abbey-cloister servers, so they are configured as small institute campus servers, like Gate, with an NRPE (a NAGIOS Remote @@ -1333,9 +1440,9 @@ The configurations for these servers are very similar to Gate's, but are idiosyncratically in flux.

-
-
4.9.3.1. Cloister Network Addresses
-
+
+
4.9.4.1. Cloister Network Addresses
+

The IP addresses of all three hosts are nice to use in the NAGIOS configuration (to avoid depending on name service) and so are @@ -1350,9 +1457,9 @@ kessel_addr: 10.84.138.10

-
-
4.9.3.2. Install NAGIOS Configurations
-
+
+
4.9.4.2. Install NAGIOS Configurations
+

The following task installs each host's NAGIOS configuration.

@@ -1370,9 +1477,9 @@ The following task installs each host's NAGIOS configuration.
-
-
4.9.3.3. NAGIOS Monitoring of Dantooine
-
+
+
4.9.4.3. NAGIOS Monitoring of Dantooine
+
roles_t/abbey-core/templates/nagios-dantooine.cfg
define host {
     use                     linux-server
@@ -1432,9 +1539,9 @@ The following task installs each host's NAGIOS configuration.
 
-
-
4.9.3.4. NAGIOS Monitoring of Kessel
-
+
+
4.9.4.4. NAGIOS Monitoring of Kessel
+
roles_t/abbey-core/templates/nagios-kessel.cfg
define host {
     use                     linux-server
@@ -1489,8 +1596,8 @@ The following task installs each host's NAGIOS configuration.
 
-
-

4.10. Install Munin

+
+

4.10. Install Munin

The abbey is experimenting with Munin. NAGIOS is all about notifying @@ -1523,9 +1630,11 @@ trends in resource usage. - name: Punt default Munin node. become: yes ini_file: - section: "[localhost.localdomain]" + section: "localhost.localdomain" state: absent + backup: true path: /etc/munin/munin.conf + notify: Restart Munin. - name: Configure actual Munin nodes. become: yes @@ -1579,14 +1688,24 @@ next task configures libsensors to ignore them.

-
-

4.11. Install Analog

+
+

4.11. Install Analog

The abbey's public web site's access and error logs are emailed regularly to webmaster, who saves them in /Logs/apache2-public/ -and runs analog to generate /WWW/campus/analog.html, available to -the campus as http://www/analog.html. +and runs analog as monkey to generate /WWW/campus/analog.html, +available to the campus as http://www/analog.html. +

+ +
+sudo -u monkey analog
+
+ +

+The analog package includes a manual, how-to's and examples in +/usr/share/doc/analog/. The HTML portions can be viewed on campus +at http://www/doc/analog/.

@@ -1595,25 +1714,22 @@ the campus as http://www/analog.html. become: yes apt: pkg=analog -- name: Configure Analog (removing old /var/log/apache/ LOGFILEs). - become: yes - lineinfile: - path: /etc/analog.cfg - regexp: '^LOGFILE /var/log/apache/' - state: absent - -- name: Configure Analog (adding new configuration lines). +- name: Configure Analog. become: yes + vars: + dir: /Logs/apache2-public lineinfile: path: /etc/analog.cfg - line: "{{ item }}" + regexp: "{{ item.regx }}" + line: "{{ item.line }}" insertafter: EOF loop: - - "LOGFILE /Logs/apache2-public/*-access.log.gz" - - "ALLCHART OFF" - - "DNS WRITE" - - "HOSTNAME \"{{ full_name }}\"" - - "OUTFILE /WWW/campus/analog.html" + - { regx: "^LOGFILE ", line: "LOGFILE {{ dir }}/202?????.log.gz" } + - { regx: "^OUTFILE ", line: "OUTFILE /WWW/campus/analog.html" } + - { regx: "HOSTNAME ", line: "HOSTNAME \"{{ full_name }}\"" } + - { regx: "^ALLCHART ", line: "ALLCHART OFF" } + - { regx: "^DNS ", line: "DNS WRITE" } + - { regx: "^DNSFILE ", line: "DNSFILE /Logs/dnscache" } - name: Create /Logs/. become: yes @@ -1622,6 +1738,14 @@ the campus as http://www/analog.html. state: directory mode: u=rwx,g=rx,o=rx +- name: Create /Logs/dnscache. + become: yes + file: + path: /Logs/dnscache + owner: monkey + group: monkey + mode: u=rw,g=r,o=r + - name: Create /Logs/apache2-public/. become: yes file: @@ -1630,12 +1754,19 @@ the campus as http://www/analog.html. owner: monkey group: staff mode: u=rwx,g=srwx,o=rx + +- name: Create /WWW/campus/analog/. + become: yes + file: + state: link + path: /WWW/campus/analog + src: /usr/share/analog/images
-
-

4.12. Add Monkey to Web Server Group

+
+

4.12. Add Monkey to Web Server Group

Monkey needs to be in www-data so that it can run @@ -1657,8 +1788,8 @@ user cloud accounts, found in files owned by www-data, files like

-
-

4.13. Install netpbm For Photo Processing

+
+

4.13. Install netpbm For Photo Processing

Monkey's photo processing scripts use netpbm commands like @@ -1675,8 +1806,8 @@ Monkey's photo processing scripts use netpbm commands like

-
-

5. The Abbey Gate Role

+
+

5. The Abbey Gate Role

Birchwood Abbey's gate is a $110 µPC configured as A Small Institute @@ -1688,8 +1819,8 @@ allows access to the Abbey's IoT appliances: a HomeAssistant and an Ecowitt hub.

-
-

5.1. The Abbey Gate's Network Interfaces

+
+

5.1. The Abbey Gate's Network Interfaces

The abbey gate's lan interface is the PC's built-in Ethernet @@ -1710,27 +1841,27 @@ The MAC address of each interface is set in private/vars.yml (see

-
-

5.2. The Abbey's IoT Network

+
+

5.2. The Abbey's IoT Network

To allow masquerading between the private subnets and wild, the following iptables(8) rules are added. They are very similar to the nat and filter table rules used by a small institute to masquerade -its lan to its isp (see the UFW Rules of a Small Institute). +its lan to its isp (see the UFW Rules of a Small Institute). The campus WireGuard™ subnet is not included because the campus Wi-Fi hosts should be routing to the wild subnet directly and are assumed to be masquerading as their access point(s).

-iot-nat
-A POSTROUTING -s {{   private_net_cidr }} -o wild -j MASQUERADE
+iot-nat
-A POSTROUTING -s {{   private_net_cidr }} -o wild -j MASQUERADE
 -A POSTROUTING -s {{ public_wg_net_cidr }} -o wild -j MASQUERADE
 
-iot-forward
-A ufw-user-forward -i lan -o wild -j ACCEPT
+iot-forward
-A ufw-user-forward -i lan -o wild -j ACCEPT
 -A ufw-user-forward -i wg0 -o wild -j ACCEPT
 
@@ -1741,12 +1872,12 @@ The second rule includes the campus VPN.

-
-

5.3. Configure UFW for IoT

+
+

5.3. Configure UFW for IoT

The following tasks install the additional rules in before.rules -and user.rules (as in Configure UFW). +and user.rules (as in Configure UFW).

@@ -1778,8 +1909,8 @@ and user.rules (as in Configur
-
-

5.4. The Abbey's Starlink Configuration

+
+

5.4. The Abbey's Starlink Configuration

The abbey connects to Starlink via Ethernet, and disables Starlink's @@ -1827,8 +1958,8 @@ at least our local network traffic out of view of our ISPs.

-
-

5.5. Alternate ISPs

+
+

5.5. Alternate ISPs

The abbey used to use a cell phone on a USB tether to get Internet @@ -1873,8 +2004,8 @@ service, using a 60-isp.yaml file similar to the lines below.

-
-

6. The Abbey Cloister Role

+
+

6. The Abbey Cloister Role

Birchwood Abbey's cloister is a small institute campus. The campus @@ -1889,17 +2020,18 @@ tasks, namely configuration required on Raspberry Pi OS machines.

Wireless clients are issued keys for the cloister VPN by the ./abbey client command which is currently identical to the ./inst client -command (described in The Client Command). The wireless, cloistered +command (described in The Client Command). The wireless, cloistered hosts never roam, are not associated with a member, and so are "campus" clients, issued keys with commands like this:

-./abbey client campus new-host-name
+./abbey client campus new-host-name \
+               S+6HaTnOwwhWgUGXjSBcPAvifKw+j8BDTRfq534gNW4=
 
-
-

6.1. Use Cloister Apt Cache

+
+

6.1. Use Cloister Apt Cache

The Apt-Cacher:TNG program does not work well on the frontier, so is @@ -1933,13 +2065,13 @@ local host.

-
-

6.2. Configure Cloister NRPE

+
+

6.2. Configure Cloister NRPE

Each cloistered host is a small institute campus host and thus is already running an NRPE server (a NAGIOS Remote Plugin Executor -server) with a custom inst_sensors monitor (described in Configure +server) with a custom inst_sensors monitor (described in Configure NRPE of A Small Institute). The abbey adds one complication: yet another check_sensors variant, abbey_pisensors, installed on Raspberry Pis (architecture aarch64) only. @@ -1978,8 +2110,8 @@ Raspberry Pis (architecture aarch64) only.

-
-

6.3. Install Munin Node

+
+

6.3. Install Munin Node

Each cloistered host is a Munin node. @@ -2030,8 +2162,8 @@ them.

-
-

6.4. Install Emacs

+
+

6.4. Install Emacs

The monks of the abbey are masters of the staff and Emacs. @@ -2047,8 +2179,8 @@ The monks of the abbey are masters of the staff and Emacs.

-
-

7. The Abbey Weather Role

+
+

7. The Abbey Weather Role

Birchwood Abbey now uses Home Assistant to record and display weather @@ -2075,8 +2207,8 @@ entities. These were labeled and organized on an "Abbey" dashboard.

-
-

8. The Abbey DVR Role

+
+

8. The Abbey DVR Role

The abbey uses AgentDVR to record video from PoE IP HD security @@ -2084,8 +2216,8 @@ cameras. It runs as user agentdvr and keeps all of its configuration and recordings in /home/agentdvr/.

-
-

8.1. Install AgentDVR

+
+

8.1. Install AgentDVR

AgentDVR is installed according to the iSpy web site's latest @@ -2109,8 +2241,8 @@ executes several sudo commands. These commands can be run by the agentdvr account if it has (temporary) authorization.

-
-

8.1.1. Prepare for AgentDVR Installation

+
+

8.1.1. Prepare for AgentDVR Installation

The following commands are manually executed to create the agentdvr @@ -2138,8 +2270,8 @@ sudo mv ~/01agentdvr /etc/sudoers.d/

-
-

8.1.2. Execute AgentDVR Installation

+
+

8.1.2. Execute AgentDVR Installation

With the above preparations, the system administrator can get a shell @@ -2160,8 +2292,8 @@ Ansible is run again.

-
-

8.1.3. Complete AgentDVR Installation

+
+

8.1.3. Complete AgentDVR Installation

When Ansible is run a second time, after the installation script, it @@ -2184,8 +2316,8 @@ sudo rm /etc/sudoers.d/01agentdvr

-
-

8.2. Configure User agentdvr

+
+

8.2. Configure User agentdvr

AgentDVR runs as the system user agentdvr, which is configured here. @@ -2224,8 +2356,8 @@ restoration of AgentDVR.)

-
-

8.3. Test For AgentDVR/

+
+

8.3. Test For AgentDVR/

The following task probes for the /home/agentdvr/AgentDVR/ @@ -2248,8 +2380,8 @@ remaining installation steps are skipped unless

-
-

8.4. Create AgentDVR Service

+
+

8.4. Create AgentDVR Service

This service definition came from the template downloaded (from here) @@ -2305,8 +2437,8 @@ by install.sh.

-
-

8.5. Create AgentDVR Storage

+
+

8.5. Create AgentDVR Storage

The abbey uses a separate volume to store surveillance recordings, @@ -2340,8 +2472,8 @@ location do not fail.

-
-

8.6. Install Custom NAGIOS Monitor abbey_dvr

+
+

8.6. Install Custom NAGIOS Monitor abbey_dvr

DVR hosts install a custom NRPE plugin named abbey_dvr to monitor @@ -2374,11 +2506,11 @@ the storage available on /DVR/.

-
-

8.7. Configure IP Cameras

+
+

8.7. Configure IP Cameras

-A new security camera is setup as described in Cloistering, after +A new security camera is setup as described in Cloistering, after which the camera should be accessible by name on the abbey networks. Assuming ping -c1 new works, the camera's web interface will be accessible at http://new/. @@ -2401,8 +2533,8 @@ protocol) is nice but optional.

-
-

8.8. Configure AgentDVR's Cameras

+
+

8.8. Configure AgentDVR's Cameras

After Ansible has configured and started the AgentDVR service, its web @@ -2441,8 +2573,8 @@ AgentDVR's Live View.

-
-

8.9. Configure AgentDVR's Default Storage

+
+

8.9. Configure AgentDVR's Default Storage

AgentDVR's web interface is also used to configure a default storage @@ -2454,8 +2586,8 @@ pressed before the task is complete.

-
-

8.10. Configure AgentDVR's Recordings

+
+

8.10. Configure AgentDVR's Recordings

After a default storage location has been configured, AgentDVR's @@ -2486,8 +2618,8 @@ parameters are set (in the Recording and Storage tabs).

-
-

8.11. Restore AgentDVR

+
+

8.11. Restore AgentDVR

When restoring /home/ from a backup copy, the user accounts are @@ -2503,8 +2635,8 @@ installs the system service configuration file and starts the service.

-
-

9. The Abbey TVR Role

+
+

9. The Abbey TVR Role

The abbey has a few TV tuners and a subscription to Schedules Direct @@ -2519,14 +2651,14 @@ configured to serve MythTV pages at e.g. http://new/mythweb/.

-A new TVR machine needs only Cloistering to prepare it for +A new TVR machine needs only Cloistering to prepare it for Ansible. As part of that process, it should be added to the tvrs group in the hosts file. An existing server can become a TVR machine by adding it to the tvrs group.

-
-

9.1. Include Abbey Variables

+
+

9.1. Include Abbey Variables

Private variables in private/vars-abbey.yml are needed, as in the @@ -2542,8 +2674,8 @@ directory, playbooks/.

-
-

9.2. Manually Build and Install MythTV

+
+

9.2. Manually Build and Install MythTV

Neither Debian nor the MythTV project provide binary packages of @@ -2572,8 +2704,8 @@ sudo apt install mythtv-backend

-
-

9.3. Restore MythTV

+
+

9.3. Restore MythTV

Restoring MythTV from a backup copy to a fresh TVR host: @@ -2601,8 +2733,8 @@ The .mythtv/config.xml file should provide the DB particulars

-
-

9.4. Manually Load DB Timezone Info

+
+

9.4. Manually Load DB Timezone Info

Starting with MythTV version 0.26, the time zone tables must be loaded @@ -2626,8 +2758,8 @@ e.g. 2022-09-13 20:15:41.

-
-

9.5. Create MythTV Storage Area

+
+

9.5. Create MythTV Storage Area

The backend does not have a default storage area for its recordings. @@ -2651,13 +2783,13 @@ creates that directory and ensures it has appropriate permissions.

-
-

9.6. Configure MythTV Backend

+
+

9.6. Configure MythTV Backend

With MythTV built and installed, the post-installation tasks addressed, and mythtv-backend.service started, go to the web page -at http://new:6544 and make the following selections. +at http://new:6544 and make the following selections.

    @@ -2668,12 +2800,12 @@ at http://new:6544 and make the following selectio
-
-

9.7. Configure Tuner

+
+

9.7. Configure Tuner

The abbey has a Silicon Dust Homerun HDTV Duo (with two tuners). It -is setup as described in Cloistering, after which the tuner is +is setup as described in Cloistering, after which the tuner is accessible by name (e.g. new) on the cloister network. Assuming ping -c1 new works, the tuner should be accessible via the hdhomerun_config_gui command, a graphical interface contributed to @@ -2684,8 +2816,8 @@ tuner's domain name or IP address can also be entered.

-
-

9.8. Add HDHomerun and Mr.Antenna

+
+

9.8. Add HDHomerun and Mr.Antenna

In MythTV Setup: @@ -2728,30 +2860,30 @@ any case, do not run mythfilldatabase.

-
-

9.9. Scan for New Channels

+
+

9.9. Scan for New Channels

-In MythTV Setup: +In MythTV Backend, the website on Core's port 6544, e.g. +http://malastare.birchwood.private:6544/:

+
    -
  • Choose "Channel Editor". -
      -
    • Navigate to the "Delete" button, leaving Video Source All (right -and down and down, or left six times, or sump'n). Confirm -deletion of all channels.
    • -
    • Choose video source Mr.Antenna, then Channel Scan. Scroll down to -the "scan" button and choose it (select and Enter).
    • -
    • Choose "Insert All" when the scan is complete and the count of -channels is presented. Delete All unused transports.
    • -
    • Save and Exit from the scan. Exit from the channel editor.
    • -
  • -
  • Exit MythTV Setup. Do not run mythfilldatabase.
  • +
  • Choose "MythTV Setup" (the gear) from the left sidebar.
  • +
  • Choose "Enable Updates" (at the top of the page).
  • +
  • Choose "Channel Editor" from the top tab bar.
  • +
  • Press "Delete".
  • +
  • Choose "Input Connections" from the top tab bar.
  • +
  • Choose (unfold) "HDHomeRun => Mr.Antenna".
  • +
  • Press "+ Scan for Channels".
  • +
  • Choose options? Eventually press "Scan"? And wait.
  • +
  • Choose to import all.
  • +
  • Choose "Restart Backend Full Operation".
-
-

9.10. Configure XMLTV

+
+

9.10. Configure XMLTV

The xmltv package, specifically its tv_grab_zz_sdjson program, is @@ -2786,7 +2918,7 @@ the list of "inputs" available in a postal code typically ends with the OTA (over the air) broadcasts.

-
+
 $ tv_grab_zz_sdjson --configure --config-file .mythtv/Mr.Antenna.xml
 Cache file for lineups, schedules and programs.
 Cache file: [/home/mythtv/.xmltv/tv_grab_zz_sdjson.cache]
@@ -2836,8 +2968,8 @@ backend is running, so it is not run until then.
 

-
-

9.11. Debug XMLTV

+
+

9.11. Debug XMLTV

If the mythfilldatabase command fails or expected listings do not @@ -2876,14 +3008,14 @@ Running a similar command (without --quiet) might be more revealing

-
-

9.12. Change Broadcast Area

+
+

9.12. Change Broadcast Area

The abbey changes location almost weekly, so its HDTV broadcast area changes frequently. At the start of a long stay the administrator uses the MythTV Setup program to scan for the new area's channels, as -described in Scan for New Channels. +described in Scan for New Channels.

@@ -2901,31 +3033,28 @@ program as user mythtv.

The program will prompt for the zip code and offer a list of "inputs" -available in that area, as described in Configure XMLTV. +available in that area, as described in Configure XMLTV.

-Then the administrator can re-start the backend. +Lastly, the administrator runs an immediate update (again as the +mythtv user).

-
sudo systemctl start mythtv-backend
+
mythfilldatabase
 

-And the mythtv account can run mythfilldatabase. +If the command fails, consult Debug XMLTV. Else, the listings appear +in MythTV Backend's "Program Guide" page.

- -
-
mythfilldatabase
-
-
-
-

10. The Ansible Configuration

+
+

10. The Ansible Configuration

The abbey's Ansible configuration, like that of A Small Institute, is @@ -2952,7 +3081,7 @@ specific versions.

-NOTE: if you have not read at least the Overview of A Small Institute +NOTE: if you have not read at least the Overview of A Small Institute you are lost.

@@ -2982,8 +3111,8 @@ rest are built up piecemeal by (tangled from) this document, README.org, and Institute/README.org.

-
-

10.1. ansible.cfg

+
+

10.1. ansible.cfg

This is much like the example (test) institutional configuration file, @@ -3000,11 +3129,11 @@ except the roles are found in Institute/roles/ as well as roles/.

-
-

10.2. hosts

+
+

10.2. hosts

-hosts
all:
+hosts
all:
   vars:
     ansible_user: sysadm
     ansible_ssh_extra_args: -i Secret/ssh_admin/id_rsa
@@ -3014,16 +3143,21 @@ except the roles are found in Institute/roles/ as well as roles/.
       ansible_host: 159.65.75.60
       ansible_become_password: "{{ become_droplet }}"
     anoat:
+      ansible_host: anoat.birchwood.private
       ansible_become_password: "{{ become_anoat }}"
     malastare:
+      ansible_host: malastare.birchwood.private
       ansible_become_password: "{{ become_malastare }}"
     # Campus
     kessel:
+      ansible_host: kessel.birchwood.private
       ansible_become_password: "{{ become_kessel }}"
     dantooine:
+      ansible_host: dantooine.birchwood.private
       ansible_become_password: "{{ become_dantooine }}"
     # Notebooks
     endor:
+      ansible_host: endor.birchwood.private
       ansible_become_password: "{{ become_endor }}"
     sullust:
       ansible_host: 127.0.0.1
@@ -3073,8 +3207,8 @@ except the roles are found in Institute/roles/ as well as roles/.
 
-
-

10.3. playbooks/site.yml

+
+

10.3. playbooks/site.yml

This playbook provisions the entire network by applying first the @@ -3115,17 +3249,17 @@ institutional roles, then the liturgical roles.

-
-

11. The Abbey Commands

+
+

11. The Abbey Commands

The ./abbey script encodes the abbey's canonical procedures. It -includes The Institute Commands and adds a few abbey-specific +includes The Institute Commands and adds a few abbey-specific sub-commands.

-
-

11.1. Abbey Command Overview

+
+

11.1. Abbey Command Overview

Institutional sub-commands: @@ -3150,11 +3284,12 @@ hosts.

reboots
Look for /run/reboot* on all hosts.
versions
Report ansible_distribution, _distribution_version, and _architecture for all hosts.
+
facts
Update (clobber!) facts.
-
-

11.2. Abbey Command Script

+
+

11.2. Abbey Command Script

The script begins with the following prefix and trampolines. @@ -3177,7 +3312,7 @@ The script begins with the following prefix and trampolines. The small institute's ./inst command expects to be running in Institute/, not ./, but it only references public/, private/, Secret/ and playbooks/check-inst-vars.yml, and will find the abbey -specific versions of these. The roles_path setting in ansible.cfg +specific versions of these. The roles_path setting in ansible.cfg effectively merges the institutional roles into the distinctly named abbey specific roles. The roles likewise reference files with relative names, and will find the abbey specific private/ @@ -3196,8 +3331,8 @@ code block "duplicates" the action of the institute's

-
-

11.3. The Upgrade Command

+
+

11.3. The Upgrade Command

The script implements an upgrade sub-command that runs apt update @@ -3262,8 +3397,8 @@ a limit pattern. For example:

-
-

11.4. The Reboots Command

+
+

11.4. The Reboots Command

The script implements a reboots sub-command that looks for @@ -3294,8 +3429,8 @@ The script implements a reboots sub-command that looks for

-
-

11.5. The Versions Command

+
+

11.5. The Versions Command

The script implements a versions sub-command that reports the @@ -3322,10 +3457,31 @@ operating system version of all abbey managed machines.

-
-

11.6. The TZ Command

+
+

11.6. The Facts Command

+The script implements a facts sub-command to collect the Ansible +"facts" from all and output them to the JSON format facts file. +

+ +
+abbey
if ($ARGV[0] eq "facts") {
+  my $line = ("ansible all -m gather_facts -e \@Secret/become.yml"
+              . " >facts");
+  print "$line\n";
+  my $status = system $line;
+  die "status: $status\nCould not run $line: $!\n" if $status != 0;
+  exit;
+}
+
+
+
+
+
+

11.7. The TZ Command

+
+

The abbey changes location almost weekly, so its timezone changes occasionally. Droplet does not move. Gate and other simple servers are kept in UTC. Core, the DVRs, TVRs, Home Assistant and the @@ -3402,19 +3558,20 @@ last host in the previous play.

-
-

11.7. Abbey Command Help

-
+
+

11.8. Abbey Command Help

+
-abbey
my $ops = "config,new,old,pass,client,upgrade,reboots,versions,tz";
+abbey
my $ops = ("config,new,old,pass,client,"
+           ."upgrade,reboots,versions,facts,tz");
 die "usage: $0 [$ops]\n";
 
-
-

12. Cloistering

+
+

12. Cloistering

This is how a new machine is brought into the cloister. The process @@ -3423,8 +3580,8 @@ narrows down to the common preparation of all machines administered by Ansible.

-
-

12.1. IoT Devices

+
+

12.1. IoT Devices

A wireless IoT device (smart TV, Blu-ray deck, etc.) cannot install @@ -3440,8 +3597,8 @@ given a private domain name as described in the following steps.

@@ -3451,12 +3608,12 @@ last step:

-
-

12.2. Raspberry Pis

+
+

12.2. Raspberry Pis

The abbey's Raspberry Pi runs the Raspberry Pi OS desktop off an NVMe @@ -3477,8 +3634,8 @@ Ethernet, and power up.

  • new username: sysadm
  • new password: <password>
  • -
  • Add to Core DHCP
  • -
  • Create Wired Domain Name
  • +
  • Add to Core DHCP
  • +
  • Create Wired Domain Name
  • Log in as sysadm on the console.
  • Run sudo raspi-config and use the following menu items.
      @@ -3486,9 +3643,9 @@ Ethernet, and power up.
    • I1 SSH (Enable/disable remote command line access using SSH): enable
    • A1 Expand Filesystem (Ensures that all of the SD card is available)
  • -
  • Update From Cloister Apt Cache
  • -
  • Authorize Remote Administration
  • -
  • Configure with Ansible
  • +
  • Update From Cloister Apt Cache
  • +
  • Authorize Remote Administration
  • +
  • Configure with Ansible
  • @@ -3497,14 +3654,14 @@ steps are taken.

    -
    -

    12.3. PCs

    +
    +

    12.3. PCs

    Most of the abbey's machines, like Core and Gate, are general-purpose @@ -3519,10 +3676,10 @@ USB drive and connect it to the PC. Ethernet, and power up. Choose to boot from the USB drive.

  • Answer first-boot installation questions as detailed in the preparation of A Test Machine for a Small Institute.
  • -
  • Add to Core DHCP
  • -
  • Create Wired Domain Name
  • +
  • Add to Core DHCP
  • +
  • Create Wired Domain Name
  • Log in as sysadm on the console.
  • -
  • Update From Cloister Apt Cache
  • +
  • Update From Cloister Apt Cache
  • Install OpenSSH, unless it already was when included in the initial Software selection during the Debian installation. Run the @@ -3531,8 +3688,8 @@ following if unsure.

     sudo apt install openssh-server
     
  • -
  • Authorize Remote Administration
  • -
  • Configure with Ansible
  • +
  • Authorize Remote Administration
  • +
  • Configure with Ansible
  • @@ -3541,14 +3698,14 @@ steps are taken.

    -
    -

    12.4. Add to Core DHCP

    +
    +

    12.4. Add to Core DHCP

    When a new machine is connected to the cloister Ethernet, its MAC @@ -3609,12 +3766,12 @@ reporting 1 packets transmitted, 1 received, 0% packet loss....

    -
    -

    12.5. Create Wired Domain Name

    +
    +

    12.5. Create Wired Domain Name

    A wired device is assigned an IP address when it is added to Core's -DHCP configuration (as in Add to Core DHCP). A private domain name is +DHCP configuration (as in Add to Core DHCP). A private domain name is then associated with this address. If the device is intended to operate wirelessly, the name for its address is modified with a -w suffix. Thus new-w.small.private would be the name of the new @@ -3657,8 +3814,8 @@ resolvectl query 192.168.56.4

    -
    -

    12.6. Update From Cloister Apt Cache

    +
    +

    12.6. Update From Cloister Apt Cache

    • Log in as sysadm on the console.
    • @@ -3681,8 +3838,8 @@ sudo reboot
    -
    -

    12.7. Authorize Remote Administration

    +
    +

    12.7. Authorize Remote Administration

    To remotely administer new-w, Ansible must be authorized to login as @@ -3716,11 +3873,11 @@ key.

    -
    -

    12.8. Configure with Ansible

    +
    +

    12.8. Configure with Ansible

    -With remote administration authorized and tested (as in Authorize +With remote administration authorized and tested (as in Authorize Remote Administration), and the machine connected to the cloister Ethernet, the configuration of new-w can be completed by Ansible. Note that if the machine is staying on the cloister Ethernet, its @@ -3728,7 +3885,7 @@ domain name will be new (having had no -w suffix added

    -First new-w is added to Ansible's inventory in hosts. A new-w +First new-w is added to Ansible's inventory in hosts. A new-w section is added to the list of all hosts, and an empty section of the same name is added to the list of campus hosts. If the machine uses the usual privileged account name, sysadm, the ansible_user key is @@ -3776,8 +3933,8 @@ configuration files.

    -
    -

    12.9. Connect to Cloister Wi-Fi

    +
    +

    12.9. Connect to Cloister Wi-Fi

    On an IoT device, or a Debian or Android "desktop", the cloister Wi-Fi @@ -3818,8 +3975,8 @@ desktop connected to the Wi-Fi using the following ping command.

    -
    -

    12.10. Connect to Cloister VPN

    +
    +

    12.10. Connect to Cloister VPN

    Wireless devices (with the cloister Wi-Fi password) can get an IP @@ -3832,14 +3989,14 @@ however, are not accessible except via the cloister VPN.

    Connections to the cloister VPN are authorized by the ./abbey -client... command (aka The Client Command), which registers a new +client... command (aka The Client Command), which registers a new client's public key and installs new WireGuard™ configurations on the servers. Private keys are kept on the clients (e.g. in /etc/wireguard/private-key).

    -
    -

    12.10.1. Campus Desktops and Servers

    +
    +

    12.10.1. Campus Desktops and Servers

    Wireless Debian desktops (with NetworkManager) as well as servers @@ -3925,8 +4082,8 @@ sudo systemctl enable wg-quick@wg0

    -
    -

    12.10.2. Private Desktops

    +
    +

    12.10.2. Private Desktops

    Member notebooks are private machines not remotely administered by the @@ -4038,8 +4195,8 @@ password is included in Secret/become.yml.

    -
    -

    12.10.3. Android

    +
    +

    12.10.3. Android

    Android phones and tablets are authorized to connect to the cloister @@ -4076,8 +4233,8 @@ public VPN.

    -
    -

    12.11. Create Wireless Domain Name

    +
    +

    12.11. Create Wireless Domain Name

    A wireless machine is assigned a Wi-Fi address when it connects to the @@ -4132,7 +4289,7 @@ be added to private/db.campus_vpn.)

    Author: Matt Birkholz

    -

    Created: 2025-09-18 Thu 20:56

    +

    Created: 2025-11-23 Sun 13:07

    Validate

    -- 2.25.1