mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 02:05:12 +00:00
better configuration
This commit is contained in:
parent
5b4a21317d
commit
e4dd58307a
|
@ -95,10 +95,10 @@ config :pleroma, :gopher,
|
||||||
ip: {0, 0, 0, 0},
|
ip: {0, 0, 0, 0},
|
||||||
port: 9999
|
port: 9999
|
||||||
|
|
||||||
config :pleroma, :suggestions, third_party_engine: false
|
config :pleroma, :suggestions,
|
||||||
# config :pleroma, :suggestions,
|
enabled: false,
|
||||||
# third_party_engine:
|
third_party_engine:
|
||||||
# "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}"
|
"http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}"
|
||||||
|
|
||||||
# Import environment specific config. This must remain at the bottom
|
# Import environment specific config. This must remain at the bottom
|
||||||
# of this file so it overrides the configuration defined above.
|
# of this file so it overrides the configuration defined above.
|
||||||
|
|
|
@ -1076,9 +1076,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
@suggestions Application.get_env(:pleroma, :suggestions)
|
@suggestions Application.get_env(:pleroma, :suggestions)
|
||||||
|
|
||||||
def suggestions(%{assigns: %{user: user}} = conn, _) do
|
def suggestions(%{assigns: %{user: user}} = conn, _) do
|
||||||
api = Keyword.get(@suggestions, :third_party_engine, false)
|
if Keyword.get(@suggestions, :enabled, false) do
|
||||||
|
api = Keyword.get(@suggestions, :third_party_engine, false)
|
||||||
|
|
||||||
if api do
|
|
||||||
host =
|
host =
|
||||||
Application.get_env(:pleroma, Pleroma.Web.Endpoint)
|
Application.get_env(:pleroma, Pleroma.Web.Endpoint)
|
||||||
|> Keyword.get(:url)
|
|> Keyword.get(:url)
|
||||||
|
|
|
@ -45,6 +45,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|
||||||
metadata: %{
|
metadata: %{
|
||||||
nodeName: Keyword.get(instance, :name),
|
nodeName: Keyword.get(instance, :name),
|
||||||
mediaProxy: Keyword.get(media_proxy, :enabled),
|
mediaProxy: Keyword.get(media_proxy, :enabled),
|
||||||
|
suggestions: Keyword.get(suggestions, :enabled, false),
|
||||||
suggestionsThirdPartyEngine: Keyword.get(suggestions, :third_party_engine, false)
|
suggestionsThirdPartyEngine: Keyword.get(suggestions, :third_party_engine, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue