From 1547a2fda441c6409a992d838849ba60285b50b4 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 28 Jan 2021 09:39:53 +0000 Subject: [PATCH 1/3] mix: instance: ensure all needed folders are created before generating config --- lib/mix/tasks/pleroma/instance.ex | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex index f272fdb7f..ffe580fa7 100644 --- a/lib/mix/tasks/pleroma/instance.ex +++ b/lib/mix/tasks/pleroma/instance.ex @@ -242,6 +242,13 @@ def run(["gen" | rest]) do rum_enabled: rum_enabled ) + config_dir = Path.dirname(config_path) + psql_dir = Path.dirname(psql_path) + + [config_dir, psql_dir, static_dir, uploads_dir] + |> Enum.reject(&File.exists?/1) + |> Enum.map(&File.mkdir_p!/1) + shell_info("Writing config to #{config_path}.") File.write(config_path, result_config) @@ -275,10 +282,6 @@ defp write_robots_txt(static_dir, indexable, template_dir) do indexable: indexable ) - unless File.exists?(static_dir) do - File.mkdir_p!(static_dir) - end - robots_txt_path = Path.join(static_dir, "robots.txt") if File.exists?(robots_txt_path) do From aaceb042c562161f289a0504dea8e688843a215e Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 28 Jan 2021 10:20:25 +0000 Subject: [PATCH 2/3] fix format --- lib/mix/tasks/pleroma/instance.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex index ffe580fa7..da27a99d0 100644 --- a/lib/mix/tasks/pleroma/instance.ex +++ b/lib/mix/tasks/pleroma/instance.ex @@ -244,7 +244,7 @@ def run(["gen" | rest]) do config_dir = Path.dirname(config_path) psql_dir = Path.dirname(psql_path) - + [config_dir, psql_dir, static_dir, uploads_dir] |> Enum.reject(&File.exists?/1) |> Enum.map(&File.mkdir_p!/1) From d0c2159b773de4fe4eb13dd4925a912c1b89c69c Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 2 Feb 2021 12:16:01 -0600 Subject: [PATCH 3/3] Mix pleroma.instance creates parent directories now --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f3867a2..3431d2afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Creating incorrect IPv4 address-style HTTP links when encountering certain numbers. - Reblog API Endpoint: Do not set visibility parameter to public by default and let CommonAPI to infer it from status, so a user can reblog their private status without explicitly setting reblog visibility to private. - Tag URLs in statuses are now absolute +- Mix task pleroma.instance creates missing parent directories if the configuration or SQL output paths are changed.
API Changes