ML-180: remove backup download feature
Delete ArchiveController, its routes, the maintenance UI backup button, and the test file. Management scripts and Litestream supersede this functionality.
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
defmodule MusicLibraryWeb.ArchiveController do
|
||||
use MusicLibraryWeb, :controller
|
||||
|
||||
# The database path is configuration controlled, and not derived from any
|
||||
# user input, so we can safely skip the check.
|
||||
# sobelow_skip ["Traversal.SendDownload"]
|
||||
def backup(conn, _params) do
|
||||
MusicLibrary.Repo.vacuum()
|
||||
|
||||
database_path = database_path()
|
||||
current_time = DateTime.utc_now()
|
||||
file_name = "music_library_#{DateTime.to_unix(current_time)}.db"
|
||||
|
||||
send_download(conn, {:file, database_path},
|
||||
filename: file_name,
|
||||
content_type: "application/x-sqlite3"
|
||||
)
|
||||
end
|
||||
|
||||
defp database_path do
|
||||
Application.get_env(:music_library, MusicLibrary.Repo)[:database]
|
||||
end
|
||||
end
|
||||
@@ -153,9 +153,6 @@ defmodule MusicLibraryWeb.MaintenanceLive.Index do
|
||||
>
|
||||
{gettext("Optimize")}
|
||||
</.button>
|
||||
<.button href={~p"/backup"}>
|
||||
{gettext("Backup")}
|
||||
</.button>
|
||||
</.button_group>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -63,8 +63,6 @@ defmodule MusicLibraryWeb.Router do
|
||||
scope "/" do
|
||||
pipe_through :logged_in
|
||||
|
||||
get "/backup", ArchiveController, :backup
|
||||
|
||||
get "/assets/:transform_payload", AssetController, :show
|
||||
|
||||
live_session :default,
|
||||
@@ -138,7 +136,6 @@ defmodule MusicLibraryWeb.Router do
|
||||
post "/errors/:id/resolve", ErrorController, :resolve
|
||||
post "/errors/:id/unresolve", ErrorController, :unresolve
|
||||
get "/assets/:transform_payload", AssetController, :show
|
||||
get "/backup", ArchiveController, :backup
|
||||
end
|
||||
|
||||
if Application.compile_env(:music_library, :monitoring_routes) do
|
||||
|
||||
Reference in New Issue
Block a user