[feature] Admin web page for instance management #78
Labels
enhancement
New feature or request
frontend
Frontend-related stuff
help wanted
Extra attention is needed
We should have a web page served at
https://example.org/admin
(and sub-paths) which allows an instance admin to manage settings for the instance. Web pages should follow the templating pattern established for the instance base path by @f0x52, for showing current settings, and make simple POST or PATCH form requests for updating information.An admin should be able to:
Instance information updating eg
https://example.org/admin/instance
Current instance info can be retrieved by calling
/api/v1/instance
(see eg: https://testingtesting123.xyz/api/v1/instance), which calls the Processor function here: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/processing/instance.go#L31Instance info can be updated by calling a PATCH to
/api/v1/instance
, which calls the Processor function here: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/processing/instance.go#L45The form to submit for an update is modeled here: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/api/model/instance.go#L77
Domain block creation, viewing, and deletion eg
https://example.org/admin/federation
Admin should be able to view a list of current domain blocks, probably with pagination since there could be a lot of them (pixie.town and rage.love for example both have hundreds of domain blocks).
Domain blocks can be retrieved by calling
/api/v1/admin/domain_blocks
, which calls the Processor function here: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/processing/admin.go#L39A new domain block can be created by a POST to
/api/v1/admin/domain_blocks
, which calls the Processor function here: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/processing/admin.go#L31 with the following model: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/api/model/domainblock.go#L36An individual domain block can be viewed by calling
/api/v1/admin/domain_blocks/DOMAIN_BLOCK_ID
, and deleted by a DELETE to that path.Domain blocklist import/export
https://example.org/admin/federation
To mass import domain blocks, a form can be submitted as a POST to the
/api/v1/admin/domain_blocks
path given above, where the form fielddomains
is a json file containing an array of domains to block, and the query parameterimport
is set totrue
. See here: #77An admin should be able to upload this file through the admin page as well.
To retrieve a list of blocked domains for sharing elsewhere, without all the domain block IDs and other extraneous information, an admin can make a GET to
/api/v1/admin/domain_blocks
with the query parameterexport
set totrue
. -- This should also be possible through the admin page, a la Grafana's 'export this' functionality where it returns some copy-pasteable JSON.The text was updated successfully, but these errors were encountered: