Commit d7e721f6 authored by Raito Bezarius's avatar Raito Bezarius
Browse files

plausible: fix admin user password seed and SMTP passwords

LoadCredential was misused as it is not building any environment variable,
it is the responsibility of our preStart to do it so
Plausible's script can pick it up.
parent 3cf540aa
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -238,9 +238,12 @@ in {
          path = [ cfg.package ]
            ++ optional cfg.database.postgres.setup config.services.postgresql.package;
          script = ''
            export CONFIG_DIR=$CREDENTIALS_DIRECTORY

            export RELEASE_COOKIE="$(< $CREDENTIALS_DIRECTORY/RELEASE_COOKIE )"
            export ADMIN_USER_PWD="$(< $CREDENTIALS_DIRECTORY/ADMIN_USER_PWD )"
            export SECRET_KEY_BASE="$(< $CREDENTIALS_DIRECTORY/SECRET_KEY_BASE )"

            ${lib.optionalString (cfg.mail.smtp.passwordFile != null)
              ''export SMTP_USER_PWD="$(< $CREDENTIALS_DIRECTORY/SMTP_USER_PWD )"''}

            # setup
            ${cfg.package}/createdb.sh