add overriding truncated_namespace condition for truncating paths for digital ocean
authorAustin Lanari <austin@jumanji.io>
Sun, 24 Mar 2019 18:32:09 +0000 (11:32 -0700)
committerAustin Lanari <austin@jumanji.io>
Sun, 24 Mar 2019 18:32:09 +0000 (11:32 -0700)
lib/pleroma/uploaders/s3.ex

index e7de3f3e0de84da366987a3b0a89ca9429080c20..521daa93b6176d2d51aaa16159d89b987faa09ca 100644 (file)
@@ -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,