Fix config path lookup (#51)
authornorm <normandy@biribiri.dev>
Wed, 6 Jul 2022 18:28:41 +0000 (18:28 +0000)
committerfloatingghost <hannah@coffee-and-dreams.uk>
Wed, 6 Jul 2022 18:28:41 +0000 (18:28 +0000)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/51
Co-authored-by: norm <normandy@biribiri.dev>
Co-committed-by: norm <normandy@biribiri.dev>
lib/pleroma/config/release_runtime_provider.ex

index e5e9d3dcd2c2a1019d990e76bfdaa9abb154e589..1e4bddc59bdf1e4ac2581c58cf42859872419a5e 100644 (file)
@@ -12,7 +12,13 @@ defmodule Pleroma.Config.ReleaseRuntimeProvider do
     with_defaults = Config.Reader.merge(config, Pleroma.Config.Holder.release_defaults())
 
     config_path =
-      opts[:config_path] || System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs"
+      cond do
+        opts[:config_path] -> opts[:config_path]
+        System.get_env("PLEROMA_CONFIG_PATH") -> System.get_env("PLEROMA_CONFIG_PATH")
+        System.get_env("AKKOMA_CONFIG_PATH") -> System.get_env("AKKOMA_CONFIG_PATH")
+        File.exists?("/etc/akkoma/config.exs") -> "/etc/akkoma/config.exs"
+        true -> "/etc/pleroma/config.exs"
+      end
 
     with_runtime_config =
       if File.exists?(config_path) do