From f41b84b9897218e39f508cd775464b8f29b1d7e7 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Tue, 2 Aug 2022 21:57:52 -0400 Subject: [PATCH 1/2] Fix config path lookup 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. --- lib/pleroma/config/release_runtime_provider.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/config/release_runtime_provider.ex b/lib/pleroma/config/release_runtime_provider.ex index 1e4bddc59..a91e5ee0f 100644 --- a/lib/pleroma/config/release_runtime_provider.ex +++ b/lib/pleroma/config/release_runtime_provider.ex @@ -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 = -- 2.43.0 From 3f4c9fc2ba326c594aa26125e648adf89e55109e Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Tue, 2 Aug 2022 22:11:05 -0400 Subject: [PATCH 2/2] Update config path error message --- lib/pleroma/config/release_runtime_provider.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/config/release_runtime_provider.ex b/lib/pleroma/config/release_runtime_provider.ex index a91e5ee0f..e5f2d6339 100644 --- a/lib/pleroma/config/release_runtime_provider.ex +++ b/lib/pleroma/config/release_runtime_provider.ex @@ -31,7 +31,7 @@ def load(config, opts) do warning = [ IO.ANSI.red(), IO.ANSI.bright(), - "!!! Config path is not declared! Please ensure it exists and that PLEROMA_CONFIG_PATH is unset or points to an existing file", + "!!! Config path is not declared! Please ensure it exists and that AKKOMA_CONFIG_PATH and/or PLEROMA_CONFIG_PATH is unset or points to an existing file", IO.ANSI.reset() ] -- 2.43.0