Commit Graph

2813 Commits

Author SHA1 Message Date
Alex Auvolat be17e25bee CLI: garage json-api: allow payload to be omitted more often 2026-07-25 15:24:31 +02:00
Alex Auvolat 8d85301808 Admin API: add parameters details, offset and limit to ListKeys and ListBuckets 2026-07-25 15:12:37 +02:00
Alex b8e844612d Merge pull request 'Admin API: correctly return aliased buckets for keys even if they have no permissions' (#1498) from fix-aliases-no-perms into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1498
2026-07-25 12:38:23 +00:00
Alex Auvolat aa4e4656b1 GetKeyInfo: properly list locally-aliased buckets even if they have no permissions 2026-07-25 14:24:58 +02:00
Alex Auvolat 5549077d6f GetBucketInfo: properly return keys that have local aliases even if they have no permissions 2026-07-25 14:24:49 +02:00
smattymatty 663fc5ae48 fix(s3): allow UTF-8 in PostObject form field values (fix #1489) (#1492)
PostObject (presigned POST) returns `400 InvalidHeaderValue` when the upload involves a non-ASCII filename. The same key uploads fine vie PUT, as the issue #1489 noted.

The problem was that `handle_post_object` stores the form field values in an `http::HeaderMap`. values go in through `HeaderValue::from_str` but are read back with the strict `HeaderValue::to_str()` (ASCII-only) which fails on any UTF-8 value.

This is the same problem fixed in eab2b81b for `x-amz-meta-*` headers, and the fix is the same:
`std::str::from_utf8(value.as_bytes())` instead of `to_str()`. The `key` field in `post_object.rs` and the standard headers (`content-disposition` etc.) in `extract_metadata_headers`.

Added integration tests for PostObject (there were none): UTF-8 key, `${filename}` substitution, and UTF-8 `Content-Disposition` metadata. The substitution test passes even without the fix, proving that the filename path was never broken, only the form-params round-trip.

Co-authored-by: Mathew Storm <mathew@stormdevelopments.ca>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1492
Reviewed-by: trinity-1686a <trinity-1686a@noreply.localhost>
2026-07-20 18:12:39 +00:00
Agathe Porte 0f89923d2d doc: websites: explain global aliases required (#1494)
Add a note explaining that a globally aliased bucket is
required for successfully exposing it as a website.

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1494
2026-07-20 18:11:15 +00:00
Antonin Delpeuch a1f9c52563 docs: add GOVERNANCE.md (#1493)
Documenting the structure of a team can be helpful to integrate newcomers, avoid some conflicts and to accompany the evolution of that structure as a FOSS project grows.

This is an attempt to do that for garage, after discussions with multiple maintainers. The aim of this text is to document the status quo, offering a start for further incremental updates.
I propose to put it as `GOVERNANCE.md` file because this naming has emerged as a sort of standard in FOSS projects.

I would be happy to help facilitate such updates if there is interest (while being aware that project members have other things on their plates and that governance work can be taxing).

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1493
2026-07-20 18:10:30 +00:00
Agathe Porte ceade99cd7 doc: fix dead link to WinSCP wiki page (#1495)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1495
2026-07-20 18:08:59 +00:00
Agathe Porte d1333c1729 doc: multi-hdd: refer to rebalance op (#1491)
The rebalance op links to the multi-hdd page, but the multi-hdd page
does not refer to the rebalance op description and only states that an
operator can launch a repair procedure without stating which procedure.

Add a link to the rebalance repair procedure in the multi-hdd page to
make it easier to find what procedure to run for rebalance.

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1491
2026-07-14 21:12:45 +00:00
Andreas Schneider 7e246b20e9 fix: avoid rewriting peer list file when unchanged (#1488)
save_peer_list() ran unconditionally every 60s from the discovery
loop, writing the same data to disk even when the peer set hadn't
changed. Compare the newly encoded peer list against the bytes
already on disk and skip the write when they match.

Fixes #1457

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1488
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-07-14 10:54:33 +00:00
deanqx 936e53fe2f docs: update old "key new" to new "key create" command (#1487)
Fix invalid references to the `garage key new` commands. Mainly on documentation side except one script: `script/dev-bucket.sh`.

This is my first pull request ever. I'm open for feedback, let me know if I should change anything about this PR.

Co-authored-by: deanqx <110404616+deanqx@users.noreply.github.com>
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1487
2026-07-07 10:34:42 +00:00
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