aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2026-01-17 18:49:35 +0100
committeralex <alex@pdp7.net>2026-01-17 18:49:35 +0100
commit92b4ee5268f96dc23cf632e674117540877efd96 (patch)
tree6b6e66f9e27d25a83c0774975d775b0ebddf9c4a
parent762cfec4dae85dcf3ad76bcb02a1f8757e558f29 (diff)
Enable Gemini content negotiation, for indexes too
-rw-r--r--infrastructure/roles/web/README.md1
-rw-r--r--infrastructure/roles/web/tasks/main.yaml15
2 files changed, 16 insertions, 0 deletions
diff --git a/infrastructure/roles/web/README.md b/infrastructure/roles/web/README.md
index 65f042a..f0a3548 100644
--- a/infrastructure/roles/web/README.md
+++ b/infrastructure/roles/web/README.md
@@ -3,3 +3,4 @@
You can create `$HOME/public_html` and Apache http exposes content to `/~$USER/`.
Content negotiation is enabled by default, so a request to `/~foo/bar` serves `/home/foo/public_html/bar.html`.
+Content negotiation applies to indexes too.
diff --git a/infrastructure/roles/web/tasks/main.yaml b/infrastructure/roles/web/tasks/main.yaml
index 6e18cfa..bfa56f7 100644
--- a/infrastructure/roles/web/tasks/main.yaml
+++ b/infrastructure/roles/web/tasks/main.yaml
@@ -55,3 +55,18 @@
RedirectMatch "^/$" "https://ñix.es/cgit/alex/ñix.es.git/about/"
</VirtualHost>
notify: restart web
+- name: gemini
+ ansible.builtin.copy:
+ dest: /etc/apache2/conf-enabled/gemini.conf
+ content: |
+ AddType text/gemini .gmi
+ # With the default dir module configuration disabled, DirectoryIndex index enables multiviews for indexes.
+ # This means that you can have index.html and index.gmi and the client and server will negotiate which content to deliver.
+ DirectoryIndex index
+ LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
+ notify: restart web
+- name: disable dir mod
+ ansible.builtin.command:
+ cmd: a2dismod -f dir
+ removes: /etc/apache2/mods-enabled/dir.conf
+ notify: restart web