gotosocial/docs
Daenney 81f33c3b9f
[feature] Add media list command (#1943)
* [feature] Add media list command

This is an attempt to help alleviate #1776. Using admin media list
--local the full path to each local media file will be printed, with a
newline. The output of this should be feadable into backup tools in
order to allow to backup local media too. Together with the database
this should allow to fully recover from the loss of an instance.

The list command also gets a --remote flag for symmetry. In the case
of --remote we print the RemoteURL instead, the location the asset can
be retrieved from.

To get all media, you can run with --local and --remote.

* [bugfix] Fix the test failures

* [feature] Reimplement list media as top commands

This changes the implementation of admin media list --<variant> to two
separate top-level commands, list-local and list-remote.

The implementation now iterates over over the database in batches of 200
in order to avoid loading all media metadata into memory.

* [feature] Implement ListMedia with filter callback

This does away with the somewhat odd iterator-like structure we had
before and does away with most of the loop duplication in list-local and
list-remote. Instead they call GetAllMediaPaths with a filter func to
select the media they want. That's accumulated into a slice and
eventually returned.

* [bugfix] Simplify remote filter

Since we don't append the empty string anywhere, the remote filter can
be limited to returning RemoteURL, as that'll be an empty string for
local media.

* [docs] Add media list commands to CLI reference

---------

Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com>
2023-07-07 11:35:05 +02:00
..
admin [feature] Add media list command (#1943) 2023-07-07 11:35:05 +02:00
advanced [docs] Add certificates and firewalling to advanced (#1888) 2023-06-13 16:30:09 +02:00
api [feature] Add partial text search for accounts + statuses (#1836) 2023-06-21 17:26:40 +01:00
assets [docs] Add example tracing infrastructure (#1866) 2023-06-09 16:04:23 +02:00
configuration [docs] Clarify email requirement for OIDC (#1918) 2023-06-21 21:22:51 +02:00
federation [feature] Enable federation in/out of profile PropertyValue fields (#1722) 2023-05-09 11:16:10 +01:00
getting_started [docs] Disambiguate docker version, don't recommend opening localhost (#1913) 2023-06-20 14:36:23 +02:00
user_guide [docs] Explain that markdown is enabled on the user settings page. (#1699) 2023-04-19 13:42:47 +02:00
environment.yml [chore] update readthedocs deps, use conda (#1742) 2023-05-06 17:33:37 +02:00
faq.md [chore] Replace pinafore with semaphore (#1801) 2023-05-21 22:40:43 +02:00
index.md [docs] Update + simplify roadmap, revise beta estimate (#1826) 2023-05-26 18:00:30 +02:00
swagger.go [feature] Add List functionality (#1802) 2023-05-25 10:37:38 +02:00