removing migrate_from_db endpoint from admin api

This commit is contained in:
Alexander Strizhakov 2020-02-05 20:36:21 +03:00
commit 5db6ac8ee4
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
5 changed files with 2 additions and 74 deletions

View file

@ -97,7 +97,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
plug(
OAuthScopesPlug,
%{scopes: ["read"], admin: true}
when action in [:config_show, :migrate_from_db, :list_log]
when action in [:config_show, :list_log]
)
plug(
@ -793,19 +793,6 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|> Plug.Conn.send_resp(200, @descriptions_json)
end
def migrate_from_db(conn, _params) do
with :ok <- configurable_from_database(conn) do
Mix.Tasks.Pleroma.Config.run([
"migrate_from_db",
"--env",
to_string(Pleroma.Config.get(:env)),
"-d"
])
json(conn, %{})
end
end
def config_show(conn, %{"only_db" => true}) do
with :ok <- configurable_from_database(conn) do
configs = Pleroma.Repo.all(ConfigDB)

View file

@ -196,7 +196,6 @@ defmodule Pleroma.Web.Router do
get("/config", AdminAPIController, :config_show)
post("/config", AdminAPIController, :config_update)
get("/config/descriptions", AdminAPIController, :config_descriptions)
get("/config/migrate_from_db", AdminAPIController, :migrate_from_db)
get("/restart", AdminAPIController, :restart)
get("/moderation_log", AdminAPIController, :list_log)