Compare commits
3 Commits
d9aaf0ee78
...
3b7ef1bad8
Author | SHA1 | Date |
---|---|---|
itepechi | 3b7ef1bad8 | |
itepechi | 7f9d011076 | |
itepechi | 613940ad8d |
|
@ -38,7 +38,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
|
||||||
listen_port: :string,
|
listen_port: :string,
|
||||||
strip_uploads: :string,
|
strip_uploads: :string,
|
||||||
anonymize_uploads: :string,
|
anonymize_uploads: :string,
|
||||||
dedupe_uploads: :string
|
dedupe_uploads: :string,
|
||||||
|
analyze_uploads: :string
|
||||||
],
|
],
|
||||||
aliases: [
|
aliases: [
|
||||||
o: :output,
|
o: :output,
|
||||||
|
@ -216,6 +217,25 @@ defmodule Mix.Tasks.Pleroma.Instance do
|
||||||
"n"
|
"n"
|
||||||
) === "y"
|
) === "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)
|
Config.put([:instance, :static_dir], static_dir)
|
||||||
|
|
||||||
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
|
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
|
||||||
|
@ -258,7 +278,8 @@ defmodule Mix.Tasks.Pleroma.Instance do
|
||||||
upload_filters(%{
|
upload_filters(%{
|
||||||
strip: strip_uploads,
|
strip: strip_uploads,
|
||||||
anonymize: anonymize_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
|
enabled_filters
|
||||||
end
|
end
|
||||||
|
|
||||||
|
enabled_filters =
|
||||||
|
if filters.analyze do
|
||||||
|
enabled_filters ++ [Pleroma.Upload.Filter.AnalyzeMetadata]
|
||||||
|
else
|
||||||
|
enabled_filters
|
||||||
|
end
|
||||||
|
|
||||||
enabled_filters
|
enabled_filters
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,9 +34,7 @@ defmodule Pleroma.Web.Plugs.OAuthScopesPlug do
|
||||||
permissions = Enum.join(missing_scopes, " #{op} ")
|
permissions = Enum.join(missing_scopes, " #{op} ")
|
||||||
|
|
||||||
error_message =
|
error_message =
|
||||||
dgettext("errors", "Insufficient permissions: %{permissions}.",
|
dgettext("errors", "Insufficient permissions: %{permissions}.", permissions: permissions)
|
||||||
permissions: permissions
|
|
||||||
)
|
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|> put_resp_content_type("application/json")
|
|> put_resp_content_type("application/json")
|
||||||
|
|
5
mix.exs
5
mix.exs
|
@ -18,9 +18,10 @@ defmodule Pleroma.Mixfile do
|
||||||
# Docs
|
# Docs
|
||||||
name: "Akkoma",
|
name: "Akkoma",
|
||||||
homepage_url: "https://akkoma.dev/",
|
homepage_url: "https://akkoma.dev/",
|
||||||
source_url: "https://akkoma.dev/AkkomaGang/akkoma",
|
source_url: "https://git.itepechi.me/itepechi/akkoma",
|
||||||
docs: [
|
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",
|
logo: "priv/static/images/logo.png",
|
||||||
extras: ["README.md", "CHANGELOG.md"] ++ Path.wildcard("docs/**/*.md"),
|
extras: ["README.md", "CHANGELOG.md"] ++ Path.wildcard("docs/**/*.md"),
|
||||||
groups_for_extras: [
|
groups_for_extras: [
|
||||||
|
|
|
@ -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
|
end
|
||||||
|
|
||||||
def down do
|
def down do
|
||||||
|
|
Loading…
Reference in New Issue