From 033771d9f186012a066d8b42152a18076651171f Mon Sep 17 00:00:00 2001 From: RX14 Date: Thu, 5 Apr 2018 11:46:33 +0100 Subject: [PATCH] Fix failure to serve media from custom upload path --- lib/pleroma/upload.ex | 2 +- lib/pleroma/web/endpoint.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 8a9dc612a..e5df94009 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -58,7 +58,7 @@ def store(%{"img" => "data:image/" <> image_data}) do } end - defp upload_path do + def upload_path do settings = Application.get_env(:pleroma, Pleroma.Upload) Keyword.fetch!(settings, :uploads) end diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index dde4e3ffe..dfafc95f4 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -11,7 +11,7 @@ defmodule Pleroma.Web.Endpoint do # # You should set gzip to true if you are running phoenix.digest # when deploying your static files in production. - plug(Plug.Static, at: "/media", from: "uploads", gzip: false) + plug(Plug.Static, at: "/media", from: Pleroma.Upload.upload_path(), gzip: false) plug( Plug.Static,