mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
separate media and database paths
The primary motivation for this change is to support databases that don't take a path, e.g. out of process databases. This configuration structure leaves the door open for other media storage mechanisms in the future, such as S3. It's also structured to avoid `#[serde(flatten)]` so that we can use `#[serde(deny_unknown_fields)]`.
This commit is contained in:
parent
ae920fdbe8
commit
5a5608e088
6 changed files with 82 additions and 8 deletions
|
|
@ -146,6 +146,9 @@ This will be the first release of Grapevine since it was forked from Conduit
|
|||
the server is now behind the `serve` command, so `grapevine --config ...`
|
||||
becomes `grapevine serve --config ...`.
|
||||
([!108](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/108))
|
||||
13. **BREAKING:** The path to media files is now specified separately from the
|
||||
database path.
|
||||
([!40](https://gitlab.computer.surgery/matrix/grapevine/-/merge_requests/140))
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,54 @@ automatically migrating existing configs to the new schema.
|
|||
[room]: https://matrix.to/#/#grapevine:computer.surgery
|
||||
[config-migration-issue]: https://gitlab.computer.surgery/matrix/grapevine/-/issues/38
|
||||
|
||||
## Filesystem
|
||||
|
||||
Grapevine requires database data and media data to live in **separate**,
|
||||
**non-nested** directories, which are configurable. Here is a typical example,
|
||||
starting with the filesystem structure:
|
||||
|
||||
```text
|
||||
/var/lib/grapevine
|
||||
+ database/
|
||||
| + database-file-1
|
||||
| + ...
|
||||
| + database-file-n
|
||||
+ media/
|
||||
+ media-file-1
|
||||
+ ...
|
||||
+ media-file-n
|
||||
```
|
||||
|
||||
And here is the matching configuration:
|
||||
|
||||
```toml
|
||||
[database]
|
||||
path = "/var/lib/grapevine/database"
|
||||
|
||||
[media.backend]
|
||||
type = "filesystem"
|
||||
path = "/var/lib/grapevine/media"
|
||||
```
|
||||
|
||||
On the other hand, Conduit's filesystem layout looks like this:
|
||||
|
||||
```text
|
||||
/var/lib/conduit
|
||||
+ media/
|
||||
| + media-file-1
|
||||
| + ...
|
||||
| + media-file-n
|
||||
+ database-file-1
|
||||
+ ...
|
||||
+ database-file-n
|
||||
```
|
||||
|
||||
Which **nests** the media directory inside the database directory. Grapevine
|
||||
will reject this layout, so the filesystem layout must be changed before
|
||||
starting Grapevine. It is important to migrate the filesystem layout before
|
||||
starting Grapevine, because otherwise it will create a fresh database instead of
|
||||
using the existing one.
|
||||
|
||||
## Database
|
||||
|
||||
Grapevine is currently compatible with the Conduit 0.7.0 database format. It is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue