config :pleroma, :websub, Pleroma.Web.Websub
config :pleroma, :ostatus, Pleroma.Web.OStatus
-config :pleroma, :httpoison, HTTPoison
+config :pleroma, :httpoison, Pleroma.HTTP
version = with {version, 0} <- System.cmd("git", ["rev-parse", "HEAD"]) do
"Pleroma #{String.trim(version)}"
_ -> "Pleroma dev"
end
+config :pleroma, :http,
+ proxy_url: ""
+
config :pleroma, :instance,
version: version,
name: "Pleroma",
--- /dev/null
+
+defmodule Pleroma.HTTP do
+ use HTTPoison.Base
+
+ def process_request_options(options) do
+ config = Application.get_env(:pleroma, :http, [])
+ proxy = Keyword.get(config, :proxy_url, "")
+ case proxy do
+ "" -> options
+ _ -> options ++ [proxy: proxy]
+ end
+ end
+
+end