From 03feecbfb0e04e199bef67d47806266ae8e43d67 Mon Sep 17 00:00:00 2001
From: MichiK <michik@michik.net>
Date: Fri, 11 Dec 2020 20:00:57 +0100
Subject: [PATCH] Adapt stuff to reality and allow embedding the angel guide

---
 host_vars/gabriel.c3heaven.de         | 19 ++++++++++++++-----
 roles/nginx-http/templates/default.j2 |  6 ++++++
 roles/postfix/templates/aliases.j2    | 24 ++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/host_vars/gabriel.c3heaven.de b/host_vars/gabriel.c3heaven.de
index 8945e1b..96b5576 100644
--- a/host_vars/gabriel.c3heaven.de
+++ b/host_vars/gabriel.c3heaven.de
@@ -19,6 +19,10 @@ nginx_https_sites:
       config: "return 301 https://wiki.c3heaven.de$1?$args;"
     - location: "~ /kanboard(.*)$"
       config: "return 301 https://kanboard.c3heaven.de$1?$args;"
+    - location: "~ /guide/(.*).pdf$"
+      config: |-
+          root /var/www/html;
+          add_header Access-Control-Allow-Origin *;
  - name: "www.c3heaven.de"
    locations:
     - location: "/"
@@ -88,7 +92,7 @@ nginx_https_sites:
         proxy_pass http://127.0.0.1:3000;
         proxy_cache_bypass $http_upgrade;
         proxy_redirect off;
-    - location: "~ ^/liste/?$"
+    - location: "~ ^/liste?/?$"
       config: |-
         return 301 https://$host/Liste;
  - name: "rt.c3heaven.de"
@@ -149,6 +153,15 @@ nginx_http_locations:
      log_not_found off;
      return 301 https://$host$request_uri;
 
+nginx_additional_http_servers:
+ - config: |-
+     listen 127.0.0.1:9001;
+     location / {
+       include /etc/nginx/fastcgi_params;
+       fastcgi_param SCRIPT_NAME "";
+       fastcgi_pass 127.0.0.1:9000;
+     }
+
 nginx_https_default_headers:
  - 'Strict-Transport-Security "max-age=31536000; includeSubDomains"'
  - 'X-XSS-Protection "1; mode=block"'
@@ -163,10 +176,6 @@ postfix_myorigin: "c3heaven.de"
 postfix_mynetworks: "127.0.0.1/32 159.69.40.72/32 10.23.42.0/24 [::1]/128 [2a01:4f8:c2c:df32::]/64 [fe80::9400:ff:fe31:9902]/128 [fe80::8400:ff:fe34:27e5]/128"
 postfix_generic_map:
  - "www-data@c3heaven.de noreply@c3heaven.de"
-postfix_additional_admin_aliases:
- - shift
- - shifts
- - ticket
 postfix_alias_maps:
  - "hash:/etc/aliases"
  - "hash:/var/lib/mailman/data/aliases"
diff --git a/roles/nginx-http/templates/default.j2 b/roles/nginx-http/templates/default.j2
index b288281..6669e83 100644
--- a/roles/nginx-http/templates/default.j2
+++ b/roles/nginx-http/templates/default.j2
@@ -16,3 +16,9 @@ server {
   }
 
 }
+
+{% for server in nginx_additional_http_servers %}
+server {
+{{ server.config | indent(width=2, indentfirst=True) }}
+}
+{% endfor %}
diff --git a/roles/postfix/templates/aliases.j2 b/roles/postfix/templates/aliases.j2
index e9eb21c..21b6c01 100644
--- a/roles/postfix/templates/aliases.j2
+++ b/roles/postfix/templates/aliases.j2
@@ -12,6 +12,30 @@ postmaster: admins
 webmaster: admins
 root: admins
 
+# rt aliases for events
+36c3: ticket
+rc3: ticket
+
+# generic rt aliases for standard tickets
+shift: ticket
+shifts: ticket
+tickets: ticket
+rt: ticket
+ticket: "| /usr/bin/rt-mailgate --url http://localhost:9001 --queue 'Allgemein' --action correspond"
+
+# buerokraten queue
+buerokratie: buero
+buerokraten: buero
+buero: "| /usr/bin/rt-mailgate --url http://localhost:9001 --queue 'Buerokratie' --action correspond"
+
+# additional rt queues
+angel-guide: "| /usr/bin/rt-mailgate --url http://localhost:9001 --queue 'Angel Guide' --action correspond"
+merch: "| /usr/bin/rt-mailgate --url http://localhost:9001 --queue 'Merch' --action correspond"
+feedback: "| /usr/bin/rt-mailgate --url http://localhost:9001 --queue 'Feedback' --action correspond"
+
+# noreply@ should be a blackhole for notification e-mails etc.
+noreply: /dev/null
+
 {% if postfix_additional_admin_aliases is defined and postfix_additional_admin_aliases%}
 # additional admin aliases
 {% for alias in postfix_additional_admin_aliases %}
-- 
GitLab