Commit graph

2,801 commits

Author SHA1 Message Date
Alex
bbc1dc3d6f Merge pull request 'TypedTree' (#1456) from krtab/garage:typed_tree into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1456
Reviewed-by: Armael <armael@noreply.localhost>
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-06-30 21:04:06 +00:00
Arthur Carcano
7cdcaa8ebe Panic on (reoccuring) decode error 2026-06-30 21:04:06 +00:00
Arthur Carcano
4133476ec9 Add TODO comment for migration to typedtree 2026-06-30 21:04:06 +00:00
Arthur Carcano
b277d49ad6 Add more type invariants to RcEntry and new RcState 2026-06-30 21:04:06 +00:00
Arthur Carcano
5a4da29f92 Migrate BlockRc and BlockResyncManager to TypedTree 2026-06-30 21:04:06 +00:00
Arthur Carcano
eb91f463f5 Add TypedTree 2026-06-30 21:04:06 +00:00
Alex
22e003f0d0 Merge pull request 'k2v-client: misc fixes' (#1463) from k2v-client-clonable into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1463
2026-06-30 21:02:44 +00:00
Armaël Guéneau
0ebf60f709 k2v-client: re-export crates hyper_rustls and hyper_util 2026-06-30 21:02:44 +00:00
Armaël Guéneau
d588a96125 k2v-client: implement Debug for K2vClient 2026-06-30 21:02:44 +00:00
Armaël Guéneau
e665a3432c k2v-client: derive Clone for the K2vClient type 2026-06-30 21:02:44 +00:00
Armaël Guéneau
5884b4e9c7 k2v-client: repair build; serializers depend on the serde "std" features 2026-06-30 21:02:44 +00:00
Alex
a32621c8fd Merge pull request 'fix(s3): report non-existent keys as deleted in bulk DeleteObjects (fix #1460)' (#1469) from smattymatty/garage:main-v2 into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1469
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-06-17 14:05:14 +00:00
Mathew Storm
8eb7628bf4 test(s3): cover bulk DeleteObjects of a non-existent key 2026-06-17 14:05:14 +00:00
Mathew Storm
cd26594673 fix(s3): treat NoSuchKey as success in bulk DeleteObjects 2026-06-17 14:05:14 +00:00
Alex
1b28094f20 Merge pull request 'K2V: provide monotonic reads by default, with a flag to opt-out' (#1452) from Armael/garage:read_repair into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1452
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-06-17 14:00:13 +00:00
Armaël Guéneau
4f9faeb282 minor fixes 2026-06-17 14:00:13 +00:00
Armaël Guéneau
3c7990027a K2V: update docs to add read monotonicity guarantees & flags 2026-06-17 14:00:13 +00:00
Armaël Guéneau
a159c1c483 add missing repair-on-read for k2v range reads 2026-06-17 14:00:13 +00:00
Armaël Guéneau
555e0826a2 define a separate enum for the monotonic/non-monotonic read flag 2026-06-17 14:00:13 +00:00
Armaël Guéneau
d0f89068c6 repair_on_read: send multiple items to update in a single RPC 2026-06-17 14:00:13 +00:00
Armaël Guéneau
3e25914210 K2V: provide monotonic reads by default, with a flag to opt-out
This performs synchronous repair-on-read for K2V reads:
- uses the new get_*_monotonic operations in the table module
- implements repair-on-read for the K2V-specific poll operations
2026-06-17 14:00:13 +00:00
Armaël Guéneau
5500f1c412 table: disable asynchronous repair-on-read; add get_*_monotonic functions for synchronous repair-on-read 2026-06-17 14:00:13 +00:00
Armaël Guéneau
2d7c0a6087 table: also apply repair-on-read the first time a value is set 2026-06-17 14:00:13 +00:00
Wesley Hershberger
76aae3cb96 Drop parse_duration for fundu-systemd (#1246) (#1468)
`parse_duration` is no longer maintained upstream; `fundu-system` seems like the best option to provide most of the functionality provided by parse_duration and minimize deps.

Fixes #1246

Dep diffstat: +3 -6

## Caveats
- I've done basically no testing of this PR beyond `cargo test`
- See my comment in #1246 for regression risk; this is a breaking change. Is there a document I should update to make note of this? Should I rebase this for `next-v3` instead?
- In theory CVE-2021-29932 is fixed by this PR as `fundu-systemd` doesn't support exponents, but I've done no verification that this is really the case beyond the info in #1246

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1468
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-06-17 13:57:21 +00:00
jo
1d1456f1d6 Add details to read file errors (#1475)
If the files configured in `api_token_file` or `rpc_secret_file` are not found, garage exits with no details (at least not enough) of what went wrong:

    2026-06-14T23:40:34.517429Z  INFO garage::server: Loading configuration from tmp/config1.toml...
    Error: IO error: No such file or directory (os error 2)

This add the kind of file and the file path being read, to the returned error message:

    2026-06-14T23:41:41.136213Z  INFO garage::server: Loading configuration from tmp/config1.toml...
    Error: Failed to read secret file /run/secrets/rpc_secret: No such file or directory (os error 2)

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1475
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-06-17 13:53:43 +00:00
maximilien
a379406522 Merge pull request 'fix reflected xss when returning errors on web endpoint' (#1471) from escape-errors into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1471
2026-06-11 06:50:52 +00:00
trinity-1686a
da568cf56f fix reflected xss when returning errors on web endpoint
Reported by Filippo Decortes from ares-cyber.ai
2026-06-10 19:44:27 +02:00
Dave St.Germain
2bde733e09 fix: enable compilation on OpenBSD by removing keepalive interval (fix #1413) (#1453)
This fixes #1413 by conditionally compiling the section that sets a keepalive interval, which isn't supported on OpenBSD.

Tested on OpenBSD 7.8

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1453
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-14 15:17:20 +00:00
Alex
91573eb028 Merge pull request 'replace Crdt impl on Option by explicit CancelingOption and MergingOption types' (#1451) from option-crdt into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1451
2026-05-13 09:56:29 +00:00
Alex Auvolat
a646180d7e fix fuzz targets 2026-05-13 11:47:57 +02:00
Alex Auvolat
bacc6c98b2 replace expiration field with custom type that merges to min value 2026-05-13 11:20:10 +02:00
Alex Auvolat
bf0a24ea69 replace Option CRDT by explicit CancelingOption and MergingOption types 2026-05-13 11:20:06 +02:00
Arthur Carcano
eb37a3e11a Fuzzing for K2VItem Crdt (#1438)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1438
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-12 14:44:54 +00:00
smattymatty
54c63387cb fix(cors): include Access-Control-Allow-Headers in permissive OPTIONS placeholder (#1450)
The OPTIONS placeholder for buckets without a resolvable global alias returns` Access-Control-Allow-Origin: *` and `Access-Control-Allow-Methods: *` but omits `Access-Control-Allow-Headers`.

Bug verified against Garage v2.2.0 with a local-aliased bucket: OPTIONS placeholder doesn't have `Access-Control-Allow-Headers`, causes the browser to reject signed PUT preflights

The current placeholder fails open for unsigned simple requests but blocks every signed request, undermining the design intent flagged in the FIXME:

```rs
// We take the permissive approach of allowing everything,
// because we don't want to prevent web apps that use
// local bucket names from making API calls.
```

Adds `Access-Control-Allow-Headers: *` so the permissive default is actually permissive for the request shapes that exist in practice.

Refs #258. Does not address the broader FIXME (CORS rule resolution for local-aliased buckets); the placeholder approach is preserved.

All tests are fine locally:

```bash
 ▲ ~/opensource/garage cargo test -p garage_api_common cors::

running 5 tests
test cors::tests::preflight_with_single_allowed_origin_returns_request_origin ... ok
test cors::tests::preflight_with_multiple_allowed_origins_reflects_request_origin ... ok
test cors::tests::preflight_with_wildcard_allowed_origin_returns_wildcard ... ok
test xml::cors::tests::test_deserialize_norules ... ok
test xml::cors::tests::test_deserialize ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 16 filtered out; finished in 0.00s
```

Co-authored-by: smattymatty <smattymatt@gmail.com>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1450
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-12 08:17:48 +00:00
Alex Auvolat
84bdc9f50f Update Redoc to latest version (#1448)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1448
2026-05-12 08:05:18 +00:00
Arthur Carcano
3a5f060693 Add bucket_alias CRDT fuzz target (#1439)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1439
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-07 14:02:26 +00:00
Arthur Carcano
21d29a4cf6 Add fuzing for Key CRDT (#1444)
This has duplicated changes with #1442 that will likely conflict and need rebase.

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1444
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-07 13:42:35 +00:00
Arthur Carcano
a0887afc4f Add fuzing for AdminApiToken CRDT (#1443)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1443
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-07 11:43:25 +00:00
Arthur Carcano
f757991635 Add block_ref CRDT fuzz target (#1440)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1440
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-07 11:27:14 +00:00
Arthur Carcano
0da317e3d5 Fuzz Bucket CRDT (#1442)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1442
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-06 18:55:47 +00:00
Alex
57ceed38f3 Merge pull request 'Improvements to the fuzzing code' (#1437) from krtab/garage:fuzz_crdts into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1437
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-05-05 10:03:36 +00:00
Arthur Carcano
0eb7d61829 cargo fmt 2026-05-05 10:41:21 +02:00
Arthur Carcano
382981642d Remove uneeded clones 2026-05-04 17:26:13 +02:00
Arthur Carcano
28a75d7234 Add LXs corrolary 2026-05-04 17:23:59 +02:00
Arthur Carcano
e996f34887 Factor the crdt test code 2026-05-04 17:23:31 +02:00
Arthur Carcano
defaac1b4f Use PartialEq instead of crdt_state 2026-05-04 17:07:35 +02:00
Alex
9f157677c2 Merge pull request 'First CRDT fuzz: MPU and version tables' (#1411) from krtab/garage:fuzz_crdts into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1411
2026-05-01 21:36:17 +00:00
Alex Auvolat
ddc42c89fb add #fuzz devshell and make fuzzing work on nixos 2026-05-01 21:36:17 +00:00
Arthur Carcano
a25ad494cc Add fuzzing README 2026-05-01 21:36:17 +00:00
Arthur Carcano
7d97b2b96e Ignore flaky test_items_and_indices 2026-05-01 21:36:17 +00:00