Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Admin web page for instance management #78

Closed
tsmethurst opened this issue Jul 6, 2021 · 1 comment
Closed

[feature] Admin web page for instance management #78

tsmethurst opened this issue Jul 6, 2021 · 1 comment
Labels
enhancement New feature or request frontend Frontend-related stuff help wanted Extra attention is needed

Comments

@tsmethurst
Copy link
Contributor

tsmethurst commented Jul 6, 2021

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:

  • view and update instance information
  • create, view, delete domain blocks
  • import and export domain block lists

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#L31

Instance 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#L45

The 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#L39

A 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#L36

An 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 field domains is a json file containing an array of domains to block, and the query parameter import is set to true. See here: #77

An 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 parameter export set to true. -- This should also be possible through the admin page, a la Grafana's 'export this' functionality where it returns some copy-pasteable JSON.

@tsmethurst tsmethurst added enhancement New feature or request help wanted Extra attention is needed frontend Frontend-related stuff labels Jul 6, 2021
@f0x52
Copy link
Contributor

f0x52 commented Jul 14, 2021

Basic panel now lives at https://github.com/superseriousbusiness/gotosocial-admin, checks off all the features except there's currently no way to see the details of a domain block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Frontend-related stuff help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants