Add /_dendrite/admin/evacuateRoom/{roomID} (#2401)

* Add new endpoint to allow admins to evacuate the local server from the room

* Guard endpoint

* Use right prefix

* Auth API

* More useful return error rather than a panic

* More useful return value again

* Update the path

* Try using inputer instead

* oh provide the config

* Try that again

* Return affected user IDs

* Don't create so many forward extremities

* Add missing `Path` to name

Co-authored-by: Till <2353100+S7evinK@users.noreply.github.com>
This commit is contained in:
Neil Alexander 2022-04-28 16:02:30 +01:00 committed by GitHub
parent 21ee5b36a4
commit c6ea2c9ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 288 additions and 16 deletions

View file

@ -193,6 +193,7 @@ func main() {
base.PublicWellKnownAPIMux,
base.PublicMediaAPIMux,
base.SynapseAdminMux,
base.DendriteAdminMux,
)
wsUpgrader := websocket.Upgrader{

View file

@ -150,6 +150,7 @@ func main() {
base.PublicWellKnownAPIMux,
base.PublicMediaAPIMux,
base.SynapseAdminMux,
base.DendriteAdminMux,
)
if err := mscs.Enable(base, &monolith); err != nil {
logrus.WithError(err).Fatalf("Failed to enable MSCs")

View file

@ -153,6 +153,7 @@ func main() {
base.PublicWellKnownAPIMux,
base.PublicMediaAPIMux,
base.SynapseAdminMux,
base.DendriteAdminMux,
)
if len(base.Cfg.MSCs.MSCs) > 0 {

View file

@ -31,8 +31,10 @@ func ClientAPI(base *basepkg.BaseDendrite, cfg *config.Dendrite) {
keyAPI := base.KeyServerHTTPClient()
clientapi.AddPublicRoutes(
base.ProcessContext, base.PublicClientAPIMux, base.SynapseAdminMux, &base.Cfg.ClientAPI,
federation, rsAPI, asQuery, transactions.New(), fsAPI, userAPI, userAPI,
base.ProcessContext, base.PublicClientAPIMux,
base.SynapseAdminMux, base.DendriteAdminMux,
&base.Cfg.ClientAPI, federation, rsAPI, asQuery,
transactions.New(), fsAPI, userAPI, userAPI,
keyAPI, nil, &cfg.MSCs,
)

View file

@ -220,6 +220,7 @@ func startup() {
base.PublicWellKnownAPIMux,
base.PublicMediaAPIMux,
base.SynapseAdminMux,
base.DendriteAdminMux,
)
httpRouter := mux.NewRouter().SkipClean(true).UseEncodedPath()