ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 9da7771a23ac4bce26dd7165223a1781f53b3651
parent 18ddd15685eaacc872621db40c2603adca0d7145
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 23 Jan 2021 16:55:13 +0100

synapse: add schildichat-web
5 files changed, 83 insertions(+), 3 deletions(-)
diff --git a/config-files/schildichat-web/config.json b/config-files/schildichat-web/config.json
@@ -0,0 +1,51 @@
+{
+    "default_server_config": {
+        "m.homeserver": {
+            "base_url": "https://matrix.ctu.cx",
+            "server_name": "ctu.cx"
+        },
+        "m.identity_server": {
+            "base_url": "https://vector.im"
+        }
+    },
+    "disable_custom_urls": false,
+    "disable_guests": false,
+    "disable_login_language_selector": false,
+    "disable_3pid_login": true,
+    "brand": "ctucx.matrix",
+    "integrations_ui_url": "https://scalar.vector.im/",
+    "integrations_rest_url": "https://scalar.vector.im/api",
+    "integrations_widgets_urls": [
+        "https://scalar.vector.im/_matrix/integrations/v1",
+        "https://scalar.vector.im/api",
+        "https://scalar-staging.vector.im/_matrix/integrations/v1",
+        "https://scalar-staging.vector.im/api",
+        "https://scalar-staging.riot.im/scalar/api"
+    ],
+    "defaultCountryCode": "DE",
+    "showLabsSettings": true,
+    "features": {
+        "feature_new_spinner": true
+    },
+    "default_federate": true,
+    "default_theme": "dark",
+    "roomDirectory": {
+        "servers": [
+            "matrix.org"
+        ]
+    },
+    "enable_presence_by_hs_url": {
+        "https://matrix.org": false,
+        "https://matrix-client.matrix.org": false
+    },
+    "settingDefaults": {
+        "breadcrumbs": true,
+        "UIFeature.flair": false,
+        "UIFeature.communities": false,
+        "UIFeature.deactivate": false,
+        "UIFeature.registration": false
+    },
+    "jitsi": {
+        "preferredDomain": "meet.jit.si"
+    }
+}+
\ No newline at end of file
diff --git a/configuration/wanderduene.yml b/configuration/wanderduene.yml
@@ -308,7 +308,7 @@ services:
     configPath: config-files/synapse
     webClient:
       enable: true
-      configFile: config-files/riot-web/config.json
+      configFile: config-files/schildichat-web/config.json
     nginx:
       enable: true
       domain: "matrix.ctu.cx"
diff --git a/roles/synapse/tasks/configure.yml b/roles/synapse/tasks/configure.yml
@@ -14,6 +14,18 @@
     dest: "/etc/riot-web/config.json"
     mode: 0644
   when:
+    - system.enableOwnRepos is false
+    - ansible_distribution == "Alpine"
+    - services.synapse.webClient.enable is defined
+    - services.synapse.webClient.enable is true
+
+- name: "[Alpine] Copy web-config to: /etc/schildichat-web/config.json"
+  copy:
+    src: "{{ services.synapse.webClient.configFile }}"
+    dest: "/etc/schildichat-web/config.json"
+    mode: 0644
+  when:
+    - system.enableOwnRepos is true
     - ansible_distribution == "Alpine"
     - services.synapse.webClient.enable is defined
     - services.synapse.webClient.enable is true
diff --git a/roles/synapse/tasks/install.yml b/roles/synapse/tasks/install.yml
@@ -14,6 +14,18 @@
     state: present
     update_cache: yes
   when:
+    - system.enableOwnRepos is false
+    - ansible_distribution == "Alpine" 
+    - services.synapse.webClient.enable is defined
+    - services.synapse.webClient.enable is true
+
+- name: "[Alpine] Install package: schildichat-web"
+  apk:
+    name: schildichat-web
+    state: present
+    update_cache: yes
+  when:
+    - system.enableOwnRepos is true
     - ansible_distribution == "Alpine" 
     - services.synapse.webClient.enable is defined
     - services.synapse.webClient.enable is true
diff --git a/roles/synapse/templates/nginx-vhost.conf.j2 b/roles/synapse/templates/nginx-vhost.conf.j2
@@ -18,7 +18,11 @@ server {
 
 	{% if ansible_distribution == "Alpine" %}
 	location / {
-		root /usr/share/webapps/riot-web;
+		{% if system.enableOwnRepos == true %}
+		root /usr/share/webapps/schildichat-web;
+		{% else %}
+		root /usr/share/webapps/riot-web;		
+		{% endif %}
 	}
 	{% else %}
 	location / {

@@ -55,7 +59,7 @@ server {
 
 	{% if ansible_distribution == "Alpine" %}
 	location / {
-		root /usr/share/webapps/riot-web;
+		root /usr/share/webapps/schildichat-web;
 	}
 	{% else %}
 	location / {