]> birchwood-abbey.net Git - Network.git/commitdiff
Set 15min expiration on tellurion.png, any .png in /Tellurion/.
authorMatt Birkholz <matt@birchwood-abbey.net>
Mon, 12 Jan 2026 16:43:37 +0000 (09:43 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Mon, 12 Jan 2026 16:43:37 +0000 (09:43 -0700)
README.org
roles_t/abbey-core/tasks/main.yml
roles_t/abbey-front/tasks/main.yml

index 28f9af192193f4758cbdcaba003eb7dae5f15d55..6b27b6984b1591177f028a16587a13f418fb42fd 100644 (file)
@@ -498,6 +498,40 @@ AliasMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])/$ \
 AliasMatch /Photos/$ {{ docroot }}/Photos/index.html
 #+END_SRC
 
+** Configure Tellurion Expiration on Front
+
+The abbey's =tellurion.png= is updated every 15 minutes on the quarter
+hour, and should expire soon thereafter.  To accomplish this, Apache's
+~expires~ module is enabled inside the =/Tellurion/= directory and the
+=tellurion.png= uploaded there.
+
+#+NAME: apache-tellurion
+#+CAPTION: ~apache-tellurion~
+#+BEGIN_SRC conf
+<Directory {{ docroot }}/Tellurion/>
+    ExpiresActive On
+    ExpiresByType image/png "modification plus 15 minutes"
+</Directory>
+#+END_SRC
+
+Apache's Expires module must be enabled before the above directives
+will be accepted.
+
+#+CAPTION: [[file:roles_t/abbey-front/tasks/main.yml][=roles_t/abbey-front/tasks/main.yml]]
+#+BEGIN_SRC conf :tangle roles_t/abbey-front/tasks/main.yml :noweb no-export
+
+<<tellurion-tasks>>
+#+END_SRC
+
+#+NAME: tellurion-tasks
+#+CAPTION: ~tellurion-tasks~
+#+BEGIN_SRC conf
+- name: Enable Apache2 expires module.
+  become: yes
+  apache2_module: name=expires
+  notify: Restart Apache2.
+#+END_SRC
+
 ** Configure Apache on Front
 
 The abbey needs to add some Apache2 configuration directives to the
@@ -506,11 +540,11 @@ Luckily there is support for this in the institutional configuration.
 The abbey simply creates a =birchwood-abbey.net-vhost.conf= file in
 =/etc/apache2/sites-available/=.
 
-The following task adds the [[apache-abbey][~apache-abbey~]], [[apache-photos][~apache-photos~]], and
-[[apache-gitweb][~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][Install Let's Encrypt]] section.
+The following task adds the [[apache-gitweb][~apache-gitweb~]], [[apache-abbey][~apache-abbey~]],
+[[apache-photos][~apache-photos~]], and [[apache-tellurion][~apache-tellurion~]] 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][Install Let's Encrypt]] section.
 
 #+CAPTION: [[file:roles_t/abbey-front/tasks/main.yml][=roles_t/abbey-front/tasks/main.yml=]]
 #+BEGIN_SRC conf :tangle roles_t/abbey-front/tasks/main.yml :noweb no-export
@@ -527,6 +561,8 @@ rest of the Let's Encrypt configuration is discussed in the following
 
         <<apache-photos>>
 
+        <<apache-tellurion>>
+
         IncludeOptional /etc/letsencrypt/options-ssl-apache.conf
     dest: /etc/apache2/sites-available/birchwood-abbey.net-vhost.conf
   notify: Restart Apache2.
@@ -1024,12 +1060,24 @@ Front]] for more information.
 <<gitweb-handlers>>
 #+END_SRC
 
+** Configure Tellurion Expiration on Core
+
+The ~apache-tellurion~ directives are defined [[apache-tellurion][here]] and included in the
+Apache configuration below.  The ~tellurion-tasks~ are defined [[tellurion-tasks][here]]
+and included by the following code block.
+
+#+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 :noweb no-export
+
+<<tellurion-tasks>>
+#+END_SRC
+
 ** 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-abbey~]],
-[[apache-photos][~apache-photos~]], and [[apache-gitweb][~apache-gitweb~]] used on Front.
+site on Front.  Their configurations include the same [[apache-gitweb][~apache-gitweb~]],
+[[apache-abbey][~apache-abbey~]], [[apache-photos][~apache-photos~]], and [[apache-tellurion][~apache-tellurion~]] used on Front.
 
 #+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 :noweb no-export
@@ -1045,6 +1093,8 @@ site on Front.  Their configurations include the same [[apache-abbey][~apache-ab
         <<apache-abbey>>
 
         <<apache-photos>>
+
+        <<apache-tellurion>>
     dest: /etc/apache2/sites-available/live-vhost.conf
     mode: u=rw,g=r,o=r
   notify: Restart Apache2.
@@ -1060,6 +1110,8 @@ site on Front.  Their configurations include the same [[apache-abbey][~apache-ab
         <<apache-abbey>>
 
         <<apache-photos>>
+
+        <<apache-tellurion>>
     dest: /etc/apache2/sites-available/test-vhost.conf
     mode: u=rw,g=r,o=r
   notify: Restart Apache2.
index b6700db9f7d30a2f2f212d804acb1e6c7c8261ff..316f850ff96b149fb2b3d44b21e0a631b4491495 100644 (file)
     dest: /etc/gitweb.conf
     mode: u=rw,g=r,o=r
 
+- name: Enable Apache2 expires module.
+  become: yes
+  apache2_module: name=expires
+  notify: Restart Apache2.
+
 - name: Configure live website.
   become: yes
   vars:
         AliasMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])/$ \
                    {{ docroot }}/Photos/$1/$2/$3/index.html
         AliasMatch /Photos/$ {{ docroot }}/Photos/index.html
+
+        <Directory {{ docroot }}/Tellurion/>
+            ExpiresActive On
+            ExpiresByType image/png "modification plus 15 minutes"
+        </Directory>
     dest: /etc/apache2/sites-available/live-vhost.conf
     mode: u=rw,g=r,o=r
   notify: Restart Apache2.
         AliasMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])/$ \
                    {{ docroot }}/Photos/$1/$2/$3/index.html
         AliasMatch /Photos/$ {{ docroot }}/Photos/index.html
+
+        <Directory {{ docroot }}/Tellurion/>
+            ExpiresActive On
+            ExpiresByType image/png "modification plus 15 minutes"
+        </Directory>
     dest: /etc/apache2/sites-available/test-vhost.conf
     mode: u=rw,g=r,o=r
   notify: Restart Apache2.
index 1f6674961b3c8c365ed2affe5fffe2ccbae136be..8f05f4e842a1661b2f8b1f80beab6cbea3ced024 100644 (file)
     dest: /etc/gitweb.conf
     mode: u=rw,g=r,o=r
 
+- name: Enable Apache2 expires module.
+  become: yes
+  apache2_module: name=expires
+  notify: Restart Apache2.
+
 - name: Configure Apache.
   become: yes
   vars:
                    {{ docroot }}/Photos/$1/$2/$3/index.html
         AliasMatch /Photos/$ {{ docroot }}/Photos/index.html
 
+        <Directory {{ docroot }}/Tellurion/>
+            ExpiresActive On
+            ExpiresByType image/png "modification plus 15 minutes"
+        </Directory>
+
         IncludeOptional /etc/letsencrypt/options-ssl-apache.conf
     dest: /etc/apache2/sites-available/birchwood-abbey.net-vhost.conf
   notify: Restart Apache2.