logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: fd2477dfba1f167c7519a029bedd7ae6884a9f1d
parent f1f773f2c76b877f372767963a35c8e827f8d6e6
Author: feld <feld@feld.me>
Date:   Tue,  2 Feb 2021 18:37:20 +0000

Merge branch 'a1batross-develop-patch-62810' into 'develop'

mix: instance: ensure all needed folders are created before generating config

See merge request pleroma/pleroma!3284

Diffstat:

MCHANGELOG.md1+
Mlib/mix/tasks/pleroma/instance.ex11+++++++----
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -64,6 +64,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Tag URLs in statuses are now absolute - Removed duplicate jobs to purge expired activities - File extensions of some attachments were incorrectly changed. This feature has been disabled for now. +- Mix task pleroma.instance creates missing parent directories if the configuration or SQL output paths are changed. <details> <summary>API Changes</summary> diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex @@ -242,6 +242,13 @@ defmodule Mix.Tasks.Pleroma.Instance 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 @@ defmodule Mix.Tasks.Pleroma.Instance 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