Compare commits

...

3 Commits

Author SHA1 Message Date
itepechi 3b7ef1bad8 Add a setup question asking if the user wants to use AnalyzeMetadata 2023-09-27 05:32:18 +09:00
itepechi 7f9d011076 Update docs URL pattern 2023-09-27 05:30:44 +09:00
itepechi 613940ad8d Run mix format 2023-09-27 05:30:19 +09:00
4 changed files with 37 additions and 8 deletions

View File

@ -38,7 +38,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
listen_port: :string,
strip_uploads: :string,
anonymize_uploads: :string,
dedupe_uploads: :string
dedupe_uploads: :string,
analyze_uploads: :string
],
aliases: [
o: :output,
@ -216,6 +217,25 @@ defmodule Mix.Tasks.Pleroma.Instance do
"n"
) === "y"
{analyze_uploads_message, analyze_uploads_default} =
if Enum.all?(["mogrify", "convert", "ffprobe"], fn x ->
Pleroma.Utils.command_available?(x)
end) do
{"Do you want to analyse the metadata of uploaded media and generate blurry thumbnails of sensitive images? This depends on Imagemagick and FFmpeg, which are detected as already installed. (y/n)",
"y"}
else
{"Do you want to analyse the metadata of uploaded media and generate blurry thumbnails of sensitive images? This depends on Imagemagick and FFmpeg, which are detected as missing. (y/n)",
"n"}
end
analyze_uploads =
get_option(
options,
:analyze_uploads,
analyze_uploads_message,
analyze_uploads_default
) === "y"
Config.put([:instance, :static_dir], static_dir)
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
@ -258,7 +278,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
upload_filters(%{
strip: strip_uploads,
anonymize: anonymize_uploads,
dedupe: dedupe_uploads
dedupe: dedupe_uploads,
analyze: analyze_uploads
})
)
@ -354,6 +375,13 @@ defmodule Mix.Tasks.Pleroma.Instance do
enabled_filters
end
enabled_filters =
if filters.analyze do
enabled_filters ++ [Pleroma.Upload.Filter.AnalyzeMetadata]
else
enabled_filters
end
enabled_filters
end
end

View File

@ -34,9 +34,7 @@ defmodule Pleroma.Web.Plugs.OAuthScopesPlug do
permissions = Enum.join(missing_scopes, " #{op} ")
error_message =
dgettext("errors", "Insufficient permissions: %{permissions}.",
permissions: permissions
)
dgettext("errors", "Insufficient permissions: %{permissions}.", permissions: permissions)
conn
|> put_resp_content_type("application/json")

View File

@ -18,9 +18,10 @@ defmodule Pleroma.Mixfile do
# Docs
name: "Akkoma",
homepage_url: "https://akkoma.dev/",
source_url: "https://akkoma.dev/AkkomaGang/akkoma",
source_url: "https://git.itepechi.me/itepechi/akkoma",
docs: [
source_url_pattern: "https://akkoma.dev/AkkomaGang/akkoma/blob/develop/%{path}#L%{line}",
source_url_pattern:
"https://git.itepechi.me/itepechi/akkoma/src/branch/itepechi/%{path}#L%{line}",
logo: "priv/static/images/logo.png",
extras: ["README.md", "CHANGELOG.md"] ++ Path.wildcard("docs/**/*.md"),
groups_for_extras: [

View File

@ -11,7 +11,9 @@ defmodule Pleroma.Repo.Migrations.CreatePgroongaIndex do
)
)
execute("CREATE INDEX object_content_pgroonga ON objects USING pgroonga ((data->'content') pgroonga_jsonb_full_text_search_ops_v2)")
execute(
"CREATE INDEX object_content_pgroonga ON objects USING pgroonga ((data->'content') pgroonga_jsonb_full_text_search_ops_v2)"
)
end
def down do