From f4c06f7faaeddd82991c75dfb69a8f9fa05b7949 Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 27 Jul 2023 09:07:06 -0700 Subject: [PATCH] Database user isn't created --- mastodon-container.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/mastodon-container.nix b/mastodon-container.nix index eed1097..63725fc 100644 --- a/mastodon-container.nix +++ b/mastodon-container.nix @@ -221,9 +221,6 @@ in { WEB_DOMAIN = cfg.web-domain; REDIS_HOST = "redis"; REDIS_PORT = 6379; - DB_USER = "mastodon"; - DB_NAME = "mastodon"; - DB_PASS = databasePasswd; SMTP_SERVER = cfg.smtp.server; SMTP_PORT = toString cfg.smtp.port; SMTP_FROM_ADDRESS = "noreply@${cfg.web-domain}"; @@ -233,11 +230,21 @@ in { target-file = "/run/mastodon/common.env"; }; postgresEnv = { - source-file = makeEnvFile { DB_HOST = "/var/run/postgresql"; }; + source-file = makeEnvFile { + DB_HOST = "/var/run/postgresql"; + POSTGRES_USER = "mastodon"; + POSTGRES_PASSWORD = databasePasswd; + POSTGRES_DB = "mastodon"; + }; target-file = "/run/mastodon/postgres.env"; }; mastodonEnv = { - source-file = makeEnvFile { DB_HOST = "postgres"; }; + source-file = makeEnvFile { + DB_HOST = "postgres"; + DB_USER = "mastodon"; + DB_NAME = "mastodon"; + DB_PASS = databasePasswd; + }; target-file = "/run/mastodon/mastodon.env"; }; };