From c54ef3281cb84e40042a2ce3f304778e223792e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Sat, 26 Oct 2024 10:25:00 +0200 Subject: [PATCH] [task-183] [mod] authelia-for-hedgedoc --- roles/authelia-for-hedgedoc/tasks/main.json | 8 ++++++++ .../templates/authelia-client-conf.json.j2 | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/authelia-for-hedgedoc/tasks/main.json b/roles/authelia-for-hedgedoc/tasks/main.json index 23c6dab..d229a17 100644 --- a/roles/authelia-for-hedgedoc/tasks/main.json +++ b/roles/authelia-for-hedgedoc/tasks/main.json @@ -1,4 +1,12 @@ [ + { + "name": "configuration | compute client secret hash", + "become": true, + "ansible.builtin.shell": { + "cmd": "authelia crypto hash generate bcrypt --password {{var_authelia_for_hedgedoc_client_secret}} | cut --delimiter=' ' --fields='2-'" + }, + "register": "temp_authelia_for_hedgedoc_client_secret_hashed" + }, { "name": "configuration | emplace", "become": true, diff --git a/roles/authelia-for-hedgedoc/templates/authelia-client-conf.json.j2 b/roles/authelia-for-hedgedoc/templates/authelia-client-conf.json.j2 index f0c6af8..6fdd227 100644 --- a/roles/authelia-for-hedgedoc/templates/authelia-client-conf.json.j2 +++ b/roles/authelia-for-hedgedoc/templates/authelia-client-conf.json.j2 @@ -1,6 +1,6 @@ { "client_id": "{{var_authelia_for_hedgedoc_client_id}}", - "client_secret": "{{var_authelia_for_hedgedoc_client_secret}}", + "client_secret": "{{temp_authelia_for_hedgedoc_client_secret_hashed.stdout}}", "client_name": "Hedgedoc", "public": false, "authorization_policy": "one_factor",