Fix config path lookup
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending

While I was attempting to set up an Akkoma instance using the OTP build,
I noticed that it was falling back to using `/etc/pleroma` instead of
`/etc/akkoma` for the config path.

As the `config.exs` file doesn't exist prior to running
`pleroma_ctl instance gen`, it tries to write to
`/etc/pleroma/config.exs` but the directory doesn't exist when following
the OTP install guide, so the config generation fails.

This patch should hopefully fix that.
This commit is contained in:
Norm 2022-08-02 21:57:52 -04:00
parent c9600dbbbf
commit f41b84b989
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -14,10 +14,10 @@ def load(config, opts) do
config_path =
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"
System.get_env("PLEROMA_CONFIG_PATH") -> System.get_env("PLEROMA_CONFIG_PATH")
File.exists?("/etc/pleroma/config.exs") -> "/etc/pleroma/config.exs"
true -> "/etc/akkoma/config.exs"
end
with_runtime_config =