Skip to content
Snippets Groups Projects
Commit 58af0787 authored by Hakaba Hitoyo's avatar Hakaba Hitoyo
Browse files

add mdii uploader

parent 5c8b8f6c
Branches
No related tags found
No related merge requests found
......@@ -23,6 +23,9 @@ config :pleroma, Pleroma.Uploaders.S3,
public_endpoint: "https://s3.amazonaws.com",
force_media_proxy: false
config :pleroma, Pleroma.Uploaders.Mdii,
host_name: "mdii.sakura.ne.jp"
config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
config :pleroma, :uri_schemes,
......
defmodule Pleroma.Uploaders.Mdii do
@behaviour Pleroma.Uploaders.Uploader
def put_file(name, uuid, path, content_type, _should_dedupe) do
settings = Application.get_env(:pleroma, Pleroma.Uploaders.Mdii)
host_name = Keyword.fetch!(settings, :host_name)
{:ok, file_data} = File.read(path)
File.rm!(path)
remote_file_name = "00000"
extension = "png"
public_url = "https://#{host_name}/#{remote_file_name}.#{extension}"
{:ok, public_url}
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment