From 45210bc5144681ea57a913e81d11f2c20194a901 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 12 Jul 2024 13:36:13 +0200 Subject: [PATCH] infra: auto reset password of public user --- nix/infra/backend.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nix/infra/backend.nix b/nix/infra/backend.nix index 81f8936..fbce48b 100644 --- a/nix/infra/backend.nix +++ b/nix/infra/backend.nix @@ -30,6 +30,28 @@ in }; }; + systemd.services.public-pw-reset = { + enable = true; + description = "Rest Public Password"; + serviceConfig = { + User = "root"; + script = '' + /root/fixpw.sh + ''; + }; + }; + + systemd.timers..public-pw-reset = { + enable = true; + description = "Rest Public Password"; + wants = [ "public-pw-reset.services" ]; + wantedBy = [ "multi-user.target" ]; + timerConfig = { + OnBootSec= "0min"; + OnCalendar = "*:0/1"; + }; + }; + services.postgresql = { enable = true; ensureDatabases = [ user ];