From 19f6b181bc2a67434e1f39f7c006207191c9f1b4 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 12 Feb 2025 13:36:29 +0100 Subject: [PATCH] Automatized logging by enable_debug variable --- roles/docker-friendica/templates/env.j2 | 12 +++++++----- roles/docker-friendica/vars/main.yml | 3 ++- .../templates/docker-compose.yml.j2 | 2 +- roles/docker-funkwhale/templates/env.j2 | 16 ++++++++-------- roles/sshd/templates/sshd_config.j2 | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/roles/docker-friendica/templates/env.j2 b/roles/docker-friendica/templates/env.j2 index 6ac91aa3..a41d9b50 100644 --- a/roles/docker-friendica/templates/env.j2 +++ b/roles/docker-friendica/templates/env.j2 @@ -1,12 +1,14 @@ +# The configuration options can be found here: +# @see https://hub.docker.com/_/friendica + FRIENDICA_URL= https://{{domain}} HOSTNAME= {{domain}} -FRIENDICA_NO_VALIDATION= false +FRIENDICA_NO_VALIDATION={{no_validation | lower}} # Debugging -FRIENDICA_DEBUGGING= false -FRIENDICA_LOGLEVEL= 5 -FRIENDICA_LOGGER= stream -FRIENDICA_LOGFILE= php=//stdout +FRIENDICA_DEBUGGING= {% if enable_debug | bool %}true{% else %}false{% endif %} +FRIENDICA_LOGLEVEL= 5 +FRIENDICA_LOGGER= syslog # Database Configuration MYSQL_HOST= "{{database_host}}:{{database_port}}" diff --git a/roles/docker-friendica/vars/main.yml b/roles/docker-friendica/vars/main.yml index a57e4ff3..da83e1f0 100644 --- a/roles/docker-friendica/vars/main.yml +++ b/roles/docker-friendica/vars/main.yml @@ -1,3 +1,4 @@ application_id: "friendica" database_password: "{{friendica_database_password}}" -database_type: "mariadb" \ No newline at end of file +database_type: "mariadb" +no_validation: "{{oidc.enabled}}" # Email validation is not neccessary if OIDC is active \ No newline at end of file diff --git a/roles/docker-funkwhale/templates/docker-compose.yml.j2 b/roles/docker-funkwhale/templates/docker-compose.yml.j2 index cc8ed238..93f71496 100644 --- a/roles/docker-funkwhale/templates/docker-compose.yml.j2 +++ b/roles/docker-funkwhale/templates/docker-compose.yml.j2 @@ -39,7 +39,7 @@ services: - "data:{{media_root}}" - "static_root:{{static_root}}" ports: - - "5000" + - "5000" # Exposes API just in local docker network to be used by front container {% include 'templates/docker/container/depends-on-database-redis.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %} diff --git a/roles/docker-funkwhale/templates/env.j2 b/roles/docker-funkwhale/templates/env.j2 index afe40964..a5ae964b 100644 --- a/roles/docker-funkwhale/templates/env.j2 +++ b/roles/docker-funkwhale/templates/env.j2 @@ -43,7 +43,7 @@ FUNKWHALE_HOSTNAME={{domain}} FUNKWHALE_PROTOCOL=https # Log level (debug, info, warning, error, critical) -LOGLEVEL=error +LOGLEVEL={% if enable_debug | bool %}debug{% else %}error{% endif %} # Configure e-mail sending using this variale # By default, funkwhale will output e-mails sent to stdout @@ -106,13 +106,13 @@ DJANGO_SECRET_KEY={{funkwhale_django_secret}} # Have a look at https://docs.funkwhale.audio/installation/ldap.html for # detailed instructions. -LDAP_ENABLED=True -LDAP_SERVER_URI={{ldap.server.uri}} -LDAP_BIND_DN={{ldap.dn.administrator}} -LDAP_BIND_PASSWORD={{applications.ldap.administrator_database_password}} -LDAP_SEARCH_FILTER=(|(cn={0})(mail={0})) # Needs to checked -LDAP_START_TLS=False -LDAP_ROOT_DN={{ldap.dn.root}} +LDAP_ENABLED = True +LDAP_SERVER_URI = "{{ldap.server.uri}}" +LDAP_BIND_DN = "{{ldap.dn.administrator}}" +LDAP_BIND_PASSWORD = "{{applications.ldap.administrator_database_password}}" +LDAP_SEARCH_FILTER = "(|(cn={0})(mail={0}))" +LDAP_START_TLS = False +LDAP_ROOT_DN = "{{ldap.dn.root}}" {% endif %} FUNKWHALE_FRONTEND_PATH=/srv/funkwhale/front/dist diff --git a/roles/sshd/templates/sshd_config.j2 b/roles/sshd/templates/sshd_config.j2 index 4c86f6fd..c8af6248 100644 --- a/roles/sshd/templates/sshd_config.j2 +++ b/roles/sshd/templates/sshd_config.j2 @@ -25,7 +25,7 @@ # Logging #SyslogFacility AUTH -#LogLevel INFO +LogLevel {% if enable_debug | bool %}DEBUG3{% else %}INFO{% endif %} # Authentication: