[#1668] Restricted access to app metrics endpoint by default. Added ability to configure IP whitelist for this endpoint.

Added tests and documentation.
This commit is contained in:
Ivan Tashkinov 2020-10-18 21:22:21 +03:00
commit 524fb0e4c2
6 changed files with 154 additions and 9 deletions

View file

@ -0,0 +1,19 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Helpers.InetHelper do
def parse_address(ip) when is_tuple(ip) do
{:ok, ip}
end
def parse_address(ip) when is_binary(ip) do
ip
|> String.to_charlist()
|> parse_address()
end
def parse_address(ip) do
:inet.parse_address(ip)
end
end