Make prod.secret.exs optional (with warning)
authorAlex Gleason <alex@alexgleason.me>
Sun, 16 May 2021 17:26:32 +0000 (12:26 -0500)
committerAlex Gleason <alex@alexgleason.me>
Sun, 16 May 2021 17:26:32 +0000 (12:26 -0500)
config/prod.exs

index adbce56066682508c0902086afe86bc2f38c8bec..0e151000b9215cd1e8840b8d321cd65260f623ee 100644 (file)
@@ -63,7 +63,12 @@ config :logger, :ex_syslogger, level: :info
 
 # Finally import the config/prod.secret.exs
 # which should be versioned separately.
-import_config "prod.secret.exs"
+if File.exists?("./config/prod.secret.exs") do
+  import_config "prod.secret.exs"
+else
+  "`config/prod.secret.exs` not found. You may want to create one by running `mix pleroma.instance gen`"
+  |> IO.warn([])
+end
 
 if File.exists?("./config/prod.exported_from_db.secret.exs"),
   do: import_config("prod.exported_from_db.secret.exs")