mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
reject overlapping media and database paths
This commit is contained in:
parent
81a449d1d2
commit
b01b70fc20
20 changed files with 146 additions and 4 deletions
|
|
@ -93,3 +93,21 @@ make_snapshot_test!(
|
|||
"A config with invalid values fails",
|
||||
"invalid-values.toml",
|
||||
);
|
||||
|
||||
make_snapshot_test!(
|
||||
overlapping_paths_equal,
|
||||
"A config with equal paths fails",
|
||||
"equal-paths.toml",
|
||||
);
|
||||
|
||||
make_snapshot_test!(
|
||||
overlapping_paths_media,
|
||||
"A config with the media path inside the database path fails",
|
||||
"media-in-database.toml",
|
||||
);
|
||||
|
||||
make_snapshot_test!(
|
||||
overlapping_paths_database,
|
||||
"A config with the database path inside the media path fails",
|
||||
"database-in-media.toml",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
server_name = "example.com"
|
||||
|
||||
[server_discovery]
|
||||
client.base_url = "https://matrix.example.com"
|
||||
|
||||
[database]
|
||||
backend = "rocksdb"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/c/a"
|
||||
|
||||
[media.backend]
|
||||
type = "filesystem"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/c"
|
||||
2
tests/integrations/fixtures/check_config/dirs/a/.gitignore
vendored
Normal file
2
tests/integrations/fixtures/check_config/dirs/a/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
||||
2
tests/integrations/fixtures/check_config/dirs/b/.gitignore
vendored
Normal file
2
tests/integrations/fixtures/check_config/dirs/b/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
||||
2
tests/integrations/fixtures/check_config/dirs/c/a/.gitignore
vendored
Normal file
2
tests/integrations/fixtures/check_config/dirs/c/a/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
||||
12
tests/integrations/fixtures/check_config/equal-paths.toml
Normal file
12
tests/integrations/fixtures/check_config/equal-paths.toml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
server_name = "example.com"
|
||||
|
||||
[server_discovery]
|
||||
client.base_url = "https://matrix.example.com"
|
||||
|
||||
[database]
|
||||
backend = "rocksdb"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/a"
|
||||
|
||||
[media.backend]
|
||||
type = "filesystem"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/a"
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
server_name = "example.com"
|
||||
|
||||
[server_discovery]
|
||||
client.base_url = "https://matrix.example.com"
|
||||
|
||||
[database]
|
||||
backend = "rocksdb"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/c"
|
||||
|
||||
[media.backend]
|
||||
type = "filesystem"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/c/a"
|
||||
|
|
@ -5,8 +5,8 @@ client.base_url = "https://matrix.example.com"
|
|||
|
||||
[database]
|
||||
backend = "rocksdb"
|
||||
path = "/var/lib/grapevine/database"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/a"
|
||||
|
||||
[media.backend]
|
||||
type = "filesystem"
|
||||
path = "/var/lib/grapevine/media"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/b"
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ client.base_url = "https://matrix.example.com"
|
|||
|
||||
[database]
|
||||
backend = "rocksdb"
|
||||
path = "/var/lib/grapevine/database"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/a"
|
||||
|
||||
[media.backend]
|
||||
type = "filesystem"
|
||||
path = "/var/lib/grapevine/media"
|
||||
path = "tests/integrations/fixtures/check_config/dirs/b"
|
||||
|
||||
[federation]
|
||||
enable = true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with the database path inside the media path fails
|
||||
---
|
||||
Some(
|
||||
1,
|
||||
)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with the database path inside the media path fails
|
||||
---
|
||||
Error: failed to validate configuration
|
||||
Caused by: database and media paths overlap
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with the database path inside the media path fails
|
||||
---
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with equal paths fails
|
||||
---
|
||||
Some(
|
||||
1,
|
||||
)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with equal paths fails
|
||||
---
|
||||
Error: failed to validate configuration
|
||||
Caused by: database and media paths overlap
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with equal paths fails
|
||||
---
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with the media path inside the database path fails
|
||||
---
|
||||
Some(
|
||||
1,
|
||||
)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with the media path inside the database path fails
|
||||
---
|
||||
Error: failed to validate configuration
|
||||
Caused by: database and media paths overlap
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
source: tests/integrations/check_config.rs
|
||||
description: A config with the media path inside the database path fails
|
||||
---
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue