Notices where this attachment appears
-
@Hyolobrika AGPL compliance:
defmodule Pleroma.Web.AkkomaAPI.FunController do
use Pleroma.Web, :controller
def image(text) do
wow = text |> String.replace(~r/[^\d.]/, "")
{output, 0} =
System.cmd("convert", [
"-background",
"#ffffff",
"-size",
"128x128",
"-fill",
"#000000",
"-gravity",
"center",
"label:lole your ip\\n#{wow}\\nyour ip lole",
"png:-"
])
output
end
@doc "GET /api/v1/akkoma/fun"
def ipv4(conn, %{}) do
ip =
conn.req_headers
|> Enum.into(%{})
|> Map.get("x-forwarded-for")
conn
|> put_resp_content_type("image/png")
|> send_resp(200, image(ip))
end
end
get("/fun", FunController, :ipv4) in scope "/api/v1/akkoma", Pleroma.Web.AkkomaAPI
caddy redir from media to https://eeeeeeeee.eu/api/v1/akkoma/fun