From 6c96d68f7715b7ce8f55ad7c880abeeabc2567d8 Mon Sep 17 00:00:00 2001 From: Austin Lanari Date: Sun, 24 Mar 2019 11:32:09 -0700 Subject: [PATCH] add overriding truncated_namespace condition for truncating paths for digital ocean --- lib/pleroma/uploaders/s3.ex | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/uploaders/s3.ex b/lib/pleroma/uploaders/s3.ex index e7de3f3e0..521daa93b 100644 --- a/lib/pleroma/uploaders/s3.ex +++ b/lib/pleroma/uploaders/s3.ex @@ -13,10 +13,15 @@ defmodule Pleroma.Uploaders.S3 do bucket = Keyword.fetch!(config, :bucket) bucket_with_namespace = - if namespace = Keyword.get(config, :bucket_namespace) do - namespace <> ":" <> bucket - else - bucket + cond do + truncated_namespace = Keyword.get(config, :truncated_namespace) -> + truncated_namespace + + namespace = Keyword.get(config, :bucket_namespace) -> + namespace <> ":" <> bucket + + true -> + bucket end {:ok, -- 2.45.2