From ac6faf3405f63422d28485c850859946ea30f350 Mon Sep 17 00:00:00 2001
From: jabertwo <git@jabertwo.de>
Date: Sat, 1 Jun 2024 22:43:43 +0200
Subject: [PATCH] some fixes for uffd

---
 webserver/docker_uffd/tasks/main.yml          | 11 +++++-----
 .../docker_uffd/templates/docker-compose.yml  |  2 +-
 webserver/docker_uffd/templates/uffd.cfg      | 22 +++++++++----------
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/webserver/docker_uffd/tasks/main.yml b/webserver/docker_uffd/tasks/main.yml
index 8051170e..747d458c 100644
--- a/webserver/docker_uffd/tasks/main.yml
+++ b/webserver/docker_uffd/tasks/main.yml
@@ -2,10 +2,10 @@
 
 - include_tasks: ../functions/get_secret.yml
   with_items:
-    - { path: "{{ basedir }}/secrets/mysql_admin_pass",  length: 24 }
-    - { path: "{{ basedir }}/secrets/mysql_user_pass",  length: 24 }
-    - { path: "{{ basedir }}/secrets/uffd_admin_pass",  length: 24 }
-    - { path: "{{ basedir }}/secrets/uffd_secret_key",  length: 64 }
+    - { path: "{{ basedir }}/secrets/mysql_admin_pass",  length: 32 }
+    - { path: "{{ basedir }}/secrets/mysql_user_pass",  length: 32 }
+    - { path: "{{ basedir }}/secrets/uffd_admin_pass",  length: 32 }
+    - { path: "{{ basedir }}/secrets/uffd_secret_key",  length: 32 }
     - { path: "{{ basedir }}/secrets/uffd_mail_pass",   length: 12 }
 
 - name: create folder struct for {{servicename}}
@@ -37,5 +37,4 @@
 - name: start {{servicename}} docker
   community.docker.docker_compose_v2:
     project_src: "{{ basedir }}"
-    state: present
-    build: always
+    state: present
\ No newline at end of file
diff --git a/webserver/docker_uffd/templates/docker-compose.yml b/webserver/docker_uffd/templates/docker-compose.yml
index fd4b853c..68613b89 100644
--- a/webserver/docker_uffd/templates/docker-compose.yml
+++ b/webserver/docker_uffd/templates/docker-compose.yml
@@ -24,7 +24,7 @@ services:
       TZ: "Europe/Berlin"
       UFFD_INITIAL_ADMIN_USER: "uffdadmin"
       UFFD_INITIAL_ADMIN_PW: "{{ uffd_admin_pass }}"
-      UFFD_INITIAL_ADMIN_MAIL: "uffdadmin@jabertwo.de"
+      UFFD_INITIAL_ADMIN_MAIL: "admin@{{ mail_domain.warpzonems.mxserver }}"
     labels:
       - com.centurylinklabs.watchtower.enable=false
       - traefik.enable=true
diff --git a/webserver/docker_uffd/templates/uffd.cfg b/webserver/docker_uffd/templates/uffd.cfg
index 6de25a93..62f59f70 100644
--- a/webserver/docker_uffd/templates/uffd.cfg
+++ b/webserver/docker_uffd/templates/uffd.cfg
@@ -14,12 +14,12 @@ ACL_ACCESS_GROUP="uffd_access"
 # Members can create invite links for signup
 ACL_SIGNUP_GROUP="uffd_signup"
 
-MAIL_SERVER='mail.test-warpzone.de' 
+MAIL_SERVER='{{ mail_domain.warpzonems.mxserver }}'
 MAIL_PORT=587
-MAIL_USERNAME='noreply-uffd@test-warpzone.de' 
+MAIL_USERNAME='noreply-uffd@{{ mail_domain.warpzonems.maildomain }}' 
 MAIL_PASSWORD='{{ uffd_mail_pass }}'
 MAIL_USE_STARTTLS=True
-MAIL_FROM_ADDRESS='noreply-uffd@test-warpzone.de'
+MAIL_FROM_ADDRESS='noreply-uffd@{{ mail_domain.warpzonems.maildomain }}'
 
 # Do not enable this on a public service! There is no spam protection implemented at the moment.
 SELF_SIGNUP=False
@@ -32,10 +32,10 @@ LOGINNAME_BLOCKLIST=['^admin$', '^root$']
 
 #MFA_ICON_URL = 'https://example.com/logo.png'
 #MFA_RP_ID = 'example.com' # If unset, hostname from current request is used
-MFA_RP_NAME = 'Uffd Test Service' # Service name passed to U2F/FIDO2 authenticators
+MFA_RP_NAME = 'Warpzone Uffd' # Service name passed to U2F/FIDO2 authenticators
 
 
-FOOTER_LINKS=[{"url": "https://example.com", "title": "example"}]
+FOOTER_LINKS=[{"url": "https://{{ global_domains.waprzonems.domain }}", "title": "warpzone"}]
 
 # The default page after login or clicking the top left home button is the self-service
 # page. If you would like it to be the services list instead, set this to True.
@@ -87,8 +87,8 @@ SERVICES=[
 
     {
 		'title': 'Icinga',
-		'url': 'https://icinga.test-warpzone.de',
-		'logo_url': 'https://icinga.test-warpzone.de/icingaweb2/img/favicon.png'
+		'url': 'https://icinga.{{ global_domains.waprzonems.domain }}',
+		'logo_url': 'https://icinga.{{ global_domains.waprzonems.domain }}/icingaweb2/img/favicon.png'
     }
 
 ]
@@ -106,14 +106,14 @@ SERVICES_PUBLIC=False
 LOGIN_BANNER='Always check the URL. Never enter your SSO password on any other site.'
 
 BRANDING_LOGO_URL='/static/empty.png'
-SITE_TITLE='uffd @ test-warpzone.de'
+SITE_TITLE='uffd @ {{ global_domains.warpzonems.domain }}'
 
 # Name and contact mail address are displayed to users in a few places (plain text only!)
-ORGANISATION_NAME='test-warpzone.de'
-ORGANISATION_CONTACT='uffd@test-warpzone.de'
+ORGANISATION_NAME='Warpzone'
+ORGANISATION_CONTACT='uffd@{{ mail_domain.warpzonems.maildomain }}'
 
 # Optional text included in account registration mails (plain text only!)
-WELCOME_TEXT='See https://docs.example.com/ for further information.'
+WELCOME_TEXT='Im Zweifel ist void schuld.'
 
 
 # DO set in production
-- 
GitLab