diff --git a/.gitignore b/.gitignore index 65b6e1b..3f8d40d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,5 +35,5 @@ npm-debug.log /priv/cert/ dev.secret.exs -/uploads/* -!/uploads/.gitkeep \ No newline at end of file +priv/uploads/* +!priv/uploads/.gitkeep \ No newline at end of file diff --git a/lib/entendu_web/router.ex b/lib/entendu_web/router.ex index b6fb8b9..8ca6b02 100644 --- a/lib/entendu_web/router.ex +++ b/lib/entendu_web/router.ex @@ -18,7 +18,7 @@ defmodule EntenduWeb.Router do pipeline :authorized_files do plug AuthorizeLink - plug Plug.Static, at: "/uploads", from: Path.expand('./uploads'), gzip: false + plug Plug.Static, at: "/uploads", from: {:entendu "priv/uploads"}, gzip: false end pipeline :authorized_link do diff --git a/lib/entendu_web/uploaders/encrypted_link.ex b/lib/entendu_web/uploaders/encrypted_link.ex index f75d3c0..faf7a01 100644 --- a/lib/entendu_web/uploaders/encrypted_link.ex +++ b/lib/entendu_web/uploaders/encrypted_link.ex @@ -37,7 +37,7 @@ defmodule Entendu.EncryptedLink do # Override the storage directory: def storage_dir(version, {_file, scope}) do - "uploads/links/#{scope.id}" + "priv/uploads/links/#{scope.id}" end # Provide a default URL if there hasn't been a file uploaded diff --git a/uploads/.gitkeep b/priv/uploads/.gitkeep similarity index 100% rename from uploads/.gitkeep rename to priv/uploads/.gitkeep