2024-05-09 01:26:05 +00:00
|
|
|
# Maintaining your conduwuit setup
|
|
|
|
|
|
|
|
## Moderation
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
conduwuit has moderation through admin room commands. "binary commands" (medium
|
|
|
|
priority) and an admin API (low priority) is planned. Some moderation-related
|
|
|
|
config options are available in the example config such as "global ACLs" and
|
|
|
|
blocking media requests to certain servers. See the example config for the
|
|
|
|
moderation config options under the "Moderation / Privacy / Security" section.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
|
|
|
conduwuit has moderation admin commands for:
|
2024-07-03 07:49:33 +00:00
|
|
|
|
2024-05-09 01:26:05 +00:00
|
|
|
- managing room aliases (`!admin rooms alias`)
|
|
|
|
- managing room directory (`!admin rooms directory`)
|
|
|
|
- managing room banning/blocking and user removal (`!admin rooms moderation`)
|
|
|
|
- managing user accounts (`!admin users`)
|
|
|
|
- fetching `/.well-known/matrix/support` from servers (`!admin federation`)
|
2024-08-24 03:13:43 +00:00
|
|
|
- blocking incoming federation for certain rooms (not the same as room banning)
|
|
|
|
(`!admin federation`)
|
2024-05-09 01:26:05 +00:00
|
|
|
- deleting media (see [the media section](#media))
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
Any commands with `-list` in them will require a codeblock in the message with
|
|
|
|
each object being newline delimited. An example of doing this is:
|
2024-05-09 01:26:05 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
```` !admin rooms moderation ban-list-of-rooms ``` !roomid1:server.name
|
|
|
|
!roomid2:server.name !roomid3:server.name ``` ````
|
2024-05-09 01:26:05 +00:00
|
|
|
|
|
|
|
## Database
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
If using RocksDB, there's very little you need to do. Compaction is ran
|
|
|
|
automatically based on various defined thresholds tuned for conduwuit to be high
|
|
|
|
performance with the least I/O amplifcation or overhead. Manually running
|
|
|
|
compaction is not recommended, or compaction via a timer. RocksDB is built with
|
|
|
|
io_uring support via liburing for async read I/O.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
Some RocksDB settings can be adjusted such as the compression method chosen. See
|
|
|
|
the RocksDB section in the [example config](configuration/examples.md). btrfs
|
|
|
|
users may benefit from disabling compression on RocksDB if CoW is in use.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
RocksDB troubleshooting can be found [in the RocksDB section of
|
|
|
|
troubleshooting](troubleshooting.md).
|
2024-05-09 01:26:05 +00:00
|
|
|
|
|
|
|
## Backups
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
Currently only RocksDB supports online backups. If you'd like to backup your
|
|
|
|
database online without any downtime, see the `!admin server` command for the
|
|
|
|
backup commands and the `database_backup_path` config options in the example
|
|
|
|
config. Please note that the format of the database backup is not the exact
|
|
|
|
same. This is unfortunately a bad design choice by Facebook as we are using the
|
|
|
|
database backup engine API from RocksDB, however the data is still there and can
|
|
|
|
still be joined together.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
|
|
|
To restore a backup from an online RocksDB backup:
|
2024-07-03 07:49:33 +00:00
|
|
|
|
2024-05-09 01:26:05 +00:00
|
|
|
- shutdown conduwuit
|
|
|
|
- create a new directory for merging together the data
|
2024-08-24 03:13:43 +00:00
|
|
|
- in the online backup created, copy all `.sst` files in
|
|
|
|
`$DATABASE_BACKUP_PATH/shared_checksum` to your new directory
|
|
|
|
- trim all the strings so instead of `######_sxxxxxxxxx.sst`, it reads
|
|
|
|
`######.sst`. A way of doing this with sed and bash is `for file in *.sst; do mv
|
|
|
|
"$file" "$(echo "$file" | sed 's/_s.*/.sst/')"; done`
|
|
|
|
- copy all the files in `$DATABASE_BACKUP_PATH/1` (or the latest backup number
|
|
|
|
if you have multiple) to your new directory
|
|
|
|
- set your `database_path` config option to your new directory, or replace your
|
|
|
|
old one with the new one you crafted
|
2024-05-09 01:26:05 +00:00
|
|
|
- start up conduwuit again and it should open as normal
|
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
If you'd like to do an offline backup, shutdown conduwuit and copy your
|
|
|
|
`database_path` directory elsewhere. This can be restored with no modifications
|
|
|
|
needed.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
Backing up media is also just copying the `media/` directory from your database
|
|
|
|
directory.
|
2024-05-09 01:26:05 +00:00
|
|
|
|
|
|
|
## Media
|
|
|
|
|
|
|
|
Media still needs various work, however conduwuit implements media deletion via:
|
2024-07-03 07:49:33 +00:00
|
|
|
|
2024-08-24 03:13:43 +00:00
|
|
|
- MXC URI or Event ID (unencrypted and attempts to find the MXC URI in the
|
|
|
|
event)
|
2024-05-09 01:26:05 +00:00
|
|
|
- Delete list of MXC URIs
|
2024-08-24 03:13:43 +00:00
|
|
|
- Delete remote media in the past `N` seconds/minutes via filesystem metadata on
|
|
|
|
the file created time (`btime`) or file modified time (`mtime`)
|
|
|
|
|
|
|
|
See the `!admin media` command for further information. All media in conduwuit
|
|
|
|
is stored at `$DATABASE_DIR/media`. This will be configurable soon.
|
|
|
|
|
|
|
|
If you are finding yourself needing extensive granular control over media, we
|
|
|
|
recommend looking into [Matrix Media
|
|
|
|
Repo](https://github.com/t2bot/matrix-media-repo). conduwuit intends to
|
|
|
|
implement various utilities for media, but MMR is dedicated to extensive media
|
|
|
|
management.
|
|
|
|
|
|
|
|
Built-in S3 support is also planned, but for now using a "S3 filesystem" on
|
|
|
|
`media/` works. conduwuit also sends a `Cache-Control` header of 1 year and
|
|
|
|
immutable for all media requests (download and thumbnail) to reduce unnecessary
|
|
|
|
media requests from browsers, reduce bandwidth usage, and reduce load.
|