Commit Graph

2679 Commits

Author SHA1 Message Date
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
maximilien
7f61bbbebb Merge pull request 'helm: add priorityClassName support' (#1357) from blue.lion4023/garage:helm-add-priority-class-name into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1357
Reviewed-by: maximilien <git@mricher.fr>
2026-02-21 08:23:14 +00:00
blue.lion4023
8105ca888d helm: add priorityClassName support to pod spec 2026-02-20 21:36:08 +00:00
Alex
d0166fe938 Merge pull request 'Upgrade quick-xml crate to 0.39' (#1319) from gwenlg/garage:quick_xml_upgrade into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1319
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-02-20 21:29:26 +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
Alex
2803c73045 Merge pull request 'code maintenance with help clippy' (#1314) from gwenlg/garage:code_maintenance_part2 into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1314
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-02-17 18:38:44 +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
Gwen Lg
0043ad08fa docs: remove obsolete mention of cargo2nix tool (#1350)
fix issue #1333

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1350
Co-authored-by: Gwen Lg <me@gwenlg.fr>
Co-committed-by: Gwen Lg <me@gwenlg.fr>
2026-02-17 18:16:04 +00:00
Maximilien Richer
0c70c87391 Add FOSDEM 2026 talk (#1344)
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1344
Co-authored-by: Maximilien Richer <me@mricher.fr>
Co-committed-by: Maximilien Richer <me@mricher.fr>
2026-02-15 15:17:27 +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
Alex Auvolat
7ad0f96222 release builds: set lto="thin" and strip="debuginfo" (#1342)
- thin LTO is much much faster to compile, this will help when making
  release builds
- strip="debuginfo" allows to still have symbols when unwinding stack
  traces, which are usefull to have in user's bug reports. Binary size
  is increased from 23M to 27M, so a reasonable increase

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1342
Co-authored-by: Alex Auvolat <lx@deuxfleurs.fr>
Co-committed-by: Alex Auvolat <lx@deuxfleurs.fr>
2026-02-15 08:58:57 +00:00
trinity-1686a
c373222e3a run push CI only on main branch (#1343)
currently, ci runs twice for people pushing directly to this repository (e.g. https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1340, you can see both woodpecker/{pr,pull}/debug)
that's a waste of resources, we'll do twice exactly the same thing.
i propose we only run push ci on `main-*` branches, so that creating a PR doesn't create two jobs

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1343
Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr>
Co-committed-by: trinity-1686a <trinity@deuxfleurs.fr>
2026-02-15 08:57:52 +00:00
Alex
c73268fd77 Merge pull request 'chore: update nom dependency to 0.8' (#1341) from gwenlg/garage:nom_upgrade into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1341
Reviewed-by: Alex <lx@deuxfleurs.fr>
2026-02-14 19:25:49 +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
3af9e8d3d2 Merge pull request 'Make initial setup easier' (#1329) from easy-bootstrap into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1329
2026-02-14 18:26:43 +00:00
Alex Auvolat
1d588282bf print path to configuration file in startup logs 2026-02-14 19:25:47 +01:00
Alex Auvolat
f7ec4b1338 update quick start guide 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
Alex
c22c4ff2e5 Merge pull request 'style: replace wildcard import of garage model in website' (#1334) from gwenlg/garage:avoid_import_conflict into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1334
2026-02-14 18:21:31 +00: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
Alex
70b8ebc8b6 Merge pull request 'Document how to use Apache as a reverse proxy' (#1331) from jasonaowen/garage:cookbook-reverse-proxy-apache into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1331
2026-02-14 18:08:08 +00:00
Alex
02db2d5f9d Merge pull request 'fix path missmatch between config and docker in quickstart doc' (#1339) from 1686a/doc-incoherent-path into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1339
Reviewed-by: maximilien <git@mricher.fr>
2026-02-14 17:53:36 +00:00
trinity-1686a
cc749a6290 fix path missmatch between config and docker in quickstart doc 2026-02-14 11:19:28 +01:00
Jason Owen
9f969ef43e Document how to use Apache as a reverse proxy
Replace the TODO in the reverse proxy cookbook entry with instructions
on how to configure Apache httpd as a reverse proxy for Garage.
2026-02-12 00:21:40 -08:00
Alex
4989be7853 Merge pull request 'update almost all dependencies to the last version' (#1316) from gwenlg/garage:maintenance_deps into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1316
2026-02-10 19:16:49 +00:00
Gwen Lg
8ce4415edb chore: update k8s related dependencies
- k8s-openapi, kube and schemars
2026-02-10 19:16:49 +00:00
Gwen Lg
75c28faa5b chore: update tokio and hyper-rustls dependencies 2026-02-10 19:16:49 +00:00
Gwen Lg
8644511ebc chore: update aws dependencies
aws-sigv4, aws-smithy-runtime, aws-sdk-config, aws-sdk-s3
2026-02-10 19:16:49 +00:00
Gwen Lg
e5627bbd6b chore: update reqwest dependency to 0.13 2026-02-10 19:16:49 +00:00