From b2bcf75df61840cbaef4523d955f67c37fc18092 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 23 Nov 2025 12:51:30 -0700 Subject: [PATCH] Updated the Analog configuration. Replaced old settings. Include OUTFILE: /WWW/campus/analog.html. Create symlink /WWW/campus/analog/. Put the DNS cache in =/Logs/dnscache=, writable only by Monkey. --- README.org | 50 +++++++++++++++++++++---------- roles_t/abbey-core/tasks/main.yml | 40 ++++++++++++++++--------- 2 files changed, 60 insertions(+), 30 deletions(-) diff --git a/README.org b/README.org index 4d25e17..23d6e88 100644 --- a/README.org +++ b/README.org @@ -1488,8 +1488,14 @@ next task configures ~libsensors~ to ignore them. 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/~. #+CAPTION: [[file:roles_t/abbey-core/tasks/main.yml][=roles_t/abbey-core/tasks/main.yml=]] #+BEGIN_SRC conf :tangle roles_t/abbey-core/tasks/main.yml @@ -1498,25 +1504,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 @@ -1525,6 +1528,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: @@ -1533,6 +1544,13 @@ 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 #+END_SRC ** Add Monkey to Web Server Group diff --git a/roles_t/abbey-core/tasks/main.yml b/roles_t/abbey-core/tasks/main.yml index 5b602fb..32c7d96 100644 --- a/roles_t/abbey-core/tasks/main.yml +++ b/roles_t/abbey-core/tasks/main.yml @@ -287,25 +287,22 @@ 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 @@ -314,6 +311,14 @@ 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: @@ -323,6 +328,13 @@ 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 + - name: Add Monkey to Nextcloud group. become: yes user: -- 2.25.1