Import release config from env variable or /etc/pleroma/config.exs and
authorrinpatch <rinpatch@sdf.org>
Tue, 11 Jun 2019 15:55:55 +0000 (18:55 +0300)
committerrinpatch <rinpatch@sdf.org>
Tue, 11 Jun 2019 15:55:55 +0000 (18:55 +0300)
warn if the file is missing

config/releases.exs

index becde76932f3561fd09d73464d43f1f7769ed87d..f8494dd345c47296a258463e02baaced86c3efbb 100644 (file)
@@ -1 +1,16 @@
 import Config
+
+config_path = System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs"
+
+if File.exists?(config_path) do
+  import_config config_path
+else
+  warning = [
+    IO.ANSI.red(),
+    IO.ANSI.bright(),
+    "!!! #{config_path} not found! Please ensure it exists and that PLEROMA_CONFIG_PATH is unset or points to an existing file",
+    IO.ANSI.reset()
+  ]
+
+  IO.puts(warning)
+end