trinity-1686a
668dfea4e2
fix silent write errors ( #1360 )
...
same as #1358 for garage-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1360
Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr >
Co-committed-by: trinity-1686a <trinity@deuxfleurs.fr >
2026-02-24 14:40:11 +00:00
Gwen Lg
290a7f5ab6
fix: VersioningConfiguration xml reference
...
empty element handling is set as expanded and be consistant.
2026-02-20 21:29:26 +00:00
Gwen Lg
2576626240
fix: configure xmk serializer to expand empty elements
2026-02-20 21:29:26 +00:00
Gwen Lg
6591044c2e
fix: set quote level to full for xml serialization
...
also remove use of intermediate String
2026-02-20 21:29:26 +00:00
Gwen Lg
1ae4e5d438
fix: mark to skip serialization of Option when None
...
mark with `skip_serializing_if = "Option::is_none"`
2026-02-20 21:29:26 +00:00
Gwen Lg
d80096de92
fixup: fix xml attibute xmlns serialization
...
rename var with "@xmlns"
2026-02-20 21:29:26 +00:00
Gwen Lg
674c2c1cb1
chore: update quick-xml dep
...
rework associated error, and fixup error for XML serialization.
Should be InternalError/INTERNAL_SERVER_ERROR not MalformedXML/BAD_REQUEST
2026-02-20 21:29:26 +00:00
Gwen Lg
3c5018bd6b
refactor: use str trim result to parse xml
...
- use `trim` method of `str` instead of manual implementation with `trim_matches(char::is_whitespace)`
- use result of `trim` for xml parsing instead of use the `str` before trim.
2026-02-20 21:29:26 +00:00
Gwen Lg
93cd71eb72
test: add unprettify_xml helper and use it
...
this replace previous cleanup which remove space between `element` and `attribute` name in xml
2026-02-20 21:29:26 +00:00
Gwen Lg
507be60890
test: use assert_eq instead of assert to improve failed output
2026-02-20 21:29:26 +00:00
Gwen Lg
780f389973
test: replace some unwrap with expect in tests
...
this add more information in case of failure
2026-02-20 21:29:26 +00:00
rajsinghtech
69cd230568
fix: enable TCP keepalive on RPC connections ( #1348 )
...
Garage RPC connections have no TCP keepalive enabled. When a connection dies silently (proxy pod restart, NAT timeout, network partition), it's only detected by application-level pings after ~60s (4 failed pings x 15s interval). During this window, the node appears connected but all RPC calls to it fail.
Enable TCP keepalive on both outgoing and incoming RPC connections via socket2:
- Idle time before first probe: 30s (TCP_KEEPALIVE_TIME)
- Probe interval after first: 10s (TCP_KEEPALIVE_INTERVAL)
A helper set_keepalive() function avoids duplicating the socket2 setup. Incoming connection keepalive failures are logged as warnings but don't reject the connection.
Companion to #1345 (stale address pruning + connect timeout). Together they address both halves of the reconnection problem: faster detection (this PR) and faster recovery.
Co-authored-by: Raj Singh <raj@tailscale.com >
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1348
Reviewed-by: maximilien <git@mricher.fr >
Co-authored-by: rajsinghtech <rajsinghtech@noreply.localhost >
Co-committed-by: rajsinghtech <rajsinghtech@noreply.localhost >
2026-02-20 21:28:29 +00:00
Malte Swart
55370d9b4d
consul: support token auth for catalog api requests, too ( #1353 )
...
Even when using the catalog an dedicated token for authentication
might be needed.
**Approach**: Support the token header even with client certs was the simplist approach and somebody might need/want to use it.
**Background**: I want to run garage via Nomad but within containers (with host volumes). Nomad generates consul tokens (but at least not at the moment client certs). I need to use the catalog as with the services API garage tries to use the host/node IPs (instead of the actual service IPs).
**Tests**: I deployed this version and it works well.
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1353
Reviewed-by: Alex <lx@deuxfleurs.fr >
Co-authored-by: Malte Swart <mswart@devtation.de >
Co-committed-by: Malte Swart <mswart@devtation.de >
2026-02-20 21:27:59 +00:00
Roman Ivanov
ce1ea79bf1
Implement error 409 BucketAlreadyOwnedByYou ( #1352 )
...
Fix for Deuxfleurs/garage#1322
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1352
Co-authored-by: Roman Ivanov <xatikopro@gmail.com >
Co-committed-by: Roman Ivanov <xatikopro@gmail.com >
2026-02-18 11:20:24 +00:00
Gwen Lg
9b3e4716bf
refactor: rework uri_encode to limit allocation
...
add add some related tests.
catched from clippy lint `format_collect`
message: use of `format!` to build up a string from an iterator
--> src/api/common/encoding.rs:12:17
|
12 | let value = format!("{}", c)
| _____________________________^
13 | | .bytes()
14 | | .map(|b| format!("%{:02X}", b))
15 | | .collect::<String>();
| |________________________________________^
|
help: call `fold` instead
--> src/api/common/encoding.rs:14:7
|
14 | .map(|b| format!("%{:02X}", b))
| ^^^
help: ... and use the `write!` macro here
--> src/api/common/encoding.rs:14:15
|
14 | .map(|b| format!("%{:02X}", b))
| ^^^^^^^^^^^^^^^^^^^^^
= note: this can be written more efficiently by appending to a `String` directly
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#format_collect
2026-02-17 18:38:44 +00:00
Gwen Lg
83f8bdbacd
refactor: remove unnecessarily wrap value into a Result
...
this simplify code and remove some unwrap.
warning: this function's return value is unnecessarily wrapped by `Result`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_wraps
2026-02-17 18:38:44 +00:00
Gwen Lg
b060a7e0f1
fix: remove func call from alternative value.
...
this avoid useless allocation or non-trivial work, if the default value
is not needed/used.
add a line in Cargo.toml to easly enable or_fun_call lint
help: https://rust-lang.github.io/rust-clippy/master/index.html?search=or_fun_call
2026-02-17 18:38:44 +00:00
Gwen Lg
f6414210fa
refactor: rework bucket value get, relateted to or_func_call
...
this avoid bucket_website_config value compute if not needed
2026-02-17 18:38:44 +00:00
Gwen Lg
bbb62dfa85
refactor: use u64::midpoint instead of manual implementation
...
warning: manual implementation of `midpoint` which can overflow
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#manual_midpoint
2026-02-17 18:38:44 +00:00
Gwen Lg
f59a8b7f62
style: corrects the use of ';' to improve readability
...
- remove unnecessary semicolon
and enable lint warning: unnecessary semicolon
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_semicolon
- add `;` to the last statement for consitent formatting
and enable lint `clippy::semicolon_if_nothing_returned`
warning: consider adding a `;` to the last statement for consistent formatting
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#semicolon_if_nothing_returned
2026-02-17 18:38:44 +00:00
Gwen Lg
08fd6e659f
docs: add missing backticks in documentation
...
this improve readability of documentation.
enable associated clippy lint `doc_markdown`
2026-02-17 18:38:44 +00:00
Gwen Lg
6cde00073f
chore: enable workspace configuration of lints in Cargo.toml
...
and use workspace configuration in each package.
This allow to customize clippy and rust lint configuration for project.
No particular configuration in this commit.
2026-02-17 18:38:44 +00:00
trinity-1686a
b0840ab256
emit headers on Not Modified per RFC-9110, fix #1330 ( #1340 )
...
also fix a small information disclosure where a client with valid token, but no encryption keys, can use Not Modified has an oracle to know if etag matches or not
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1340
Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr >
Co-committed-by: trinity-1686a <trinity@deuxfleurs.fr >
2026-02-15 11:00:31 +00:00
Gwen Lg
c82015f6cf
chore: update nom dependency to 0.8
...
update syntax with :
- add explicit call of `parse` method
- add ref slice management for `tag` fn
2026-02-14 19:25:49 +00:00
Alex Auvolat
1d588282bf
print path to configuration file in startup logs
2026-02-14 19:25:47 +01:00
Alex Auvolat
00cbc5c31d
relax requirements on imported access keys to allow easier transition from other S3 storage providers ( fix #1262 )
2026-02-14 19:23:44 +01:00
Alex Auvolat
95aa3bc795
bootstrap: add --default-access-key and --default-bucket flags
2026-02-14 19:23:44 +01:00
Alex Auvolat
53ace58e44
bootstrap: add --single-node flag that creates a single-node layout
2026-02-14 19:23:44 +01:00
Gwen Lg
6f511fc149
style: replace wildcard import of garage model in website
...
this avoid rust-analyzer indicate invalid field error on `Redirect` for
`replace_prefix` and `replace_full` because of a conflict between struct :
`api::s3::website::Redirect` and `model::bucket_table::Redirect`
2026-02-14 18:21:31 +00:00
Gwen Lg
566a0b44c0
chore: update bytesize dependency to 2.3
...
include code update to follow display management change.
2026-02-10 19:16:49 +00:00
Gwen Lg
934c4c31f1
chore: update dependency rand to 0.9
2026-02-10 19:16:49 +00:00
Gwen Lg
473b66ca5b
fix: mark unsafety of std::env::set_var
...
and document the function.
2026-02-10 18:46:55 +01:00
Gwen Lg
5c8a31708e
refactor: manualy build tokio runtime for k2v-cli
2026-02-10 18:46:55 +01:00
Gwen Lg
ca1211d927
refactor: manualy build tokio runtime for garage
...
to allow do some initialization before
2026-02-10 18:46:55 +01:00
bytechunk
b012431df0
S3 api DeleteObject fix invalid XML ( #1324 )
...
linked to #1323
Do only check element nodes when validating XML content (skip text
nodes).
If text nodes are skipped then the validation fails when providing
formatted XML content as body of the request.
Co-authored-by: frederic vroman <fred@lesmouths.net >
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1324
Co-authored-by: bytechunk <bytechunk.a52b055@track-it.pw >
Co-committed-by: bytechunk <bytechunk.a52b055@track-it.pw >
2026-02-09 13:05:58 +00:00
Gwen Lg
6e98f5e74e
upgrade heed to version 0.22 ( #1318 )
...
- migration from `ByteSlice` to `Bytes` heed type.
- not sure about the impact of only one `read_txn` for the entire function `list_trees`, whereas before `open_database` call uses their own access controller.
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1318
Co-authored-by: Gwen Lg <me@gwenlg.fr >
Co-committed-by: Gwen Lg <me@gwenlg.fr >
2026-02-07 13:22:46 +00:00
Gwen Lg
5eb381a22a
refactor: use OnceLock for Instance in test
...
... instead of unsafe `static mut` as it's not safe.
Change terminate to apply on `&self` and use a Mutex for Instance interior mutability.
2026-01-29 20:50:05 +01:00
Gwen Lg
3b6daa7d0f
refactor: rework init_tracing to avoid unused variable
...
... when feature `telemetry-otlp` is not enabled
move feature management into tracing_setup module to make the server code cleaner.
2026-01-29 20:50:05 +01:00
Gwen Lg
7d05d9d520
chore: set aws_s3 BehaviorVersion to latest in tests common client
...
ok because this code shouldn't be reliant on extremely specific behavior characteristics.
And this avoid use of deprecated version.
2026-01-29 20:50:05 +01:00
Gwen Lg
cd5cd37ecc
style: improve lisibility of db_path code
...
split suffix get from match self and path construction
2026-01-29 20:49:28 +01:00
Gwen Lg
e5f87fb51e
refactor: use let Some instead of is_some + unwrap
...
lint message: called `unwrap` on `config.k2v_api` after checking its variant with `is_some`
lint message: called `unwrap` on `config.admin.trace_sink` after checking its variant with `is_some`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_unwrap
2026-01-29 20:49:28 +01:00
Gwen Lg
b0ee7dd3c9
chore: localy disable some lints
...
- clippy::nonminimal_bool disabled for check_size_filter function
clippy message: this boolean expression can be simplified
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#nonminimal_bool
- clippy::large_enum_variant for `DecryptStreamState` and `State`
- clippy::too_many_arguments for `put_block_and_meta` and
`test_read_encrypted`
- clippy::deref_addrof for specific unsafe code
- clippy::doc_overindented_list_items and clippy::doc_lazy_continuation
2026-01-29 20:49:28 +01:00
Gwen Lg
4a0be692b3
docs: various fixes in Rust code documentation
...
- add backticks on struct doc comments
lint message: unclosed HTML tag `M`
- add a blanck line for proper doc formating
lint message: doc list item without indentation
help: if this is supposed to be its own paragraph, add a blank line
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#doc_lazy_continuation
- fix hyperlink in doc + one url invalid
lint message: this URL is not a hyperlink
note: bare URLs are not automatically turned into clickable links
- ajust space in doc
lint message: doc list item overindented
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#doc_overindented_list_items
2026-01-29 20:49:28 +01:00
Gwen Lg
a5d047b5ae
style: use if else instead of then_some + unwrap_or
...
create dedicated fn for `deleted` printing to improve lisibility an
deduplicate code.
clippy message: this method chain can be written more clearly with `if .. else ..`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#obfuscated_if_else
2026-01-29 20:49:28 +01:00
Gwen Lg
24e11e99ee
style: some small fixes
...
- remove invalid struct pattern
lint message: struct pattern is not needed for a unit variant
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#unneeded_struct_pattern
- remove call to default() on unit struct
lint message: use of `default` to create a unit struct
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#default_constructed_unit_structs
- replace if/else by direct affectation
lint message: this if-then-else expression assigns a bool literal
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#needless_bool_assign
- replace assert_eq on unit by `unwrap` + let typed binding
2026-01-29 20:49:28 +01:00
Gwen Lg
bddd23136b
refactor: reduce number of arguments by use struct
...
- create and use HandleInfo and DestInfo to reduce number of arguments
lint message: warning: this function has too many arguments (9/7)
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#too_many_arguments
2026-01-29 20:49:28 +01:00
Gwen Lg
a426b00e87
style: collapse nested if block
...
lint message: this `if` statement can be collapsed
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#collapsible_if
2026-01-29 20:49:28 +01:00
Gwen Lg
8772db8228
refactor: rename method to avoid confusion
...
- rename SqliteDb::new to `_::open` as it's not return Self
lint message: methods called `new` usually return `Self`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#new_ret_no_self
- rename method `add` to `add_calgorithm`
The semantics of this has nothing to do with an `add` operation in the sense of the `Add` trait.
And method `add` can be confused for the standard trait method std::ops::Add::add
lint https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#should_implement_trait
2026-01-29 20:49:28 +01:00
Gwen Lg
5307b3f762
chore: remove unnecessary cast usize
...
lint message: casting to the same type is unnecessary (`u64` -> `u64`)
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#unnecessary_cast
+ disable `clippy::unnecessary_cast` for update_disk_usage
where the size of the input values depends on the platform
2026-01-29 20:49:28 +01:00
Gwen Lg
6dbcdcd784
style: improve use of std api
...
- replace get(0) by first()
lint message: accessing first element with `objs.get(0)`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#get_first
- use io::Error::other method available since Rust 1.87
lint message: this can be `std::io::Error::other(_)`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#io_other_error
- implement From<_> instead of Into<_>
lint message: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#from_over_into
- use next_back instead of rev + next
lint message: manual backwards iteration
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#manual_next_back
- use saturating_sub instead of manual implement it
lint message: manual arithmetic check found
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#implicit_saturating_sub
- add Default implementation for Checksummer
use derived Default ans use it in new, as new set all value to None
lint message: you should consider adding a `Default` implementation for `Checksummer`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#new_without_default
- use `any` instead of `find` + `is_some`
lint message: called `is_some()` after searching an `Iterator` with `find`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#search_is_some
- replace `and_then` + `Some(_)` with `map`
lint message: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#bind_instead_of_map
- replace `skip_while` + `next` with `find`
lint message: called `skip_while(<p>).next()` on an `Iterator`
help: this is more succinctly expressed by calling `.find(!<p>)` instead
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#skip_while_next
- use `matches!` instead of manual implementation
lint message: match expression looks like `matches!` macro
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#match_like_matches_macro
- use `keys` and `values methods insteads of iterating and ignoring either the keys or values.
help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#iter_kv_map
2026-01-29 20:49:28 +01:00