Compare commits

...

1310 Commits
v0.4.0 ... main

Author SHA1 Message Date
Alex ecf641d88c Merge pull request 'Fix unbounded buffering when one node has slower network' (#792) from fix-buffering into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #792
2024-03-28 12:40:27 +00:00
Alex 75cd14926d Merge pull request 'CI: properly cleanup between garage integration tests' (#793) from fix-ci into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #793
2024-03-28 12:37:18 +00:00
Alex e1dc84e123
[fix-ci] CI: properly cleanup between garage integration tests
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-28 13:08:42 +01:00
Alex 85f580cbde
[fix-buffering] change request sending strategy and fix priorities
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
remove LAS, priorize new requests but otherwise just do standard queuing
2024-03-27 16:22:40 +01:00
Alex 0d3e285d13
[fix-buffering] implement `block_ram_buffer_max` to avoid excessive RAM usage 2024-03-27 16:22:40 +01:00
Alex 95eb8808e8 Merge pull request 'Disable more K2V tests' (#791) from disable-k2v-test into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline failed Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #791
2024-03-26 15:33:46 +00:00
Alex e0a4fc097a
[disable-k2v-test] remove obsolete k2v test script
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-26 16:24:44 +01:00
Alex 73551e9a2d
[disable-k2v-test] disable the other k2v poll test 2024-03-26 16:24:26 +01:00
Alex 80f81fa6f3 Merge pull request '[disable-k2v-test] disable tests::k2v::test_poll_item as it is not 100% reliable' (#789) from disable-k2v-test into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #789
2024-03-26 14:57:46 +00:00
Alex f267609343
[disable-k2v-test] disable tests::k2v::test_poll_item as it is not 100% reliable
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-26 15:39:17 +01:00
Alex e835196940 Merge pull request 'Add marker files in data directories (fix #601)' (#785) from check-data-dir into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #785
2024-03-20 16:53:47 +00:00
Alex ba33bb31f1
[check-data-dir] add marker files in data directories (fix #601)
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-20 15:20:25 +01:00
Alex 30abf7e086 Merge pull request 'Add support to logging to syslog (based on patch by @jirutka)' (#784) from syslog into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #784
2024-03-20 13:54:18 +00:00
Alex 84018be862
[syslog] warning when syslog support is not enabled
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-20 14:39:04 +01:00
Alex 091e693670
[syslog] document environment variables 2024-03-20 14:39:04 +01:00
Alex fe8a7819fa
[syslog] Add support to logging to syslog
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
Original patch by Jakub Jirutka for Alpine Linux port.
2024-03-20 14:22:18 +01:00
Alex 26310f3242 Merge pull request 'CLI: allow manipulating buckets by prefixes of their full IDs' (#783) from bucket-id-prefix into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline failed Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #783
2024-03-19 16:17:16 +00:00
Alex 783b586de9
[bucket-id-prefix] CLI: allow manipulating buckets by prefixes of their full IDs
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-19 16:57:51 +01:00
Alex 693b89b94b Merge pull request 'Update WinSCP link in documentation' (#781) from stefano/garage:main into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #781
2024-03-19 09:34:16 +00:00
stefano cf344d73d5 Update WinSCP link in documentation
ci/woodpecker/pr/debug Pipeline was successful Details
Update link to new wiki location. See Deuxfleurs/garage#780
2024-03-19 09:21:50 +00:00
Alex 1a0bffae34 Merge pull request 'Use connection pooling in sqlite backend' (#779) from sqlite-r2d2 into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #779
2024-03-18 19:02:36 +00:00
Alex b55f52a9b7
[sqlite-r2d2] run integration test with all db engines
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-18 18:31:35 +01:00
Alex e8f9718ccd
[sqlite-r2d2] implement connection pooling in sqlite backend 2024-03-18 18:05:25 +01:00
Alex fd2e19bf1b Merge pull request 'metadata db snapshotting' (#775) from db-snapshot into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #775
2024-03-15 13:17:53 +00:00
Alex 8cf3d24875
[db-snapshot] documentation for metadata db snapshots
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-15 13:51:31 +01:00
Alex a68c37555d
[db-snapshot] add garage meta snapshot cli operation 2024-03-15 13:51:31 +01:00
Alex 1e42808a59
[db-snapshot] implement meta_auto_snapshot_interval 2024-03-15 13:51:31 +01:00
Alex 8dff278b72
[db-snapshot] Implement db snapshotting logic in garage_db 2024-03-15 10:57:22 +01:00
Alex a80ce6ab5a Merge pull request '`disable_scrub` configuration option' (#774) from disable-scrub into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #774
2024-03-15 09:22:33 +00:00
Alex 990205dc3b
[disable-scrub] document `disable_scrub` config option
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-14 17:01:16 +01:00
Alex 7c86ff6c37
[disable-scrub] implement a `disable_scrub` configuration option 2024-03-14 17:01:16 +01:00
Alex 62b01d8705 Merge pull request 'Doc: be slightly more critical of LMDB' (#773) from doc-updates into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #773
2024-03-14 15:43:30 +00:00
Alex 422d45b659
[doc-updates] from source: fix default feature list
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-14 16:35:15 +01:00
Alex a7dddebedd
[doc-updates] doc: be slightly more critical of LMDB
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-14 16:31:22 +01:00
Alex 238545e564 Merge pull request 'Refactoring of db engines' (#765) from factor-db-open into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #765
2024-03-08 12:56:40 +00:00
Alex ec34728b27
[factor-db-open] Combine logic for opening db engines
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-03-08 12:58:17 +01:00
Alex afee8c2207 Merge pull request 'allow utf-8 in headers + add test for object metadata' (#763) from unicode-headers into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #763
2024-03-07 12:54:07 +00:00
Alex eab2b81be2
[unicode-headers] allow utf-8 in headers + add test for object metadata
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-07 13:42:01 +01:00
Alex 3168bb34a0 Merge pull request 'add request context helper' (#751) from yuka/garage:req-ctx into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #751
2024-03-04 14:51:05 +00:00
Alex 512933a036 Merge pull request 'Garage v0.9.3' (#757) from rel-0.9.3 into main
Reviewed-on: #757
2024-03-04 13:26:47 +00:00
Alex 8670140358
[rel-0.9.3] Bump version to 0.9.3
ci/woodpecker/push/debug Pipeline was successful Details
2024-03-04 14:00:55 +01:00
Alex 5bb69a1257 Merge pull request 'Add API test + fix presigned requests' (#756) from test-presigned into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #756
2024-03-04 12:56:02 +00:00
Alex c8e416aaa5
[test-presigned] Use a HeaderMap type for QueryMap
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-04 13:33:14 +01:00
Yureka fb55682c66 add request context helper
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-04 13:26:39 +01:00
asonix c94bf45cba
Store original-cased query keys alongside query values 2024-03-04 13:03:27 +01:00
asonix 7c4f3473af
Lowercase query parameter keys when parsing 2024-03-04 13:03:16 +01:00
Alex b6a91e549b
[test-presigned] Add API test for presigned requests
ci/woodpecker/pr/debug Pipeline failed Details
2024-03-04 13:02:07 +01:00
Alex 32d6b4def8 Merge pull request 'Add talk on 2024-02-09 at capitoul.org' (#755) from talk-capitoul into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #755
2024-03-04 11:08:23 +00:00
Alex c4de471de1 Merge pull request 'doc: fix typo in connect/backup.md' (#749) from Armael/garage:doc-typo into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #749
2024-03-03 13:51:38 +00:00
Armaël Guéneau 16e17375c5 doc: fix typo in connect/backup.md 2024-03-03 13:02:56 +01:00
Alex 95ab36aae7 Merge pull request 'Bump version to v0.9.2' (#747) from rel-0.9.2 into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #747
2024-03-01 16:20:28 +00:00
Alex 6a7623e90d
[rel-0.9.2] Bump version to v0.9.2
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-03-01 16:54:39 +01:00
Alex 70b9904e91 Merge pull request 'AWS signatures v4: don't actually check Content-Type is signed' (#745) from fix-signed-headers into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
Reviewed-on: #745
2024-03-01 12:50:15 +00:00
Alex a36248a169
[fix-signed-headers] aws signatures v4: don't actually check Content-Type is signed
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
This page of the AWS docs indicate that Content-Type should be part of
the CanonicalHeaders (and therefore SignedHeaders) strings in signature
calculation:

https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html

However, testing with Minio Client revealed that it did not sign the
Content-Type header, and therefore we broke CI by expecting it to be
signed. With this commit, we don't mandate Content-Type to be signed
anymore, for better compatibility with the ecosystem. Testing against
the official behavior of S3 on AWS has not been done.
2024-03-01 13:12:18 +01:00
Alex b8c7a560ef Merge pull request 'Fix potential timing side-channels in authentication mechanisms' (#737) from fix-auth-ct-eq into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #737
2024-02-29 14:04:38 +00:00
Alex d3cf560e5c Merge pull request 'Docs: add default metrics_token in quick start + uniformize use of base64' (#739) from doc-default-token into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #739
2024-02-29 12:20:24 +00:00
Alex 73b11eb17c
[doc-default-token] add default metrics_token in quick start + uniformize use of base64
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline failed Details
2024-02-29 13:17:36 +01:00
Alex 6d33e721c4
[fix-auth-ct-eq] use consant time comparison for awsv4 signature verification
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-29 13:07:18 +01:00
Alex eaac4924ef
[fix-auth-ct-eq] use argon2 hashing and verification for admin/metrics token checking 2024-02-29 13:07:15 +01:00
Alex 02005055ae Merge pull request 'Mention deduplication and compression in features page' (#736) from doc-dedup into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #736
2024-02-28 12:49:26 +00:00
Alex a294dd9473
[doc-dedup] reorder features, move no-RAFT down
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-28 13:48:45 +01:00
Alex 947973982d
[doc-dedup] fix #rpc_bind_outgoing anchor in config page
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-28 13:45:30 +01:00
Alex dc995059aa
[doc-dedup] mention deduplication and compression in features page
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-28 13:43:30 +01:00
Alex 10031a3a91 Merge pull request 'Split presigned signature verification + fix conditions' (#735) from fix-presigned into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #735
2024-02-28 11:38:00 +00:00
Alex 90cab5b8f2
[fix-presigned] add comments and reorganize
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-28 12:24:21 +01:00
Alex e9f759d4cb
[fix-presigned] presigned requests: allow x-amz-* query parameters to stand in for equivalent headers 2024-02-28 12:24:21 +01:00
Alex a5e4bfeae9
[fix-presigned] write comments 2024-02-28 12:24:21 +01:00
Alex 4c1d42cc5f
[fix-presigned] add back anonymous request code path + refactoring 2024-02-28 12:24:21 +01:00
Alex 2efa9c5a1a
[fix-presigned] PostObject: verify X-Amz-Algorithm 2024-02-28 12:24:20 +01:00
Alex a8cb8e8a8b
[fix-presigned] split presigned/normal signature verification 2024-02-28 12:24:13 +01:00
Alex 911a83ea7d Merge pull request 'rewrite read_and_put_block as a series of steps with channels' (#734) from refactor-put into main
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #734
2024-02-26 17:52:45 +00:00
Alex b76c0c102e
[refactor-put] add ordering tag to blocks being sent to storage nodes
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-26 18:35:11 +01:00
Alex babccd2ad3
[refactor-put] send several blocks in parallel to storage nodes
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-26 18:22:37 +01:00
Alex 3fe94cc14f
[refactor-put] rewrite read_and_put_block as a series of steps with channels
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-26 17:55:37 +01:00
Alex ee2b0c8dda
[talk-capitoul] Add talk on 2024-02-09 at capitoul.org
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-26 13:42:47 +01:00
Alex 17b55205aa Merge pull request 'doc: reverse-proxy.md: Added section on caddy-fs-s3' (#733) from jpds/garage:caddy-fileserver-browse-s3 into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #733
2024-02-26 09:56:09 +00:00
Jonathan Davies 3813e6c71d doc: reverse-proxy.md: Added section on caddy-fs-s3.
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-26 00:54:33 +00:00
Alex e399b60e25 Merge pull request 'GetObject: split out handle_get_full (small refactoring)' (#732) from split_getobject into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #732
2024-02-23 17:26:53 +00:00
Alex d640102b76
[split_getobject] GetObject: split out handle_get_full
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-23 18:14:50 +01:00
Alex 61758ce0f9 Merge pull request 'some refactoring on data read/write path' (#729) from refactor-block into main
Reviewed-on: #729
2024-02-23 15:49:43 +00:00
Alex 6ee691e65f
[refactor-block] simplify some more
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-23 12:50:10 +01:00
Alex e9c42bca34
[refactor-block] add DataBlockStream type
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-23 12:22:29 +01:00
Alex cd1069c1d4
[refactor-block] refactor DataBlock and DataBlockPath 2024-02-23 12:15:52 +01:00
Alex 07c7895948
[refactor-block] simplify rpc_get_block
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-23 11:54:40 +01:00
Alex 9b41f4ff20
[refactor-block] move read_stream_to_end to garage_net 2024-02-23 11:46:57 +01:00
Alex 93552b9275
[refactor-block] Remove redundant BlockStream type 2024-02-23 11:33:38 +01:00
Alex 74d0c47f21 Merge pull request 'Add node-global lock for bucket/key operations (fix #723)' (#728) from lock-createbucket into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #728
2024-02-22 12:05:19 +00:00
Alex cff702a951
[lock-createbucket] Add node-global lock for bucket/key operations (fix #723)
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-22 12:28:21 +01:00
Alex 7e212e20e0 Merge pull request 'Minor typos & grammar fixes in docs' (#727) from hartraft/garage:docs-typo-fix into main
Reviewed-on: #727
2024-02-22 09:26:08 +00:00
hartraft 00a5f14a7b Align admin endpoint port
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-20 21:19:00 +01:00
hartraft 1a07c8dd54 Minor typos and grammar
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-20 21:03:39 +01:00
hartraft 292f4ff9cb Typo
ci/woodpecker/pr/debug Pipeline was successful Details
Fix small typo on the getting started guide
2024-02-20 18:35:56 +00:00
Alex 885405d944 Merge pull request 'system metrics improvements' (#726) from peer-metrics into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #726
2024-02-20 15:35:12 +00:00
Alex bcd571ef57
[peer-metrics] add documentation for new cluster status metrics
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-20 14:59:04 +01:00
Alex b868493da9
[peer-metrics] add basic cluster node status metrics (fix #545)
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-20 14:50:24 +01:00
Alex 182a23cc12
[peer-metrics] refactor SystemMetrics to hold a reference to System
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-20 14:20:58 +01:00
Alex 3cdf69f079
[peer-metrics] Add metrics for cluster health, like GetClusterHealth admin API
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-20 13:50:45 +01:00
Alex 00d479358d
[peer-metrics] refactor/simplify SystemMetrics 2024-02-20 13:50:45 +01:00
Alex 203bb10035 Merge pull request 'Filter nodes Garage tries to connect to' (#719) from reconnect-only-current into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #719
2024-02-20 10:37:11 +00:00
Alex e91576677e
[reconnect-only-current] filter nodes to reconnect to
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
do not try reconnecting to nodes received from consul/kubernetes
discovery if they are not currently in the layout
2024-02-20 11:07:10 +01:00
Alex 0b9859befa Merge pull request 'garage_net: retry connecting when new IP is learned' (#724) from networking-fixes into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #724
2024-02-19 17:37:01 +00:00
Alex 95e3a39b4d
[networking-fixes] small refactoring in garage_net peering
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-19 18:12:21 +01:00
Alex 66fe893023
[networking-fixes] garage_net: retry connecting when new IP is learned 2024-02-19 18:12:21 +01:00
Alex 6bb34899f2 Merge pull request 'fixes to RPC networking' (#721) from networking-fixes into main
ci/woodpecker/push/debug Pipeline failed Details
Reviewed-on: #721
2024-02-19 11:44:05 +00:00
Alex eab54b3798
[networking-fixes] add doc for rpc_bind_outgoing
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-19 11:45:44 +01:00
Alex b96f84b894
[networking-fixes] add option to bind outgoing RPC sockets (fix #638)
Thanks to yuka for the original patch.
2024-02-19 11:45:44 +01:00
Alex f0bbad2db9
[networking-fixes] use rpc_public_addr in netapp's HelloMessage 2024-02-19 11:45:44 +01:00
Alex b8217361c0 Merge pull request 'doc: fixes to index of configuration options' (#722) from doc-fixes into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #722
2024-02-19 10:45:14 +00:00
Alex e73cb79e1e
[doc-fixes] configuration reference: fix typo and set block size in M
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-19 11:42:06 +01:00
Alex e54effec45
[doc-fixes] fixes to index of configuration options
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-19 11:36:22 +01:00
Alex 7be3f15e45 Merge pull request 'import Netapp code into Garage codebase' (#717) from import-netapp into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #717
2024-02-15 12:51:52 +00:00
Alex 125c662860
[import-netapp] move and rename FullMeshPeeringSrategy to PeeringManager
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-15 12:15:35 +01:00
Alex 5766befb24
[import-netapp] fix tests 2024-02-15 12:15:33 +01:00
Alex 5ea24254a9
[import-netapp] import Netapp code into Garage codebase 2024-02-15 12:15:07 +01:00
Alex a2ab275da8 Merge pull request 'Fix cargo warnings in Cargo.toml files' (#718) from fix-cargo-toml into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #718
2024-02-15 11:14:01 +00:00
Alex 1b0f167d2f
[fix-cargo-toml] fix cargo warnings in Cargo.toml files
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-15 10:54:58 +01:00
Alex 823078b4cd Merge pull request 'small fixes to config/secrets handling' (#715) from fix-secrets-695 into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #715
2024-02-13 10:04:49 +00:00
Alex ea09b483fe Merge pull request 'doc: mention `warn` and `error` as available log levels' (#716) from emilylange/garage:doc/mention-warn-error-log-levels into main
ci/woodpecker/push/debug Pipeline failed Details
Reviewed-on: #716
2024-02-13 08:13:23 +00:00
emilylange c86ac264cb
doc: mention `warn` and `error` as available log levels
ci/woodpecker/pr/debug Pipeline was successful Details
For some users, this might be their first time being interacting with
the `env_logger` crate.
As such, they might not be aware that less verbose log levels exist.
Some might not want to log every incoming request, for example.

This commit also adds syntax hints to the code-fence for bash for better
syntax highlighting of that section, and repeats itself multiple times,
that `info` is, in fact, the default.

No changes to the recommendation of log levels were made.
2024-02-12 18:00:51 +01:00
Alex bf283c9924
[fix-secrets-695] config: replace String by PathBuf for *_file
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-12 15:36:43 +01:00
Alex 25e5738568
[fix-secrets-695] take into account rpc secret from file for cli commands (fix #695) 2024-02-12 10:42:17 +01:00
Alex 198188017c Merge pull request 'Implement header overriding in GetObject (fix #650)' (#713) from header-override-650 into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #713
2024-02-09 15:40:18 +00:00
Alex 02e98e2d10
[header-override-650] implement header overriding in GetObject (fix #650)
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-09 15:58:46 +01:00
Alex fe175fa8e2 Merge pull request '`garage block info`: find blocks by prefix (fix #682)' (#712) from block-info-short-682 into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #712
2024-02-09 14:07:29 +00:00
Alex 3865080c35 Merge pull request 'Allow multi-character delimiters in List* (fix #692)' (#711) from multi-char-delimiter-692 into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #711
2024-02-09 13:38:17 +00:00
Alex 8da67b3aa2
[block-info-short-682] `garage block info`: find blocks by prefix (fix #682)
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-09 14:35:53 +01:00
Alex 10bc2ead60
[multi-char-delimiter-692] allow multi-character delimiters in List* (fix #692)
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-09 14:15:29 +01:00
Alex 0c7ce001c9 Merge pull request 'Fix & simplify CI using Woodpecker' (#706) from nix-improvements into main
ci/woodpecker/push/debug Pipeline failed Details
Reviewed-on: #706
2024-02-09 12:11:23 +00:00
Alex f7ae966ed3
[nix-improvements] special case for Docker's "386" architecture
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-09 12:49:17 +01:00
Alex 561fad0b44
[nix-improvements] get rid of Drone 2024-02-09 12:19:16 +01:00
Alex 1be75fbf4e
[nix-improvements] fix kaniko and manifest-tool
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline failed Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/publish unknown status Details
2024-02-09 11:46:46 +01:00
Alex 555ed75548
[nix-improvements] ci: check static as separate step
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-09 11:36:51 +01:00
Alex 1c85e5e428
[nix-improvements] adapt woodpecker pipelines
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-09 11:19:32 +01:00
Alex d35d4599de
[nix-improvements] use kaniko and manifest-tools from nixpkgs, simplify
ci/woodpecker/push/debug Pipeline failed Details
ci/woodpecker/pr/debug Pipeline failed Details
2024-02-09 11:15:52 +01:00
Alex 9900368380
[nix-improvements] modernize Nix infrastructure 2024-02-09 11:10:13 +01:00
Alex e4a43bfd59 Merge pull request 'Upgrade toml, kube, k8s-openapi + code fixes' (#709) from dep-upgrade-202402 into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #709
2024-02-09 09:32:54 +00:00
Alex 5c63193d1d
[dep-upgrade-202402] fix shutdown issue introduced when upgrading hyper
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-08 23:43:59 +01:00
Alex bcbd15da84
[dep-upgrade-202402] cargo clippy fixes
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-08 23:29:57 +01:00
Alex ad5ce968d2
[dep-upgrade-202402] remove useless mut 2024-02-08 23:29:57 +01:00
Alex c2e1e172d4
[dep-upgrade-202402] update toml, kube and k8s-openapi 2024-02-08 23:29:56 +01:00
Alex 8061bf5e1c Merge pull request 'Use only oxalica/rust-overlay toolchain and not nixpkgs' (#710) from oxalica-toolchain-only into main
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/cron/debug Pipeline was successful Details
ci/woodpecker/cron/release/4 Pipeline was successful Details
ci/woodpecker/cron/release/3 Pipeline was successful Details
ci/woodpecker/cron/release/2 Pipeline was successful Details
ci/woodpecker/cron/release/1 Pipeline was successful Details
ci/woodpecker/cron/publish Pipeline was successful Details
Reviewed-on: #710
2024-02-08 22:29:25 +00:00
Alex 8724aabdf5
[oxalica-toolchain-only] remove obsolete comment on toolchains
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-08 23:23:27 +01:00
Alex 57024a2129
[oxalica-toolchain-only] remove custom toolchains from toolchains.nix
ci/woodpecker/push/debug Pipeline was successful Details
2024-02-08 23:21:00 +01:00
Alex 9e0b1dcf1c
[oxalica-toolchain-only] remove use of nixos rust toolchain
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline was successful Details
ci/woodpecker/deployment/publish Pipeline was successful Details
2024-02-08 19:10:26 +01:00
Alex 304a89c57b Merge pull request 'convert drone pipelines to woodpecker' (#708) from woodpecker into main
ci/woodpecker/push/debug Pipeline was successful Details
Reviewed-on: #708
2024-02-08 17:46:00 +00:00
Alex 25c2f37667
[woodpecker] remove upgrade test on i386
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
2024-02-08 18:42:26 +01:00
Alex 4e62e86644
[woodpecker] disable docker image generation as auth is broken for now
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/push/debug Pipeline was successful Details
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
ci/woodpecker/deployment/debug Pipeline was successful Details
ci/woodpecker/deployment/release/3 Pipeline was successful Details
ci/woodpecker/deployment/release/1 Pipeline was successful Details
ci/woodpecker/deployment/release/4 Pipeline was successful Details
ci/woodpecker/deployment/release/2 Pipeline failed Details
ci/woodpecker/deployment/publish unknown status Details
2024-02-08 18:27:33 +01:00
Alex 8b6a44a53d
[woodpecker] convert drone pipelines to woodpecker
ci/woodpecker/push/debug Pipeline was successful Details
ci/woodpecker/pr/debug Pipeline was successful Details
ci/woodpecker/deployment/debug Pipeline was successful Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
ci/woodpecker/deployment/release/3 Pipeline failed Details
ci/woodpecker/deployment/release/1 Pipeline failed Details
ci/woodpecker/deployment/release/4 Pipeline failed Details
ci/woodpecker/deployment/release/2 Pipeline failed Details
ci/woodpecker/deployment/publish unknown status Details
2024-02-08 18:24:52 +01:00
Alex 710680da15 Merge pull request 'update toolchain' (#705) from dep-upgrade-202402 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #705
2024-02-08 14:58:18 +00:00
Alex 33e6db8b72
[dep-upgrade-202402] update rustc to 1.73
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2024-02-08 12:33:09 +01:00
Alex 3a49f86073 Merge pull request 'Enable LTO for release builds using Nix' (#707) from lto-nix into main
continuous-integration/drone/push Build is failing Details
Reviewed-on: #707
2024-02-08 10:36:49 +00:00
Alex 2b92e8d7c6
[lto-nix] enable LTO for release builds using Nix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
2024-02-08 10:22:23 +01:00
Alex 59930977e0 Merge pull request 'Cargo.toml: Enable full LTO in release builds and thin in dev builds.' (#704) from jpds/garage:release-build-lto into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #704
2024-02-07 16:37:02 +00:00
Jonathan Davies 620664ee9c Cargo.toml: Enable full LTO in release builds and thin in dev builds.
continuous-integration/drone/pr Build is passing Details
2024-02-07 16:11:27 +00:00
Alex 5d941e0100 Merge pull request 'Dependency upgrades: http, hyper, aws-sdk, smaller deps' (#703) from dep-upgrade-202402 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #703
2024-02-07 14:59:40 +00:00
Alex e011941964
[dep-upgrade-202402] refactor use of BodyStream
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-02-07 15:32:51 +01:00
Alex 53746b59e5
[dep-upgrade-202402] slightly more explicit error management
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-02-07 14:53:13 +01:00
Alex a31d1bd496
[dep-upgrade-202402] fix obsolete DateTime::from_utc calls
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-02-07 14:48:27 +01:00
Alex e524e7a30d
[dep-upgrade-202402] rename BytesBody into ErrorBody for clarity 2024-02-07 14:45:52 +01:00
Alex fe48d60d2b
[dep-upgrade-202402] refactor http listener code
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-02-07 14:34:40 +01:00
Alex 22332e6c35
[dep-upgrade-202402] simplify/refactor GetObject
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-02-05 20:26:33 +01:00
Alex 81ccd4586e
[dep-upgrade-202402] upgrade to http/hyper 1.x for tests
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-02-05 19:57:35 +01:00
Alex a22bd31920
[dep-upgrade-202402] migration to http/hyper 1.0 for k2v api
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2024-02-05 19:27:12 +01:00
Alex 0bb5b77530
[dep-upgrade-202402] wip: port to http/hyper crates v1
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2024-02-05 18:49:54 +01:00
Alex 6e69a1fffc
[dep-upgrade-202402] prepare migration to http/hyper 1.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-02-05 14:44:12 +01:00
Alex 6e4229e29c
[dep-upgrade-202402] update aws-sdk dependencies
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-02-05 14:02:45 +01:00
Alex c0a7552015
[dep-upgrade-202402] upgrade easy dependencies
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-02-05 13:58:23 +01:00
Alex fe1af5d98b
[dep-upgrade-202402] refactor dependencies: move all as workspace deps
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-02-05 13:02:02 +01:00
Alex f65da26ae2
[dep-upgrade-202402] update dependency minor versions using `cargo update`
continuous-integration/drone/push Build is passing Details
2024-02-05 12:26:31 +01:00
Alex feeb076b7f Merge pull request 'Add FOSDEM'24 talk' (#702) from talk-fosdem-24 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #702
2024-02-05 11:17:15 +00:00
Alex fe37202f8f
[talk-fosdem-24] remove abstract.md
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-02-05 12:16:09 +01:00
Alex 76e09c0472
[talk-fosdem-24] small change in talk
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-02-01 11:43:21 +01:00
Alex 1d30cf36c8
[talk-fosdem-24] improve fosdem 24 talk
continuous-integration/drone/push Build is passing Details
2024-01-30 14:27:39 +01:00
Alex d45189e7b8 Merge pull request 'doc: fix some typos' (#696) from Armael/garage:typos into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #696
2024-01-28 14:15:47 +00:00
Armaël Guéneau 91a51dd3e8 doc: fix some typos
continuous-integration/drone/pr Build is passing Details
2024-01-27 14:51:15 +01:00
Alex 08a871390e Merge pull request 'convert_db: allow LMDB map size override' (#691) from zdenek.crha/garage:convert_db_lmdb_map_size into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #691
2024-01-24 08:19:45 +00:00
Alex c7dad980b7
[talk-fosdem-24] remove geodistrib paper shot
continuous-integration/drone/push Build is passing Details
2024-01-23 17:25:45 +01:00
Alex c2541f280c
[talk-fosdem-24] WIP, write talk, modify lots of assets
continuous-integration/drone/push Build is passing Details
2024-01-23 16:50:30 +01:00
Zdenek Crha 0eef8a69f0 make all garage_db::Engine variants un-conditional
continuous-integration/drone/pr Build is passing Details
Having all Engine enum variants conditional causes compilation errors
when *none* of the DB engine features is enabled. This is not an issue
for full garage build, but affects crates that use garage_db as
dependency.

Change all variants to be present at all times. It solves compilation
errors and also allows us to better differentiate between invalid DB
engine name and engine with support not compiled in current binary.
2024-01-22 21:12:02 +01:00
Alex 4de7ac6023
FOSDEM'24 talk WIP
continuous-integration/drone/push Build is passing Details
2024-01-22 18:52:14 +01:00
Zdenek Crha 74e72fc996 convert_db: cleanup naming and comments for open overrides
continuous-integration/drone/pr Build is passing Details
2024-01-22 17:52:39 +01:00
Alex 7a3b863150 Merge pull request 'doc: add presentation at seed webinar 2024-01-12' (#693) from prez-seed-webinar-202401 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #693
2024-01-22 13:49:08 +00:00
Alex d2c40b12e8
doc/talks: refactor assets
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-01-22 14:43:46 +01:00
Alex cf0abbfe42
rm abstract
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2024-01-22 14:33:48 +01:00
Zdenek Crha 4b54e053df convert_db: prevent conversion between same input/output engine
continuous-integration/drone/pr Build is passing Details
Use optional DB open overrides for both input and output database.

Duplicating the same override flag for input/output would result in too
many, too long flags. It would be too costly for very rare edge-case
where converting between same DB engine, just with different flags.

Because overrides flags for different engines are disjoint and we are
preventing conversion between same input/ouput DB engine, we can have
only one set.

The override flag will be passed either to input or output, based on
engine type it belongs to. It will never be passed to both of them and
cause unwelcome surprise to user.
2024-01-18 17:57:56 +01:00
Zdenek Crha 8527dd87cc convert_db: allow LMDB map size override
continuous-integration/drone/pr Build is passing Details
2024-01-17 21:20:34 +01:00
Alex 0263828560 Merge pull request 'Garage v0.9.1' (#689) from rel-v0.9.1 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #689
2024-01-17 12:00:23 +00:00
Alex ee57dd922b
Bump version to 0.9.1
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-01-16 16:28:17 +01:00
Alex 9cfeea389a Merge pull request 'CLI help, comments & messages: make clear that full-length node ID = public key' (#688) from rename-public-key into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #688
2024-01-16 13:33:43 +00:00
Alex 82a29bf6e5
help, comments: make clear that full-length node ID = public key
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
Generally, avoid using the "public key" terminology
2024-01-16 14:04:11 +01:00
Alex 707d85f602 Merge pull request 'sync garage v0.9 with garage v0.8' (#657) from sync-08-09 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #657
2024-01-16 11:33:27 +00:00
Alex 4c5be79b80 Garage v0.8.5
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
This minor release includes the following improvements and fixes:
 
 New features:
 
 - Configuration: make LMDB's `map_size` configurable and make `block_size` and `sled_cache_capacity` expressable as strings (such as `10M`) (#628, #630)
 
 - Add support for binding to Unix sockets for the S3, K2V, Admin and Web API servers (#640)
 
 - Move the `convert_db` command into the main Garage binary (#645)
 
 - Add support for specifying RPC secret and admin tokens as environment variables (#643)
 
 - Add `allow_world_readable_secrets` option to config file (#663, #685)
 
 Bug fixes:
 
 - Use `statvfs` instead of mount list to determine free space in metadata/data directories (#611, #631)
 
 - Add missing casts to fix 32-bit build (#632)
 
 - Fix error when none of the HTTP servers (S3/K2V/Admin/Web) is started and fix shutdown hang (#613, #633)
 
 - Add missing CORS headers to PostObject response (#609, #656)
 
 - Monitoring: finer histogram boundaries in Prometheus exported metrics (#531, #686)
 
 Other:
 
 - Documentation improvements (#641)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEwhSWp0+ubv79TiqUDkltFQljdr4FAmWmWvsACgkQDkltFQlj
 dr59rRAAiMGQpDUK0QqiCgrp1rcUhvtj3DsQEpT7F14Jo3I7bFDmONZolPbO8YAs
 VE4S4CBQogNH0lMQ6EvJYiBCxDWkxdVibKqDWOYJmUw3bZ6Ypn1eZIF0+Uf1TDI+
 C6CxYbyDQtqvm330K2Du2uOoGiIgm83b6jktK/0FtbAE2GWhtYmQwoelprAGH20i
 baaSfkZbBl8toUscakyhPVVSQ86BcVQ2jqL6Ofu4eQknjMRqCeAIQhMB2ikpiwBz
 hbTZ3x0EfJJqiHocfkTE3B3cPnDKuHDzxPRhLMB/olEpzoxaLJ2+tc0ziQdl06/F
 1c8nHM57L1IaDGKAkpcANnj3yVf3jfPqq9SEUNi+xSIWbvln91RvXU4RIB8hiZqa
 rqAHjDuys++3DoAUr/L4X233MWufVAEYT4B+jaPAv6ys35xhQwPAMJrA0OZEr+hE
 HQMPIG9uMDVjZ2QCgFYgC02kEqvxbsRSVnb0wjI7eoNOk0LKo154eJh1cOGd4Ibs
 yBTiIi1+Y7RCXNxcIHKlj5vMUHPBr2D8DVFj21kfZKUtMQ/8yScoiRC14ZR4J2xF
 IYe3aDm80l3tYgnPRVj4fOGiIPsqnZd4iazYKwj2cifB8tzYfyh5/9fv2aio8K5y
 0GAw4AoTtgg1hLMadbc3om7wy64IRaZzXjv59eYPEotZYdreVpM=
 =RVm8
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEwhSWp0+ubv79TiqUDkltFQljdr4FAmWmZKIACgkQDkltFQlj
 dr6wZRAA1XuOBax/7YsIix3ag0kjnwnGAx8wYaA+Jiojw2yv/+ePL6yGHcKA93lI
 SL8l5G06fTDgpbpfdVbgyRzGT2tmjrXvkygRWf2WMDZ9I+8WxUA2q8aWaEMiNmvd
 0cfzYi14TgX+O0wEbKeeqrXG0473/yThk5U1FNbdJd7rkJ4JzaOTthdk0LJLiEUG
 zQ/YIYx3FVFoVI0rdORb3HKzqYHjMAvpzNhEIeqkrpDEzplQ3jKvY+rYWQL3S9zE
 bHbkZPoT62OpJGMr04/1FUkB+ctsvUrM0CskruaSKWyD2M1xTo/Ug4jh5muVIcdJ
 hJis1/k5rV8JDTIkb6eAxKqfVzI+56yDxofT8rVF4JhvlzvXDLOa0uyDVyA8/6un
 ylWRzs2Mlj6/TbscmPjrdH8v2Lb0zjWxvXe2iYnHHfldWUlYuBtI6FZiG3uNjBCs
 7ns3xr4VOw13RM5auVkEQksIO6lru0kvH18GB3h6Msx67w2JUzl+PaNv8PdRtnmV
 0SfLUl1Nh8yT2h9qG6/3cDE9E1G/mjg8SgljoEe6ahs/BUZmLuTHTyBjf+P22ZbO
 DCITM3CwrV+y/aKnRdLvd6LOWFinUqMS8YvVSVqJh9vo9R+dt33LdBMdWjP4IYHF
 MbACe4FzeG3AXUcHB/mDCm7a2H2BFwzAovFy0SE639PfWBxNue0=
 =gzWq
 -----END PGP SIGNATURE-----

Merge tag 'v0.8.5' into sync-08-09

Garage v0.8.5

This minor release includes the following improvements and fixes:

New features:

- Configuration: make LMDB's `map_size` configurable and make `block_size` and `sled_cache_capacity` expressable as strings (such as `10M`) (#628, #630)

- Add support for binding to Unix sockets for the S3, K2V, Admin and Web API servers (#640)

- Move the `convert_db` command into the main Garage binary (#645)

- Add support for specifying RPC secret and admin tokens as environment variables (#643)

- Add `allow_world_readable_secrets` option to config file (#663, #685)

Bug fixes:

- Use `statvfs` instead of mount list to determine free space in metadata/data directories (#611, #631)

- Add missing casts to fix 32-bit build (#632)

- Fix error when none of the HTTP servers (S3/K2V/Admin/Web) is started and fix shutdown hang (#613, #633)

- Add missing CORS headers to PostObject response (#609, #656)

- Monitoring: finer histogram boundaries in Prometheus exported metrics (#531, #686)

Other:

- Documentation improvements (#641)
2024-01-16 12:12:27 +01:00
Alex 083e982f5f Merge pull request 'Garage v0.8.5' (#687) from rel-0.8.5 into main-0.8.x
continuous-integration/drone/push Build is passing Details
Reviewed-on: #687
2024-01-16 10:30:54 +00:00
Alex 50643e61bf
Bump version to 0.8.5
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2024-01-16 10:47:33 +01:00
Alex a6421ee5a5 Merge pull request 'monitoring: finer histogram boundaries in prometheus metrics (fix #531)' (#686) from fix-531 into main-0.8.x
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is passing Details
Reviewed-on: #686
2024-01-15 16:44:58 +00:00
Alex 993ce74976 Merge pull request '0.8.x: config: refactor secret sourcing' (#685) from secret-sourcing into main-0.8.x
continuous-integration/drone/push Build is passing Details
Reviewed-on: #685
2024-01-15 16:41:50 +00:00
Alex f512609123
monitoring: finer histogram boundaries in prometheus metrics (fix #531)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-01-15 17:33:35 +01:00
Alex 97bae7213a
config: additional tests for secret sourcing
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-01-15 17:30:30 +01:00
Alex 7228695ee2
config: refactor secret sourcing
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2024-01-15 17:18:46 +01:00
Alex ee7fe27d3d Merge pull request 'Add allow_world_readable_secrets option to config file' (#663) from PicNoir/garage:nin/world-readable-conf-file into main-0.8.x
continuous-integration/drone/push Build is passing Details
Reviewed-on: #663
2024-01-15 15:20:16 +00:00
Alex d91a1de731 Merge pull request 'fix typo in peertube doc' (#617) from Lapineige/garage:main into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #617
2024-01-11 11:19:42 +00:00
Alex 723e56b37f Merge pull request 'Jepsen testing (NLnet task 3 subtask 1)' (#544) from jepsen into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #544
2024-01-11 10:52:12 +00:00
Alex 60f0bd03b6
doc: add talk for SEED webinar
continuous-integration/drone/push Build is passing Details
2024-01-11 11:40:44 +01:00
Alex fa9247f11b jepsen: updated results, confirming that task3 works
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-12-14 16:23:48 +01:00
Alex a8b0e01f88 Merge pull request 'OpenAPI specification of admin APIv1' (#672) from api-v1 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #672
2023-11-29 15:42:46 +00:00
Quentin 8088690650
fix the doc
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-28 16:18:28 +01:00
Alex ffa659433d Merge pull request 'Doc: fix db_engines section and improve config reference' (#674) from fix-doc-db-engine into main
continuous-integration/drone/push Build is failing Details
Reviewed-on: #674
2023-11-28 12:03:46 +00:00
Alex cfa5550cb2 doc: move replication_mode to top of configuration page reference
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-28 11:58:27 +01:00
Alex 939d1f2e17 doc: improve navigation in configuration reference 2023-11-28 11:53:26 +01:00
Alex 1f6efe57be doc: update the `db_engine` section 2023-11-28 11:33:31 +01:00
Quentin 3908619eac
add ClusterHealthReport endpoint to the API
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-11-28 09:34:01 +01:00
Quentin 68d23cccdf
disable int64 finally for now
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-11-23 10:20:36 +01:00
Quentin 9f1043586c
set layout version as required
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-23 10:16:16 +01:00
Quentin 1caa6e29e5
capacity is int64
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-11-23 10:02:41 +01:00
Quentin 814b3e11d4
fix query parameters for keys
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-23 08:50:10 +01:00
Quentin 2d37e7fa39
convert showsecretkey from bool to enum
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 21:05:36 +01:00
Quentin 4f473f43c9
Change how query parameters are handled
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-11-22 20:39:38 +01:00
Quentin 3684c29ad0
handle key changes
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-11-22 18:14:38 +01:00
Quentin 0d415f42ac
Port GetKeyInfo by adding showSecretKey query param
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 18:05:11 +01:00
Quentin 20b3afbde4
Port layout endpoints
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 17:49:51 +01:00
Quentin e3cd6ed530
port GetLayout and AddLayout
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 15:24:30 +01:00
Quentin 9b24d7c402
Upgrade GetNodes
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 14:25:04 +01:00
Alex 36bd21a148 Merge pull request 'Allow 0 as a part number marker' (#670) from asonix/garage:main into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #670
2023-11-22 10:33:31 +00:00
Quentin d1d1940252
Health info message now advertises API v1
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 09:28:50 +01:00
Quentin c63b446989
skeleton for api v1
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-11-22 08:58:09 +01:00
asonix 92fd899fb6 Allow 0 as a part number marker
continuous-integration/drone/pr Build is passing Details
2023-11-21 17:39:51 -06:00
Alex 92dd2bbe15 jepsen: nlnet task3a seems to fix things
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-11-16 18:09:13 +01:00
Alex 18e5811159
jepsen: add patch and use more complete names
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-11-16 12:57:21 +01:00
Félix Baylac Jacqué f83fa02193 Add allow_world_readable_secrets option to config file
continuous-integration/drone/pr Build is passing Details
Sometimes, the secret files permissions checks gets in the way. It's
by no mean complete, it doesn't take the Posix ACLs into account among
other things. Correctly checking the ACLs would be too involving (see
#658 (comment))
and would likely still fail in some weird chmod settings.

We're adding a new configuration file key allowing the user to disable
this permission check altogether.

The (already existing) env variable counterpart always take precedence
to this config file option. That's useful in cases where the
configuration file is static and cannot be easily altered.

Fixes #658

Co-authored-by: Florian Klink <flokli@flokli.de>
2023-10-26 18:25:13 +02:00
Alex f4d3905d15 Merge pull request 'nix: add clang to flake.nix and shell.nix' (#664) from add-clang into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #664
2023-10-26 09:25:53 +00:00
Alex a0fa50dfcd Merge pull request 's3 api: refactoring and bug fix in ListObjects' (#655) from fix-list-objects into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #655
2023-10-26 09:22:47 +00:00
Alex d50fa2a562
nix: add clang to flake.nix and shell.nix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-26 11:19:22 +02:00
Alex 4b3dee2ca3 Merge pull request 's3 api: add missing CORS headers to PostObject responses (fix #609)' (#656) from fix-cors-post-object into main-0.8.x
continuous-integration/drone/push Build is passing Details
Reviewed-on: #656
2023-10-26 09:17:14 +00:00
Alex 5b1f50be65 jepsen: testing
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-25 14:43:24 +02:00
Alex 9df7fa0bcd jepsen: use 7 nodes
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-25 14:04:39 +02:00
Alex fd85010a40 jepsen: failures with set2 test in --scenario r
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-25 12:13:27 +02:00
Alex cfbfa09d24 jepsen: fix set2 test omg finally this is so stupid 2023-10-25 11:50:16 +02:00
Alex db921cc05f jepsen: reconfigure nemesis + add db nemesis 2023-10-25 11:41:34 +02:00
Alex 4fa2646a75 jepsen: got a failure with set1
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-24 17:45:22 +02:00
Alex d7ab2c639e jepsen: fix nemesis to actually generate many operations
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-24 16:39:50 +02:00
Alex d13bde5e26 jepsen: set1 and set2 don't fail anymore ??
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-24 15:44:05 +02:00
Alex 75d5d08ee1 Merge pull request 'Ensure increasing version timestamps when writing new object versions' (#543) from increasing-timestamps into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #543
2023-10-24 10:07:16 +00:00
Alex d2c365767b jepsen: more testing
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-24 11:39:45 +02:00
Alex fb6c9a1243 jepsen: update readme
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 15:55:09 +02:00
Alex 9030c1eef8 jepsen: code path for nemesis final generator
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 15:53:46 +02:00
Alex 654775308e jepsen: add cluster reconfiguration nemesis
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 15:48:37 +02:00
Alex f5b0972781 jepsen: register crdt read-after-write is fixed with deleteobject patch
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 15:00:10 +02:00
Alex c82d91c6bc DeleteObject: always insert a deletion marker with a bigger timestamp than everything before
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-20 13:56:35 +02:00
Alex 8686cfd0b1 s3 api: also ensure increasing timestamps for create_multipart_upload
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 13:37:37 +02:00
Alex d148b83d4f jepsen: reg2 failure seems to happen only with deleteobject
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-20 13:36:48 +02:00
Alex c6cde1f143 remove now-unused key parameter in check_quotas 2023-10-20 13:20:47 +02:00
Alex 4b93ce179a jepsen: errors in reg2 workload under investigation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-20 12:56:55 +02:00
Alex 4ba18ce9cc jepsen: wip checker for register-like behavior
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-20 12:13:11 +02:00
Alex ac04934dae s3 api: add missing CORS headers to PostObject responses (fix #609)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-20 10:37:48 +02:00
Alex ef662822c9 jepsen: fix the list-objects call (?)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-19 23:40:55 +02:00
Alex da8b170748 jepsen: investigating listobjects error
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-19 16:45:24 +02:00
Alex 58b0ee1b1a list objects: prettyness and add asserts
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is failing Details
2023-10-19 15:26:17 +02:00
Alex 158dc17a06 listobjects: fix panic if continuation token is an empty string 2023-10-19 15:08:47 +02:00
Alex 74e50edddd jepsen: refactoring 2023-10-19 14:34:19 +02:00
Alex 0215b11402 Merge pull request 'Add support for specifying `rpc_secret_file`, `metrics_token_file` and `admin_token_file` using environment variables' (#643) from networkException/garage:token-file-env into main-0.8.x
continuous-integration/drone/push Build is passing Details
Reviewed-on: #643
2023-10-19 09:33:12 +00:00
networkException 8599051c49
garage: support specifying token / secret as environment variables
continuous-integration/drone/pr Build is passing Details
this patch adds support for specifying the `rpc_secret_file`,
`metrics_token_file` and `admin_token_file` as environment variables.
2023-10-19 03:39:02 +02:00
networkException 4a19ee94bb
garage: fix admin-token description 2023-10-19 03:31:50 +02:00
networkException c99cb58d71
util: move reading secret file into seperate helper
this patch moves the logic to read a secret file (and check for correct
permissions) from `secret_from_file` into a new `read_secret_file`
helper.
2023-10-19 03:29:48 +02:00
networkException 5feb6a1f64
docs: add documentation for specifying token / secret file as environment variables 2023-10-19 03:28:44 +02:00
Alex b3bf16ee27 make jepsen test more robust: handle errors and timeouts, fixed access key
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-18 17:51:34 +02:00
Alex d146cdd5b6 cargo fmt
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-18 16:38:26 +02:00
Alex 3d6ed63824 check_quotas: avoid re-fetching object from object table
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-10-18 16:36:48 +02:00
Alex 45b0453d0f Ensure increasing version timestamps in PutObject 2023-10-18 16:31:50 +02:00
Alex ddd3de7fce refactor jepsen code
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-18 16:30:45 +02:00
Alex 84d43501ce refactor jepsen setup logic
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-18 15:34:12 +02:00
Alex 012ade5d4b jepsen: update jepsen and fix garage key info 2023-10-18 14:06:32 +02:00
Alex ef5ca86dfc jepsen: update to garage 0.9.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-18 14:01:18 +02:00
Alex 9ec4cca334 reformatting
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-18 12:03:12 +02:00
Alex 18ee8efb5f Check read-after-write property for sets 2023-10-18 12:03:12 +02:00
Alex 55eb4e87c4 set tests with independant tests together 2023-10-18 12:03:11 +02:00
Alex 0bb1577ae1 two set workloads with different checkers 2023-10-18 12:03:11 +02:00
Alex 6eb26be548 Add garage set test (this one works :p) 2023-10-18 12:03:11 +02:00
Alex eb86eaa6d2 refactor jepsen test 2023-10-18 12:03:11 +02:00
Alex 80d7b7d858 remove useless files 2023-10-18 12:03:11 +02:00
Alex 93a7132b4c the fix for increasing timestamps does not make things linearizable 2023-10-18 12:03:11 +02:00
Alex dc5245ce65 even without nemesis, s3 get/put/delete is not linearizable (is this normal?) 2023-10-18 12:03:11 +02:00
Alex 70c1d3db46 better match exceptions 2023-10-18 12:03:11 +02:00
Alex bc11701999 jepsen: s3 gets and puts 2023-10-18 12:03:11 +02:00
Alex ca4cc7e44f jepsen connects to vagrant vms 2023-10-18 12:03:11 +02:00
Alex 17ebb65273 jepsen ssh into containers seem to work ? 2023-10-18 12:03:11 +02:00
Alex 7011b71fbd jepsen: wip 2023-10-18 12:03:11 +02:00
Alex a5e8ffeb63 Merge pull request 'use mold linker when invoking cargo manually (not in nix build scripts)' (#646) from mold-linker into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #646
2023-10-18 10:02:34 +00:00
Alex b53510c5b7 Merge pull request 'fix compilation on macos' (#654) from trinity-1686a/garage:fix-macos-compilation into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #654
2023-10-16 09:33:33 +00:00
trinity-1686a c7f5dcd953 fix compilation on macos
continuous-integration/drone/pr Build is passing Details
fsblkcnt_t is ony 32b there, so we have to do an additional cast
2023-10-15 17:57:27 +02:00
Alex d8263fdf92 Merge pull request 'documentation updates for v0.9.0' (#647) from doc-updates into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #647
2023-10-11 12:57:37 +00:00
Alex d24aaba697 doc: update quick start and real world for v0.9.0
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-11 14:49:54 +02:00
Alex b571dcd811 doc: updates to the "migrating to v0.9" page
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-10 15:43:26 +02:00
Alex e6df7089a1 Merge pull request 'Garage v0.9' (#473) from next into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #473
2023-10-10 13:28:28 +00:00
Alex 952c9570c4 bump version to v0.9.0
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-10 14:08:11 +02:00
Alex 3d7892477d convert_db: fix build 2023-10-10 14:06:25 +02:00
Alex d4932c31ea Merge branch 'main' into next
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-10-10 13:57:21 +02:00
Alex d3fffd30dc use mold linker when invoking cargo manually (not in nix build scripts)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-10 13:56:48 +02:00
Alex e75fe2157d Merge pull request 'Move convert_db command into main garage binary' (#645) from convert-db-main-binary into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #645
2023-10-10 11:42:14 +00:00
Alex 2d5d7a7031 Move convert_db command into main garage binary
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-10 12:13:15 +02:00
Alex 0c431b0c03 admin api: increased compatibility for v0/ endpoints
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-05 16:56:13 +02:00
Alex 1c13135f25 admin api: remove broken GET /v0/key router rule
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-05 16:27:29 +02:00
Alex 2448eb7713 upgrade doc: fixes and precisions
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-05 15:29:55 +02:00
Alex 6790e24f5a Add migration to v0.9 guide
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-10-05 15:20:48 +02:00
Alex 9ccc1d6f4a move upgrade test to release build
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-05 10:42:10 +02:00
Alex 920dec393a cli: more precise doc comment
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-10-04 10:44:42 +02:00
Alex 2e656b541b Merge branch 'main' into next
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2023-10-03 18:40:37 +02:00
Alex 1243db87f2 Merge pull request 'Add support for binding to unix domain sockets' (#640) from networkException/garage:unix-sockets into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #640
2023-10-03 16:23:02 +00:00
networkException 6f8a87814b
doc: add documentation for specifying unix socket paths
continuous-integration/drone/pr Build is passing Details
2023-10-03 17:56:34 +02:00
networkException 7907a09acc
api: allow custom unix bind mode and use 0o220 for admin server 2023-10-03 17:31:40 +02:00
Alex 16aa418e47 Merge pull request 'doc: update endpoint_url documentation' (#641) from flokli/garage:aws-endpoint-url into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #641
2023-10-02 14:30:53 +00:00
Florian Klink cb359b4434 doc: update endpoint_url documentation
continuous-integration/drone/pr Build is passing Details
Since `awscli` `>=1.29.0` or `>=2.13.0` it is now possible to use the
`AWS_ENDPOINT_URL` environment variable, or the `endpoint_url` config
key to override the endpoint URL. This means, the aws bash function to
wrap with --endpoint-url is not necessary anymore. Update invocations to
reflect that.

https://docs.aws.amazon.com/sdkref/latest/guide/feature-ss-endpoints.html
https://github.com/aws/aws-cli/issues/4454#issuecomment-1626116607
2023-10-02 17:16:11 +03:00
networkException 8ec6a53b35
everywhere: support unix sockets when binding in various places
continuous-integration/drone/pr Build is passing Details
this patch implements binding to paths as a unix socket for generic
server and web server.
2023-09-29 18:57:44 +02:00
networkException 7353038a64
config: allow using paths for unix domain sockets in various places
this patch updates the config format to also allow paths in bind
addresses for unix domain sockets.

this has been added to all apis except rpc.
2023-09-29 18:38:30 +02:00
networkException 10195f1567
util: add helper sum type for unix and tcp socket addresses
this patch introduces a new sum type that can represent either a
tcp socket address or a unix domain socket path.
2023-09-29 18:37:36 +02:00
networkException 6086a3fa07
cargo: add hyperlocal as a dependency 2023-09-29 18:37:12 +02:00
Alex 9ac1d5be0e add upgrade test for garage 0.8 -> 0.9
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-27 14:57:37 +02:00
Alex 897cbf2c27 actually update rmp-serde to 1.1.2 for both garage and netapp dependency (fix #629)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build was killed Details
2023-09-27 13:13:00 +02:00
Alex ad82035b98 Merge branch 'main' into next 2023-09-27 13:11:52 +02:00
Alex aa7eadc799 Merge pull request 'New layout: fixes and UX improvements' (#634) from new-layout-ux into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #634
2023-09-27 09:04:32 +00:00
Alex 0e5925fff6 layout doc: reformulate
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-22 16:14:47 +02:00
Alex 8d07888fa2 layout doc: write explanations for bizarre scenarios
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-22 16:07:46 +02:00
Alex 405aa42b7d layout doc: update old text
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-09-22 10:06:31 +02:00
Alex b4a0e636d8 new layout doc: add examples of unexpected layout, to explain
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details
2023-09-22 09:49:07 +02:00
Alex 1d986bd889 Merge pull request 'Refactor db transactions and add on_commit for table.queue_insert' (#637) from k2v-indices-lmdb into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
Reviewed-on: #637
2023-09-21 14:03:35 +00:00
Alex 0635250b2b garage_table/queue_insert: delay worker notification to after transaction commit (fix #583)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-21 15:37:28 +02:00
Alex f97168f805 garage_db: refactor transactions and add on_commit mechanism 2023-09-21 15:35:31 +02:00
Alex 3ecc17f8c5 new layout: use deterministic randomness for reproducible results
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-21 11:21:35 +02:00
Alex 3a0e074047 Merge pull request 'prez-ocp' (#636) from prez-ocp into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #636
2023-09-21 08:15:10 +00:00
Alex 95ae09917b add ocp2023 presentation
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-19 14:02:07 +02:00
Alex a7ababb5db doc: update sticker
continuous-integration/drone/push Build is passing Details
2023-09-18 16:40:06 +02:00
Alex 013b026d56 update cargo.nix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-18 12:18:56 +02:00
Alex 0088599f52 new layout: fix clippy lints
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-09-18 12:17:07 +02:00
Alex 749b4865d0 new layout: improve display and fix comments
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-09-18 12:07:45 +02:00
Alex 015ccb39aa new layout: make zone_redundancy optionnal (if not set, is maximum)
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-09-18 11:59:08 +02:00
Alex 2e229d4430 new layout: improve output display
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build was killed Details
2023-09-12 17:24:51 +02:00
Alex be1a16b42b Merge pull request 'Fix multiple shutdown issues' (#633) from fix-shutdown into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #633
2023-09-12 12:54:50 +00:00
Alex 91e764a2bf fix hang on shutdown
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-12 14:35:48 +02:00
Alex aa79810596 Fix error when none of S3/K2V/WEB/ADMIN server is started (fix #613) 2023-09-12 14:35:19 +02:00
Alex fd7d8fec59 Merge branch 'main' into next
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build was killed Details
2023-09-11 23:09:20 +02:00
Alex 143a349f55 Merge pull request 'fix 32-bit build' (#632) from fix-32bit into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #632
2023-09-11 21:08:26 +00:00
Alex 9cfe55ab60 fix 32-bit build
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build was killed Details
continuous-integration/drone Build is passing Details
2023-09-11 20:01:29 +02:00
Alex 51abbb02d8 Merge branch 'main' into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-11 20:00:02 +02:00
Alex 2548a247f2 Merge pull request 'use statvfs instead of mount list to determine free data/meta space (fix #611)' (#631) from fix-free-space into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is failing Details
Reviewed-on: #631
2023-09-11 17:29:23 +00:00
Alex d5bb50d738 use statvfs instead of mount list to determine free data/meta space (fix #611)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
2023-09-11 19:08:24 +02:00
Alex fc635f7072 Merge pull request 'make lmdb's map_size configurable (fix #628)' (#630) from configurable-map-size into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #630
2023-09-11 16:48:14 +00:00
Alex f8b3883611 config: make block_size and sled_cache_capacity expressable as strings
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-11 18:34:59 +02:00
Alex 51b9731a08 make lmdb's map_size configurable (fix #628)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-11 18:03:44 +02:00
Alex ad6b1cc0be Merge branch 'main' into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-11 13:14:18 +02:00
Alex 7228fbfd4f Merge pull request 'multi-hdd support (fix #218)' (#625) from multihdd into next
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
Reviewed-on: #625
2023-09-11 10:52:01 +00:00
Alex ba7ac52c19 block repair: simpler/more robust iterator progress calculation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-11 12:31:34 +02:00
Alex 9526328d38 scrub: clear saved checkpoint when canceling scrub
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-11 12:10:48 +02:00
Alex 7f9ba49c71 block manager: remove data_dir field
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-11 11:57:36 +02:00
Alex de5d792181 block manager: fix indentation (why not detected by cargo fmt?)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-11 11:52:57 +02:00
Alex be91ef6294 block manager: fix bug where rebalance didn't delete old copies
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-07 16:04:03 +02:00
Alex 2657b5c1b9 block manager: fix bugs
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-07 15:30:56 +02:00
Alex eb972a8422 doc: update multi-hdd section
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-07 14:48:36 +02:00
Alex 2f112ac682 correct free data space accounting for multiple data dirs on same fs
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-07 14:42:20 +02:00
Alex 6a067e30ee doc: documentation of rebalance repair
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-07 13:49:12 +02:00
Alex 6b008b5bd3 block manager: add rebalance operation to rebalance multi-hdd setups 2023-09-07 13:44:11 +02:00
Alex 6595efd82f Document multi-hdd support
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-07 13:23:02 +02:00
Alex bca347a1e8 doc: update page on upgradin clusters 2023-09-07 12:52:44 +02:00
Alex 99ed18350f block manager: refactor and fix monitoring/statistics
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-07 12:41:36 +02:00
Alex f38a31b330 block manager: avoid incorrect data_dir configs and avoid losing files
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-09-06 17:49:30 +02:00
Alex e30865984a block manager: scrub checkpointing
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-06 16:35:28 +02:00
Alex 55c514999e block manager: fixes in layout 2023-09-06 16:35:28 +02:00
Alex a44f486931 block manager: refactoring & increase max worker count to 8 2023-09-06 16:35:28 +02:00
Alex 3a74844df0 block manager: fix dir_not_empty 2023-09-06 16:35:28 +02:00
Alex 93114a9747 block manager: refactoring 2023-09-06 16:35:28 +02:00
Alex fd00a47ddc table queue: increase batch size 2023-09-06 16:35:28 +02:00
Alex 1b8c265c14 block manager: get rid of check_block_status 2023-09-06 16:35:28 +02:00
Alex 3199cab4c8 update cargo.nix 2023-09-06 16:35:28 +02:00
Alex a09f86729c block manager: move blocks in write_block if necessary 2023-09-06 16:35:28 +02:00
Alex 887b3233f4 block manager: use data paths from layout 2023-09-06 16:35:28 +02:00
Alex 6c420c0880 block manager: multi-directory layout computation 2023-09-06 16:35:28 +02:00
Alex 71c0188055 block manager: skeleton for multi-hdd support 2023-09-06 16:35:28 +02:00
Alex 4b4f2000f4 lifecycle: fix SkipBucket bug
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build was killed Details
2023-09-06 16:34:07 +02:00
Alex 5f86b48f97 Merge pull request 'Revert netapp to 0.5.2 to avoid rmp-serde upgrade that breaks things' (#627) from hold-netapp-0.5.2 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #627
2023-09-05 22:08:40 +00:00
Alex 51eac97260 update version to 0.8.4
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is failing Details
2023-09-05 23:28:12 +02:00
Alex e78566591b Revert netapp update, hold to version 0.5.2 that uses rmp-serde 0.15
continuous-integration/drone/push Build is failing Details
2023-09-05 23:23:23 +02:00
Alex 3f461d8891 Merge pull request 'object lifecycles (fix #309)' (#620) from bucket-lifecycle into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
Reviewed-on: #620
2023-09-04 09:45:10 +00:00
Alex 8e0c020bb9 lifecycle worker: correct small clippy lints
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-09-04 11:33:44 +02:00
Alex 1cdc321e28 lifecycle worker: don't get stuck on non-existent bucket
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-31 11:36:30 +02:00
Alex f579d6d9b4 lifecycle worker: fix potential inifinite loop
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-31 11:29:54 +02:00
Alex a00a52633f lifecycle worker: add log message when starting
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-31 11:25:14 +02:00
Alex adbf5925de lifecycle worker: use queue_insert and process objects in batches
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-31 11:19:26 +02:00
Alex 1cfcc61de8 lifecycle worker: mitigate potential bugs + refactoring
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-31 00:28:37 +02:00
Alex be03a4610f s3api: remove redundant serde rename attribute
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-31 00:00:26 +02:00
Alex b2f679675e lifecycle worker: take into account disabled rules
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 23:52:09 +02:00
Alex 5fad4c4658 update cargo.nix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-30 23:47:42 +02:00
Alex 01c327a07a lifecycle worker: avoid building chrono's serde feature
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 23:46:15 +02:00
Alex f0a395e2e5 s3 bucket apis: remove redundant call
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 23:39:28 +02:00
Alex d94f1c9178 reference manual: remove obsolete caveat about multipart uploads
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 23:27:02 +02:00
Alex 5c923d48d7 reference manual: document support for lifecycle configuration
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 23:24:28 +02:00
Alex a1d57283c0 bucket_table: bucketparams::new doesn't need to be pub
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-30 20:07:14 +02:00
Alex d2e94e36d6 lifecycle config: add missing line in merge() and remove tracing
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 20:05:53 +02:00
Alex 75ccc5a95c lifecycle config: store date as given, try to debug
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 20:02:07 +02:00
Alex 7200954318 lifecycle worker: add logging
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-30 14:54:52 +02:00
Alex 0f1849e1ac lifecycle worker: launch with the rest of Garage
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-30 14:51:08 +02:00
Alex da8b224e24 lifecycle worker: skip entire bucket when no lifecycle config is set 2023-08-30 14:38:19 +02:00
Alex 2996dc875f lifecycle worker: implement main functionality
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-30 14:29:03 +02:00
Alex a2e0e34db5 lifecycle: skeleton for lifecycle worker
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-30 12:41:11 +02:00
Alex f7b409f114 use a NaiveDate in data model, it serializes to string (iso 8601 format)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-30 11:24:01 +02:00
Alex abf011c290 lifecycle: implement validation into garage's internal data structure
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-29 18:22:03 +02:00
Alex 8041d9a827 s3: add xml structures to serialize/deserialize lifecycle configs
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-29 17:44:17 +02:00
Alex 0b83e0558e bucket_table: data model for lifecycle configuration
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-29 17:00:41 +02:00
Alex 2e90e1c124 Merge branch 'main' into next
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build was killed Details
continuous-integration/drone Build is passing Details
2023-08-29 11:32:42 +02:00
Alex 32e5686ad8 Merge pull request 'Garage v0.8.3' (#619) from next-0.8 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #619
2023-08-29 08:55:46 +00:00
Alex 06369c8f4a add garage_db dependency in garage_rpc
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
2023-08-28 17:08:21 +02:00
Alex cece1be1bb bump version to 0.8.3
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2023-08-28 13:17:26 +02:00
Alex 769b6fe054 fix test_website_check_domain
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-28 12:40:28 +02:00
Alex e66c78d6ea integration test: move json_body to root of crate 2023-08-28 12:32:57 +02:00
Alex 51011e68b1 move alpine linux info to binary package page
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-08-28 12:20:34 +02:00
Alex a54a1f5616 Merge pull request 'doc: Add information about Alpine Linux package to Quick Start' (#564) from jirutka/garage:alpine into next-0.8
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
Reviewed-on: #564
2023-08-28 10:18:33 +00:00
Alex 9b4ce4a8ad admin api: refactor caddy check api code
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-08-28 12:17:10 +02:00
Alex 2bbe2da5ad Merge pull request 'support index on path missing a trailing slash' (#612) from compat/index-without-trailing-slash into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #612
2023-08-28 10:15:01 +00:00
Alex 29353adbe5 Merge pull request 'cargo: Bump dependencies' (#606) from jpds/garage:cargo-bumps-230801 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #606
2023-08-28 10:13:39 +00:00
Alex c5cafa0000 web_server.rs: handle error properly and refactor
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-28 12:05:14 +02:00
Alex 74478443ec update cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-08-28 11:31:40 +02:00
Jonathan Davies d66d81ae2d cargo: Updated gethostname v0.2.3 -> v0.4.3.
continuous-integration/drone/pr Build is failing Details
2023-08-28 09:30:27 +00:00
Jonathan Davies 7d8296ec59 cargo: Updated pretty_env_logger v0.4.0 -> v0.5.0. 2023-08-28 09:30:27 +00:00
Jonathan Davies f607ac6792 garage/api: cargo: Updated idna dependency to 0.4. 2023-08-28 09:30:27 +00:00
Jonathan Davies 96d1d81ab7 garage/db: cargo: Updated rusqlite to 0.29. 2023-08-28 09:30:27 +00:00
Jonathan Davies 5185701aa8 cargo: Updated:
* addr2line v0.19.0 -> v0.20.0
 * async-compression v0.4.0 -> v0.4.1
 * clap v4.3.8 -> v4.3.19
 * hyper v0.14.26 -> v0.14.27
 * ipnet v2.7.2 -> v2.8.0
 * rmp v0.8.11 -> v0.8.12
 * serde v1.0.164 -> v1.0.188
 * tokio v1.29.0 -> v1.31.0
 * zstd v0.12.3+zstd.1.5.2 -> v0.12.4
 * Others in `cargo update`
2023-08-28 09:30:27 +00:00
Alex d539a56d3a Merge pull request 'Support {s3,web}.root_domains for the Caddy on-demand TLS endpoint (<admin>/check?domain=xx)' (#610) from bug/support-root-domains-on-demand-tls into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #610
2023-08-28 09:18:13 +00:00
Alex bd50333ade Merge pull request 'reverse-proxy.md: Added caching section for Caddy.' (#614) from jpds/garage:caddy-cache into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #614
2023-08-28 08:51:33 +00:00
Alex 170c6a2eac Merge pull request 'backup.md: Added restic-android note.' (#616) from jpds/garage:doc-restic-android into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #616
2023-08-28 08:50:57 +00:00
Lapineige 47e7f9e122 another typo
continuous-integration/drone/pr Build is passing Details
2023-08-19 20:29:24 +00:00
Lapineige 5ffcdb4634 fix typo
continuous-integration/drone/pr Build is passing Details
2023-08-19 15:17:51 +00:00
Jonathan Davies 7f7d85654d backup.md: Added restic-android note.
continuous-integration/drone/pr Build is passing Details
2023-08-18 18:02:19 +01:00
Jonathan Davies 245a0882e1 reverse-proxy.md: Added caching section for Caddy.
continuous-integration/drone/pr Build is passing Details
2023-08-16 11:49:52 +01:00
Quentin 63da1d2443
support index on path missing a trailing slash
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-08-08 15:28:57 +02:00
Quentin 24e533f262
support {s3,web}.root_domains in /check endpoint
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-08-08 11:05:42 +02:00
Alex 67b1457c77 Merge pull request 'post_object.rs: Fixed typos / grammar.' (#607) from jpds/garage:post-objects-typos into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #607
2023-08-04 07:09:21 +00:00
Jonathan Davies 59bfc68f2e post_object.rs: Fixed typos / grammar.
continuous-integration/drone/pr Build is passing Details
2023-08-01 15:31:39 +01:00
Alex a98855157b Merge pull request 'operations/durability-repairs-md: Fix typo' (#604) from maxjustus/garage:main into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #604
2023-07-28 14:31:51 +00:00
Max Justus Spransy 4d7bbf7878 operations/durability-repairs-md: Fix typo
continuous-integration/drone/pr Build is passing Details
2023-07-24 10:01:48 -07:00
Alex 18eb73d52e Merge pull request 'flake-compat: use nix-community fork' (#599) from flokli/garage:flake-compat into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #599
2023-07-18 21:54:51 +00:00
Florian Klink 79ca8e76a4 nix/common.nix: use pattern from nix-community/flake-compat
continuous-integration/drone/pr Build is passing Details
This is still a bit confusing, as normally the flake.defaultNix attrset
gets exposed via a top-level default.nix, but at least it brings us
closer to that.
2023-07-16 12:52:14 +03:00
Florian Klink 1bbf604224 flake.nix: switch to nix-community/flake-compat
edolstra/flake-compat is unmaintained.

cargo2nix also still pulls in edolstra/flake-compat, make it follow the
nix-community one.
2023-07-16 12:40:47 +03:00
Alex 6ba611361e Merge pull request 'tree-wide: fix some typos' (#598) from flokli/garage:fix-typos into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #598
2023-07-14 15:51:44 +00:00
Florian Klink c855284760 src/util: fix typo
continuous-integration/drone/pr Build is passing Details
2023-07-14 14:25:40 +03:00
Florian Klink b1ca1784a1 src/garage/cli: fix typo 2023-07-14 14:25:33 +03:00
Florian Klink f0b7a0af3d doc/drafts: fix typo 2023-07-14 14:25:14 +03:00
Florian Klink 194549ca46 doc/book: fix typo 2023-07-14 14:24:40 +03:00
Florian Klink 202d3f0e3c doc/api: fix typo 2023-07-14 14:24:27 +03:00
Alex 7605d0cb11 Merge pull request 'cargo: tokio-1.29 and async-compression-0.4' (#593) from jpds/garage:tokio-1.29 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #593
2023-07-03 17:03:09 +00:00
Alex 031804171a Update Cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-07-03 11:33:36 +02:00
Jonathan Davies aee0d97f22 cargo: Updated async-compression to 0.4.
continuous-integration/drone/pr Build is failing Details
2023-06-28 11:17:16 +01:00
Jonathan Davies 098c388f1b cargo: Updated tokio to 1.29. 2023-06-28 11:16:41 +01:00
Alex e716320b0a Merge pull request 'cargo: roxmltree-0.18 and aws-sdk-s3-0.28 bump' (#591) from jpds/garage:roxmltree-0.18 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #591
2023-06-27 17:20:58 +00:00
Alex e466edbaec Merge pull request 'introduce dedicated return type for PollRange' (#590) from trinity-1686a/garage:k2v-client-poll-range-result into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #590
2023-06-27 08:28:26 +00:00
Alex 76355453dd Update Cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-06-27 10:23:02 +02:00
Alex ee494f5aa2 Merge pull request 'don't build sqlite by default' (#592) from trinity-1686a/garage:dont-build-sqlite into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #592
2023-06-27 08:14:38 +00:00
Jonathan Davies f31d98097a Cargo.lock: Updated.
continuous-integration/drone/pr Build is failing Details
2023-06-26 18:03:47 +01:00
Jonathan Davies a6da7e588f tests/bucket.rs: Adjusted as previously used function is now private. 2023-06-26 18:03:43 +01:00
trinity-1686a e5835704b7 don't build sqlite by default
continuous-integration/drone/pr Build is passing Details
`bundled-libs` is enabled by default, and causes sqlite to be built too,
even if the sqlite backend isn't enabled.
2023-06-26 11:15:11 +02:00
Jonathan Davies 7f8bf2d801 src/garage/tests: Updated types for aws-sdk-s3 bump. 2023-06-25 21:31:35 +01:00
Jonathan Davies 4297233d3e garage/Cargo.toml: Updated aws-sdk-s3 to 0.28, added aws-config. 2023-06-25 21:17:15 +01:00
Jonathan Davies b94ba47f29 api/Cargo.toml: Updated roxmltree to 0.18. 2023-06-24 14:15:26 +01:00
trinity-1686a 33b3cf8e22 introduce dedicated return type for PollRange
continuous-integration/drone/pr Build is passing Details
2023-06-24 10:17:20 +02:00
Alex 736083063f Merge pull request 'doc: Added ejabberd S3 section' (#588) from jpds/garage:doc-ejabberd-s3 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #588
2023-06-20 09:23:43 +00:00
Jonathan Davies a5ae566e0b apps/index.md: Fixed endpoint URL example.
continuous-integration/drone/pr Build is passing Details
2023-06-19 10:15:30 +01:00
Jonathan Davies 185f9e78f3 operations/durability-repairs.md: Added note about randomized scrub times. 2023-06-19 10:15:30 +01:00
Jonathan Davies fb971a5f01 cookbook/encryption.md: Added Cyberduck note. 2023-06-19 10:15:30 +01:00
Jonathan Davies 6af2cde23f cookbook/encryption.md: Added note on XMPP. 2023-06-19 10:15:30 +01:00
Jonathan Davies 97eb389274 docs/apps: Added ejabberd section. 2023-06-19 10:15:30 +01:00
Alex 8ef42c9609 admin docs: reformatting, key admin: add check
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-14 17:19:25 +02:00
Alex a83a092c03 admin: uniformize layout api and improve code 2023-06-14 17:12:37 +02:00
Alex 7895f99d3a admin and cli: hide secret keys unless asked
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-14 16:56:15 +02:00
Alex 4a82f6380e admin api: move all endpoints to v1/ by default (v0/ still supported)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-06-14 14:15:51 +02:00
Alex 28cc9f178a admin api: make name optionnal for CreateKey
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-14 13:56:37 +02:00
Alex 2c83006608 admin api: fix doc in drafts 2023-06-14 13:54:34 +02:00
Alex 35c108b85d admin api: switch GetClusterHealth to camelcase (fix #381 again)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-06-14 13:53:19 +02:00
Alex 52376d47ca admin api: change cluster status/layout to use lists and not maps (fix #377)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-06-14 13:45:27 +02:00
Alex 187240e539 Merge branch 'main' into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-14 13:02:46 +02:00
Alex 5e291c64b3 Merge pull request 'Documentation updates' (#587) from doc-updates into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #587
2023-06-14 10:57:32 +00:00
Alex 9092c71a01 doc: encryption organization
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-06-14 12:51:47 +02:00
Alex 120f8b3bfb doc: better doc on systemd's DynamicUser (fix #430)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-14 12:39:46 +02:00
Alex 39c3738a07 Add a page about encryption (fix #416) 2023-06-14 12:39:46 +02:00
Alex 7169ee6ee6 doc: reformulate in monitoring page 2023-06-14 12:39:46 +02:00
Alex dd7533a260 doc: add an operations&maintenance section and move some pages there 2023-06-14 12:39:40 +02:00
Alex 9233661967 Add documentation on durability and repair procedures (fix #219)
continuous-integration/drone/push Build is passing Details
2023-06-14 11:54:21 +02:00
Alex 3aadba724d doc: english improvement 2023-06-14 11:21:56 +02:00
Alex 5a186be363 Doc: update goals, add docker alias
continuous-integration/drone/push Build is passing Details
Fix #235
2023-06-14 11:09:31 +02:00
Alex 5670367126 multipartupload in test: add forgotten timestamp
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-13 23:10:46 +02:00
Alex cda957b4b1 update netapp's rmp-serde dependency to v1.1
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-13 17:34:49 +02:00
Alex 90b2d43eb4 Merge branch 'main' into next
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-13 17:14:11 +02:00
Alex 01346143ca Merge pull request 'Split src/garage/admin.rs into smaller files' (#586) from main-split-admin into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #586
2023-06-13 14:56:34 +00:00
Alex eb9cecf05c Split garage/admin.rs into smaller files
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-13 16:46:28 +02:00
Alex 802ed75721 move admin.rs to admin/mod.rs, before splitting 2023-06-13 16:42:14 +02:00
Alex bf19a44fd9 admin API: add missing camelCase conversions (fix #381)
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-13 16:15:50 +02:00
Alex 7126f3e1d1 garage key import: add checks and `--yes` CLI flag (fix #278)
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-13 15:56:48 +02:00
Alex fc29548933 Merge pull request 'fix timestamps wrapping around in `garage block list-errors` (fix #584)' (#585) from fix-future-timestamps into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #585
2023-06-13 12:51:16 +00:00
Alex 942c1f1bfe multipart uploads: save timestamp
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-13 10:48:22 +02:00
Alex 1ea4937c8b fix timestamps wrapping around in `garage block list-errors` (fix #584)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-06-12 20:07:33 +02:00
Alex 0a06fda0da Merge pull request 'Fix #204 (full Multipart Uploads semantics)' (#553) from nlnet-task1 into next
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
Reviewed-on: #553
2023-06-09 15:34:09 +00:00
Alex 3d477906d4 properly delete multipart uploads after completion
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-06-09 17:13:27 +02:00
Alex e645bbd3ce smoke test: add multipart upload test with part re-upload
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build was killed Details
2023-06-09 16:23:37 +02:00
Alex 58563ed700 Add multipart upload using aws s3api 2023-06-09 16:23:37 +02:00
Alex a6cc563bdd UploadPart: automatic cleanup of version (and reference blocked) when interrupted 2023-06-09 16:23:37 +02:00
Alex c14d3735e5 Add test for multipart uploads and fix part renumbering 2023-06-09 16:23:37 +02:00
Alex 53bf2f070c undo sort_key() returning Cow 2023-06-09 16:23:37 +02:00
Alex 412ab77b08 comments and clippy lint fixes 2023-06-09 16:23:37 +02:00
Alex 511e07ecd4 fix mpu counter (add missing workers) and report info at appropriate places 2023-06-09 16:23:37 +02:00
Alex 4ea53dc759 Add multipart upload repair 2023-06-09 16:23:37 +02:00
Alex 058518c22b refactor repair workers with a trait 2023-06-09 16:23:37 +02:00
Alex 8644376ac2 fix test; simplify code 2023-06-09 16:23:37 +02:00
Alex 7ad7dae5d4 fix s3 list test 2023-06-09 16:23:37 +02:00
Alex 75a0e01372 fix online repair 2023-06-09 16:23:37 +02:00
Alex bb176ebcb8 cargo fmt 2023-06-09 16:23:37 +02:00
Alex c1e1764f17 move git-version dependency to main crate to reduce rebuilds 2023-06-09 16:23:37 +02:00
Alex 87be8eeb93 updaet block admin for new multipartupload models 2023-06-09 16:23:37 +02:00
Alex 82e75c0e29 Adapt S3 API code to use new multipart upload models
- Create and PutPart
- completemultipartupload
- upload part copy
- list_parts
2023-06-09 16:23:37 +02:00
Alex 38d6ac4295 New multipart upload table layout 2023-06-09 16:23:37 +02:00
Alex 6005491cd8 Use Cow<[u8]> for sort keys 2023-06-09 16:23:37 +02:00
Alex ea3bfd2ab1 Minio tests for multipart upload behaviour:
- upload part renumbering test
- part skipping test
2023-06-09 16:23:37 +02:00
Alex e7e164a280 Make fsync an option for meta and data
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-06-09 16:23:21 +02:00
Alex 1e466b11eb Revert integration tests to using Sled as LMDB causes failures
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-06-09 13:23:08 +02:00
Alex 865f0c7d0c Add LMDB to debug builds
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-09 12:04:28 +02:00
Alex 906fe78b24 Integration tests: print logs when fails
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-09 12:03:44 +02:00
Alex 6aec73b641 Merge pull request 'payload.rs: Fixed two typoes' (#581) from jpds/garage:payload-typoes into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #581
2023-06-09 08:59:47 +00:00
Jonathan Davies 8a945ee996 payload.rs: Surround / in inverted commas.
continuous-integration/drone/pr Build is passing Details
2023-06-06 16:26:06 +01:00
Jonathan Davies 180992d0f1 payload.rs: Fixed typo in error message. 2023-06-06 16:25:29 +01:00
Alex 8a74e1c2bd Split garage/admin.rs into smaller files
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-06-06 15:39:15 +02:00
Alex 44548a9114 Merge pull request 'feature: Register consul services with agent API' (#567) from unrob/garage:roberto/consul-agent-registration into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #567
Reviewed-by: Alex <alex@adnab.me>
2023-06-02 14:35:00 +00:00
Roberto Hidalgo 32ad4538ee fix references to old config names
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2023-05-22 08:57:15 -06:00
Roberto Hidalgo ef8a7add08 set default for [consul-services] api 2023-05-22 08:57:15 -06:00
Roberto Hidalgo 2d46d24d06 update docs 2023-05-22 08:57:15 -06:00
Roberto Hidalgo b770504126 simplify code according to feedback 2023-05-22 08:57:15 -06:00
Roberto Hidalgo 6b69404f1a rename mode to consul_http_api 2023-05-22 08:57:15 -06:00
Roberto Hidalgo 011f473048 revert rpc/Cargo.toml 2023-05-22 08:57:15 -06:00
Roberto Hidalgo fd7dbea5b8 follow feedback, fold into existing feature 2023-05-22 08:57:15 -06:00
Roberto Hidalgo bd6485565e allow additional ServiceMeta, docs 2023-05-22 08:57:15 -06:00
Roberto Hidalgo 4d6e6fc155 cargo fmt 2023-05-22 08:57:15 -06:00
Roberto Hidalgo 02ba9016ab register consul services against local agent instead of catalog api 2023-05-22 08:57:15 -06:00
Alex 9d833bb7ef Merge pull request 'K2V-client improvements' (#577) from k2v-client-aws-sigv4 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #577
2023-05-22 09:03:08 +00:00
Alex c3d3b837eb bump k2v-client to v0.0.4
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-05-22 10:47:15 +02:00
Alex 130e01505b Fix k2v_client with unicode in partition keys 2023-05-22 10:45:09 +02:00
Alex e2ce5970c6 Add basic k2v_client integration tests 2023-05-22 10:45:06 +02:00
Alex 644e872264 Port k2v-client to aws-sigv4 since rusoto_signature is deprecated
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-05-19 12:08:29 +02:00
Alex 03efc191c1 Merge pull request 'K2V: double urlencoding' (#574) from fix-k2v-urlencoding into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #574
2023-05-18 09:33:03 +00:00
Alex 4420db7310 add tracing to k2v-client
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-05-18 11:18:21 +02:00
Alex 746b0090e4 k2v signature verification: double urlencoding (see comment in source code) 2023-05-18 11:18:06 +02:00
Alex c26a4308b4 Merge pull request 'Split format_table into separate crate and reduce k2v-client dependencies' (#572) from split-format-table into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #572
2023-05-17 12:33:45 +00:00
Alex 19639705e6 Mark sled as deprecated, make lmdb default, and improve sqlite and lmdb defaults
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-05-17 14:30:53 +02:00
Alex 217d429937 fix clippy lint in format-table crate
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-05-17 13:06:37 +02:00
Alex a1cec2cd60 Split format_table into separate crate and reduce k2v-client dependencies
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/tag Build was killed Details
continuous-integration/drone/pr Build was killed Details
2023-05-17 13:01:37 +02:00
Alex b66f247580 Merge pull request 'fixes to K2V client' (#571) from k2v-client-fixes into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #571
2023-05-16 20:20:31 +00:00
Alex 16f2a32bb7 cargo fmt
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-05-16 19:46:57 +02:00
Alex 472444ed8e k2v-client 0.0.2 2023-05-16 19:46:57 +02:00
Alex bb03805b58 k2v-cli: fix sort_key being partition_key and specify which key 2023-05-16 19:46:57 +02:00
Alex e4f955d672 fix base64 uses 2023-05-16 19:46:56 +02:00
Alex ea9b15f669 Merge pull request 'cargo: tokio-1.28 and hyper-0.14.26 update' (#569) from jpds/garage:tokio-1.28 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #569
2023-05-11 10:16:33 +00:00
Alex 2e6bb3f766 update Cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-05-11 11:34:18 +02:00
Alex 375270afd1 Merge pull request '*: apply clippy recommendations.' (#570) from jpds/garage:clippy-fixes into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #570
2023-05-11 09:33:03 +00:00
Jonathan Davies c783194e8b *: apply clippy recommendations.
continuous-integration/drone/pr Build is passing Details
2023-05-09 20:49:34 +01:00
Jonathan Davies fdcd7dee5a Cargo.lock: Updated for:
continuous-integration/drone/pr Build is failing Details
* tokio 1.28
 * hyper 0.14.26
2023-05-09 14:43:52 +01:00
Jonathan Davies 0f0795103d block/Cargo.toml: Bump tokio-util to 0.7. 2023-05-09 14:33:21 +01:00
Jonathan Davies c9d26e8c50 k2v-client/Cargo.toml: Make tokio dep match other packages. 2023-05-09 14:33:00 +01:00
Alex 351d734e6c Merge branch 'main' into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-05-09 12:40:08 +02:00
Alex b925f53dc3 Merge pull request 'move git-version dependency to main crate to reduce rebuilds' (#568) from move-git-version into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #568
2023-05-09 09:53:33 +00:00
Alex 2f495575d8 Merge pull request 'block/manager.rs: Prioritize raw blocks when no compression configured' (#566) from jpds/garage:skip-compressed-blocks-scrub-no-compression into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #566
2023-05-09 09:39:48 +00:00
Alex 9e0a9c1c15 move git-version dependency to main crate to reduce rebuilds
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-05-09 11:35:32 +02:00
Jonathan Davies 9c788059e2 block/manager.rs: In is_block_compressed - check which compression_level
continuous-integration/drone/pr Build is passing Details
is configured on a node and check for raw block first if compression is
disabled (to help reduce syscalls during a scrub).
2023-05-09 10:28:19 +01:00
Alex 5684e1990c Merge pull request 'Really allow to disable `sled` feature' (#563) from jirutka/garage:workspace-deps into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #563
2023-05-09 09:08:35 +00:00
Alex 14c50f2f84 Merge pull request 'Fix undefined macro warn! on 32-bit' (#562) from jirutka/garage:fix-undefined-warn into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #562
2023-05-09 08:52:11 +00:00
Alex 0fab9c3b8c Merge pull request 'Helm: Include newer config parameters as values' (#565) from jonatan/garage:main into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #565
2023-05-09 08:49:00 +00:00
Jakub Jirutka 75759a163c Allow to really disable sled feature
continuous-integration/drone/pr Build is passing Details
2023-05-09 08:46:15 +00:00
Jakub Jirutka d2deee0b8b Declare garage crates using workspace.dependencies
This will allow to really disable "sled" feature without declaring
`default-features = false` in every Cargo.toml where garage_db and
garage_model is used.

See https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
2023-05-09 08:46:15 +00:00
Alex 8499cd5c21 Merge pull request 'Remove unnecessary/unused "timeago" features' (#559) from jirutka/garage:timeago-features into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #559
2023-05-09 08:44:22 +00:00
Jonatan Steuernagel 4ea7983093
Helm: Increment patch version
continuous-integration/drone/pr Build is passing Details
2023-05-08 08:03:21 +02:00
Jonatan Steuernagel d5e39d11eb
Helm: Include newer config parameters as values
Add all missing parameters from the reference manual.
Primarily to enable the use of the new lmdb engine
2023-05-08 07:47:31 +02:00
Jakub Jirutka 06caa12d49 doc: Add information about Alpine Linux package to Quick Start
continuous-integration/drone/pr Build is passing Details
2023-05-07 19:28:43 +02:00
Jakub Jirutka 6d3ace1ea9 Fix undefined macro warn! on 32-bit
continuous-integration/drone/pr Build is passing Details
Compiling garage_db v0.8.2 (garage-0.8.2/src/db)
    error: cannot find macro `warn` in this scope
       --> src/db/lmdb_adapter.rs:352:2
        |
    352 |     warn!("LMDB is not recommended on 32-bit systems, database size will be limited");
        |     ^^^^
        |
        = help: consider importing this macro:
                tracing::warn
        = note: `warn` is in scope, but it is an attribute: `#[warn]`
    error: could not compile `garage_db` due to previous error
2023-05-07 17:01:44 +02:00
Jakub Jirutka 833cf082da Remove unnecessary/unused "timeago" features
continuous-integration/drone/pr Build is passing Details
To decrease dependency bloat and binary size.
2023-05-07 01:03:54 +02:00
Alex a1fcf1b175 Merge branch 'main' into next
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-04-25 16:58:57 +02:00
Alex 1ecd88c01f Merge pull request 'Update rust toolchain to 1.68 and simplify Nix stuff' (#554) from nix-update-simplify into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #554
2023-04-25 14:56:49 +00:00
Alex 5efcdc0de3 Update rust toolchain to 1.68 and simplify Nix stuff
continuous-integration/drone Build is passing Details
2023-04-25 14:46:47 +02:00
Alex fa78d806e3 Merge branch 'main' into next 2023-04-25 12:34:26 +02:00
Alex a16eb7e4b8 Merge pull request 'api/Cargo.toml: Bumped quick-xml to version 0.26.' (#552) from jpds/garage:quick-xml-0.26 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #552
2023-04-24 09:00:00 +00:00
Alex 6742070517 Merge pull request 'block/repair.rs: Added log entries for scrub start/finish.' (#551) from jpds/garage:scrub-log into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #551
2023-04-24 08:29:36 +00:00
Alex 6894878146 update cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-04-24 10:26:14 +02:00
Alex 02b0ba5f44 Merge pull request 'cookbook/real-world: fix typo' (#549) from yuka/garage:main into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #549
2023-04-24 08:24:55 +00:00
Jonathan Davies fb3bd11dce block/repair.rs: Added log entries for scrub start/finish.
continuous-integration/drone/pr Build is passing Details
2023-04-23 22:22:26 +01:00
Jonathan Davies c168383113 api/Cargo.toml: Bumped quick-xml to version 0.26.
continuous-integration/drone/pr Build is failing Details
2023-04-23 20:14:28 +01:00
yuka 04a0063df9 cookbook/real-world: fix typo
continuous-integration/drone/pr Build is passing Details
2023-04-21 16:46:58 +00:00
arthurlutz a2a35ac7a8 docs(book/quickstart): adapt aws s3 commands to example
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
Signed-off-by: arthurlutz <arthurlutz@noreply.localhost>
2023-04-03 06:18:28 +00:00
Alex f167310f42 Merge pull request 'Update Helm chart versions (app + chart)' (#535) from elwin013/garage:update-helm-chart-appVersion-to-0.8.2 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #535
2023-03-24 16:06:30 +00:00
Kamil Banach 66ed0bdd91
Update Helm chart versions (app + chart)
continuous-integration/drone/pr Build is passing Details
* chart version: 0.4.0
* app version: v0.8.2
2023-03-23 20:20:46 +01:00
Jonathan Davies 11b154b33b cli.md: Pointed Cyberduck profile at upstream link.
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-03-20 10:46:02 +00:00
Alex 703ac43f1c Merge pull request 'Prepare for v0.8.2' (#530) from prepare-v082 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #530
2023-03-13 18:34:33 +00:00
Alex 000006d689 obsolete clippy lints
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build was killed Details
2023-03-13 18:50:07 +01:00
Alex 0a1ddcf630 Prepare for v0.8.2
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2023-03-13 18:46:31 +01:00
Alex d6ffa57f40 Merge pull request 'Increase Garage tests robustness' (#526) from tests/increase-robustness into main
continuous-integration/drone/push Build is failing Details
Reviewed-on: #526
Reviewed-by: Alex <alex@adnab.me>
Reviewed-by: trinity-1686a <trinity.pointard@gmail.com>
2023-03-13 17:26:21 +00:00
Alex 7fcc153e7c Merge pull request 'rpc/system_metrics.rs: Added rustversion label to garage_build_info metric.' (#524) from jpds/garage:rustversion-label into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #524
2023-03-13 15:46:48 +00:00
Alex f37ec584b6 Merge branch 'main' into rustversion-label
continuous-integration/drone/pr Build is passing Details
2023-03-13 16:14:13 +01:00
Jonathan Davies dc6be39833 doc: cli.md: Added s5cmd example.
continuous-integration/drone/push Build is passing Details
2023-03-13 14:15:18 +00:00
Quentin 70b5424b99
use one key per context to isolate tests
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-03-13 15:06:05 +01:00
Quentin 2687fb7fa8
do not assume Garage boots in 2sec during tests 2023-03-13 15:06:05 +01:00
Alex 24e43f1aa0 Merge pull request 'Bump pnet_datalink 0.28 -> 0.33' (#514) from teutat3s/garage:pnet_datalink-0.33.0 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #514
2023-03-13 13:43:04 +00:00
teutat3s 8ad6efb338
Merge branch 'main' into pnet_datalink-0.33.0
continuous-integration/drone/pr Build is passing Details
2023-03-13 13:59:42 +01:00
Alex 3b498c7c47
update cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-03-13 13:59:02 +01:00
Alex 40fa1242f0 update cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-03-10 18:15:06 +01:00
Jonathan Davies 9ea154ae9c admin/cluster.rs: Added rust_version.
continuous-integration/drone/pr Build is failing Details
2023-03-10 14:46:54 +00:00
Jonathan Davies 4421378023 garage/admin.rs: Display Rust version in stats output. 2023-03-10 14:46:54 +00:00
Jonathan Davies 25f2a46fc3 rpc/system_metrics.rs: Added rustversion label to garage_build_info metric. 2023-03-10 14:46:44 +00:00
Alex 3325928c13 Merge pull request 'block/repair.rs: Added migration for ScrubWorkerPersisted's time_next_run_scrub.' (#523) from jpds/garage:migrate-scrubworkerpersisted into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #523
2023-03-10 13:25:01 +00:00
Jonathan Davies d218f475cb block/manager.rs: Set defaults for scrub_persister.
continuous-integration/drone/pr Build is passing Details
2023-03-09 17:08:47 +00:00
Jonathan Davies 7b65dd24e2 block/repair.rs: Added a timestamp argument to
continuous-integration/drone/pr Build is passing Details
randomize_next_scrub_run_time().
2023-03-09 16:38:41 +00:00
Jonathan Davies b70cc0a940 block/repair.rs: Added migration for ScrubWorkerPersisted's time_next_run_scrub.
Fixes: #520.
2023-03-09 16:38:36 +00:00
Alex 9e061d5a70 Merge pull request 'Update logo for stickers' (#521) from logo_autocollants into main
continuous-integration/drone/push Build was killed Details
Reviewed-on: #521
2023-03-08 13:14:46 +00:00
vincent db69267a56 MàJ logo pour autocollants
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2023-03-07 21:34:55 +01:00
Alex 2dc80abbb1 Merge pull request 'block/repair.rs: Added a random element of 10 days to SCRUB_INTERVAL' (#516) from jpds/garage:scrub-randomize-window into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #516
2023-03-06 14:11:25 +00:00
Jonathan Davies 148b66b843 block/manager.rs: Display scrub-next-run.
continuous-integration/drone/pr Build is passing Details
2023-03-06 13:43:09 +00:00
Jonathan Davies 53d09eb00f block/repair.rs: Added function and time_next_run_scrub with a random element of
10 days to SCRUB_INTERVAL to help balance scrub load across cluster.
2023-03-06 13:43:04 +00:00
Alex 00dcfc97a5 Merge pull request 'web_server.rs: Log X-Forwarded-For IP' (#504) from jpds/garage:web_server-log-x-forwarded-for into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #504
2023-03-06 12:33:06 +00:00
Jonathan Davies 4e0fc3d6c9 web/web_server.rs: Handle X-Forwarded-For here too.
continuous-integration/drone/pr Build is passing Details
2023-03-06 11:43:54 +00:00
Jonathan Davies e4e5196066 api/generic_server.rs: Use new handle_forwarded_for_headers() function. 2023-03-06 11:43:35 +00:00
Alex 0d0906b066 Merge pull request 'Clearer error message when LMDB has oom error (fix #517)' (#519) from lmdb-oom-message into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #519
2023-03-06 10:49:04 +00:00
Alex b8123fb6cd Clearer error message when LMDB has oom error (fix #517)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-03-06 11:38:49 +01:00
Alex 3d37be33a8 Merge pull request 'binary-packages.md: Added.' (#515) from jpds/garage:doc-binary-packages into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #515
2023-03-06 10:17:19 +00:00
Jonathan Davies ff70e09aa0 util/forwarded_headers.rs: Generalized handle_forwarded_for_headers()
here.
2023-03-03 19:17:40 +00:00
Jonathan Davies f056ad569d binary-packages.md: Added.
continuous-integration/drone/pr Build is passing Details
2023-03-03 18:52:49 +00:00
Alex a5f7a79250 Merge pull request 'Add documentation on community Ansible roles' (#513) from baptiste/garage:doc_ansible into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #513
2023-03-02 11:59:07 +00:00
Baptiste Jonglez 3b22da251d Add documentation on community Ansible roles
continuous-integration/drone/pr Build is passing Details
2023-03-01 09:24:13 +01:00
teutat3s f0717dd169
Bump pnet_datalink 0.28 -> 0.33
continuous-integration/drone/pr Build is failing Details
Motivation: building garage on illumos is only possible since
pnet_datalink version 0.30

Changelog: https://github.com/libpnet/libpnet/compare/v0.28.0...v0.33.0
2023-02-28 16:06:43 +01:00
Alex e818e39321 Merge pull request 'docs: fix k2v spec link' (#512) from wilson/garage:wilson/docs-k2v-link into main
continuous-integration/drone/push Build was killed Details
Reviewed-on: #512
2023-02-26 09:12:53 +00:00
wilson a15eb115c8 docs: fix k2v spec link
continuous-integration/drone/pr Build was killed Details
Signed-off-by: wilson <wilson@noreply.localhost>
2023-02-26 07:38:44 +00:00
Alex ae0934e018 Merge pull request 'reverse-proxy.md: Added healthcheck examples' (#505) from jpds/garage:doc-healthchecks into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #505
2023-02-15 15:13:04 +00:00
Jonathan Davies 6b8d634cc2 cookbook/reverse-proxy.md: Fixed up Traefik section:
continuous-integration/drone/pr Build is passing Details
* Renamed my_garage_service -> garage-s3-service.
 * Defined a web service for port 3902.
 * Added a garage-s3 router.
 * Pointed website definition at web service.
 * Use the /health endpoint for loadBalancer health check.
 * Renamed gzip_compress to just compression as traefik v3 will also do
   brotli compression.
2023-02-14 19:03:57 +00:00
Jonathan Davies ee88ccf2b2 cookbook/reverse-proxy.md: Document how to use healthchecks for caddy. 2023-02-14 18:39:05 +00:00
Jonathan Davies 4c143776bf backup.md: Added section for git-annex.
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build was killed Details
2023-02-08 22:54:56 +00:00
Alex 8b4d0adc75 Merge pull request 'generic_server.rs: Added support for logging X-Forwarded-For header.' (#500) from jpds/garage:generic_server-log-x-forwarded-for into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #500
2023-02-06 14:20:12 +00:00
Alex c2a9f00a58 Merge pull request 'upgrading.md: Added small note about garage_build_info.' (#501) from jpds/garage:doc-upgrade-buildinfo-metric into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #501
2023-02-06 14:20:00 +00:00
Alex d14678e0ac Merge pull request 'Secrets can be passed directly in config, as file, or as env' (#499) from config-files-env into main
continuous-integration/drone/push Build is failing Details
Reviewed-on: #499
2023-02-06 14:18:58 +00:00
Jonathan Davies 179fda9fb6 upgrading.md: Added small note about garage_build_info.
continuous-integration/drone/pr Build is passing Details
2023-02-06 12:53:55 +00:00
Alex 80e2326998 fixes for pr 499
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-02-06 12:23:55 +01:00
Jonathan Davies 94d70bec69 generic_server.rs: Added support for logging X-Forwarded-For header.
continuous-integration/drone/pr Build is passing Details
Fixes: #460
2023-02-04 15:19:21 +00:00
Alex 656b8d42de secrets can be passed directly in config, as file, or as env
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-02-03 15:27:39 +01:00
Alex fba8224cf0 Merge pull request 'error.rs: Corrected error message to say unexpected scope.' (#497) from jpds/garage:authorization-header-unexpected-scope into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #497
2023-02-03 13:22:40 +00:00
Jonathan Davies 1b6ec74748 error.rs: Corrected error messages to say unexpected scope. 2023-02-02 16:20:31 +00:00
Alex 30f1636a00 Merge pull request 'Documentation updates' (#496) from doc-mention-talks into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #496
2023-01-30 17:58:05 +00:00
Alex 8013a5cd58 Change talk links more
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-30 18:51:48 +01:00
Alex 2ba9463a8a Raw links to presentations
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build was killed Details
2023-01-30 18:48:00 +01:00
Alex 7f715ba94f zero-downtime migration procedure
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build was killed Details
2023-01-30 18:41:04 +01:00
Alex 44f8b1d71a Reorder reference manual section, move metrics list to there 2023-01-30 18:00:01 +01:00
Alex 56384677fa Add links to presentations
continuous-integration/drone/push Build is passing Details
2023-01-30 17:48:36 +01:00
Alex 4cff37397f Merge pull request 'Small doc corrections' (#489) from jpds/garage:doc-corrections into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #489
2023-01-30 16:35:30 +00:00
Jonathan Davies 5f412abd4e cookbook/reverse-proxy.md: Added on-demand TLS section.
continuous-integration/drone/pr Build is passing Details
2023-01-30 14:37:55 +00:00
Jonathan Davies c753a9dfb6 cookbook/monitoring.md: Added new metrics (garage_build_info,
garage_replication_factor, block_compression_level).
2023-01-30 12:54:42 +00:00
Jonathan Davies ae9c7a2900 cookbook/_index.md: Added link to monitoring documentation. 2023-01-30 12:54:42 +00:00
Jonathan Davies 7ab27f84b8 configuration.md: Corrected OpenTelemetry. 2023-01-30 12:54:42 +00:00
Jonathan Davies 55c369137d gateways.md: -z is a required flag for layout assign. 2023-01-30 12:54:38 +00:00
Alex a1005c26b6 Merge pull request 'Cargo.lock: Bump for tokio 1.25.0.' (#494) from jpds/garage:cargo-update-tokio-1.25.0 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #494
2023-01-30 11:41:46 +00:00
Alex f9573b6912 Merge pull request 'Fix duplicated content-type in error document' (#493) from baptiste/garage:fix_error_document_content_type into main
continuous-integration/drone/push Build is failing Details
Reviewed-on: #493
2023-01-30 10:56:35 +00:00
Alex 4d3a5f29e0 Merge pull request 'api_server.rs: Adapted to use query string per Caddy upstream change' (#491) from jpds/garage:fix-caddy-ask-domain-query-string into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #491
2023-01-30 10:50:47 +00:00
Alex e2173d00a9 Update cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-01-30 11:47:34 +01:00
Jonathan Davies 9e0567dce4 Cargo.lock: Bump for tokio 1.25.0.
continuous-integration/drone/pr Build is failing Details
2023-01-30 00:14:03 +00:00
Baptiste Jonglez e85a200189 Fix duplicated content-type in error document
continuous-integration/drone/pr Build is passing Details
Fixes #492
2023-01-29 22:51:23 +01:00
Jonathan Davies 9c354f0a8f Improved bucket authorization response strings.
continuous-integration/drone/pr Build is passing Details
2023-01-29 20:34:41 +00:00
Jonathan Davies 004bb5b4f1 api_server.rs: Adapted to use query string per Caddy upstream change. 2023-01-29 20:34:37 +00:00
Jonathan Davies 0c618f8a89 reverse-proxy.md: Corrected web server ports in Caddy example. 2023-01-27 17:52:51 +00:00
maximilien df30f3df4b Merge pull request 'helm chart improvements' (#425) from patrickjahns/garage:helm-improvements into main
continuous-integration/drone/push Build is failing Details
Reviewed-on: #425
2023-01-27 10:51:04 +00:00
Patrick Jahns 50bce43f25
refactor(helm): use stable as image tag for init container
continuous-integration/drone/pr Build is passing Details
2023-01-27 00:08:33 +01:00
Patrick Jahns ac6751f509
doc(helm): removed extra line 2023-01-27 00:08:33 +01:00
Patrick Jahns b999bb36af
feat(helm): ability to monitor garage via prometheus 2023-01-27 00:08:33 +01:00
Patrick Jahns d20e8c9256
feat(helm): allow to override the init container image 2023-01-27 00:08:32 +01:00
Patrick Jahns fd03b184b3
fix(helm): file permission issues when running as non-root user
Specify the user group for the garage (and init) process and ensure
that the persistent storage is mounted with the correct file system
group
2023-01-27 00:08:32 +01:00
Patrick Jahns da6f7b0dda
feat(helm): ensure that config changes trigger a pod rollout 2023-01-27 00:08:32 +01:00
Patrick Jahns e17970773a
refactor(helm): removed metadataDir and dataDir config variable
The variables were only templated into the configuration file and
did not change the pod mountpaths, so the variables were not necessary
2023-01-27 00:08:32 +01:00
Patrick Jahns 88b66c69a5
feat(helm): allow to override the default configuration file
Signed-off-by: Patrick Jahns <kontakt@patrickjahns.de>
2023-01-27 00:08:31 +01:00
Alex f2c256cac4 Merge pull request 'Many clippy lints fixed' (#488) from k2v-watch-range-2 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #488
2023-01-26 21:10:21 +00:00
Alex a08e01f17a Merge pull request 'Enable daemonset deployment using the helm chart' (#409) from kaiyou/garage:feat-k8s-daemonset into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #409
2023-01-26 21:07:58 +00:00
Alex d6af95d205 fix cli display bug
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-26 17:50:50 +01:00
Alex c56794655e Fix fmt
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-26 17:27:03 +01:00
Alex 8e93d69974 More clippy fixes
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-01-26 17:26:32 +01:00
Alex 246f7468cd Merge pull request 'K2V PollRange, version 2' (#471) from k2v-watch-range-2 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #471
2023-01-26 16:19:04 +00:00
Alex 3113f6b5f2 more fixes 2023-01-26 17:14:17 +01:00
Alex 1dff62564f fix clippy
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-26 17:05:31 +01:00
Alex 590a0a8450 Merge branch 'main' into k2v-watch-range-2
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is failing Details
2023-01-26 16:46:40 +01:00
Alex 611792ddcf Merge pull request 'Report available disk space in `garage stats`' (#487) from report-disk-usage into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #487
2023-01-26 15:40:41 +00:00
Alex 94d559ae00 Merge branch 'main' into report-disk-usage
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-26 16:20:41 +01:00
Alex 5fb383fe4c Merge pull request 'cargo: Bump dependencies to latest version' (#484) from jpds/garage:cargo-bumps into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #484
2023-01-26 15:17:09 +00:00
Alex 654999e254 Update Cargo.nix
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-01-26 15:50:54 +01:00
Alex 0da054194b Update Cargo.nix
continuous-integration/drone/pr Build is passing Details
2023-01-26 14:47:15 +00:00
Alex c7d0ad0aa0 Add local disk usage to exported prometheus metrics
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-26 15:30:36 +01:00
Alex efb6b6e868 Disk space report
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
Report available disk space on nodes and calculate cluster-wide available space in `garage stats` (fix #479)
2023-01-26 15:04:32 +01:00
Alex f251b4721f Apply nixfmt to all .nix files; fix devshell and add it to cache
continuous-integration/drone/push Build is passing Details
2023-01-26 12:25:48 +01:00
Jonathan Davies 3dc655095f db/Cargo.toml: Updated rusqlite from 0.27 to 0.28.
continuous-integration/drone/pr Build is failing Details
2023-01-26 11:13:11 +00:00
Jonathan Davies 20c1cdf662 Cargo.toml: Loosen tracing dependency to just 0.1. 2023-01-26 11:13:11 +00:00
Jonathan Davies f952e37ba7 {model,util}/Cargo.toml: Updated blake2 from 0.9 to 0.10. 2023-01-26 11:13:11 +00:00
Jonathan Davies fbafa76284 {db,util}/Cargo.toml: Updated mktemp from 0.4 to 0.5. 2023-01-26 11:13:11 +00:00
Jonathan Davies 63e22e71f2 api/Cargo.toml: Updated idna from 0.2 to 0.3. 2023-01-26 11:13:11 +00:00
Jonathan Davies f6eaf3661c garage/Cargo.toml: Updated timeage from 0.3 to 0.4. 2023-01-26 11:13:11 +00:00
Jonathan Davies d3b2a68988 {garage,util}/Cargo.toml: Updated toml from 0.5 to 0.6. 2023-01-26 11:13:11 +00:00
Jonathan Davies b4a1a6a32f util/time.rs: Updated deprecated associated function to timestamp_opt(). 2023-01-26 11:13:11 +00:00
Jonathan Davies bcac889f9a Cargo.toml: Updated clap from 3.1.18 to 4.1. 2023-01-26 11:13:11 +00:00
Jonathan Davies 9e08a05e69 k2v-client/Cargo.toml: Loosen dependencies. 2023-01-26 11:13:11 +00:00
Jonathan Davies 69497be5c6 Cargo.lock: Ran cargo update. 2023-01-26 11:13:11 +00:00
Jonathan Davies 36944f1839 Cargo.toml: Updated base64 from 0.13 to 0.21. 2023-01-26 11:13:07 +00:00
Jonathan Davies db56d4658f util/Cargo.toml: Updated rmp-serde from 0.15 to 1.1.
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-01-26 11:03:43 +00:00
Alex 1311742fe0 Merge pull request 'cookbook/real-world.md: Added note about mesh network options.' (#485) from jpds/garage:mesh-networks-note into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #485
2023-01-26 10:31:43 +00:00
Jonathan Davies f2492107d7 cookbook/real-world.md: Added note about mesh network options.
continuous-integration/drone/pr Build was killed Details
2023-01-25 12:00:01 +00:00
Jonathan Davies 93c3f8fc8c api/Cargo.toml: Updated url from 2.1 to 2.3. 2023-01-23 19:16:58 +00:00
Jonathan Davies 1c435fce09 api/Cargo.toml: Updated httpdate from 0.3 to 1.0. 2023-01-23 19:16:54 +00:00
Jonathan Davies dead123892 api/Cargo.toml: Updated pin-project to 1.0.12. 2023-01-23 18:39:35 +00:00
Jonathan Davies 5c3075fe01 Cargo.toml: Updated zstd from 0.9 to 0.12. 2023-01-23 18:08:14 +00:00
Alex 9adf5ca76d Merge pull request 'Add talk made on 2023-01-18' (#482) from talk-tocatta-2023-01-18 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #482
2023-01-20 11:40:08 +00:00
Alex 18bf45061a Merge pull request 'doc: Added observability.md.' (#477) from jpds/garage:observability-doc into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #477
2023-01-19 12:34:14 +00:00
Alex aff9c264c8 Merge pull request 'Implemented website hosting authorization endpoint.' (#474) from jpds/garage:bucket-serving-validator into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #474
2023-01-19 12:33:16 +00:00
Alex 3250be7c48 Update tocatta talk, add talks shell.nix and .envrc
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-18 15:25:04 +01:00
Mike Coleman fcc5033466 Change some integer types to int64
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
Modified integer types representing byte or object count to int64 to prevent overflow.
2023-01-16 23:57:23 -08:00
Jonathan Davies 97bb110219 doc: Added observability.md.
continuous-integration/drone/pr Build is passing Details
2023-01-13 14:32:10 +00:00
Alex 0010f705ef
Talk for 2023-01-18 pretty much finished
continuous-integration/drone/push Build is passing Details
2023-01-13 15:28:17 +01:00
Alex 065d6e1e06
Talk about K2V specifics
continuous-integration/drone/push Build is passing Details
2023-01-13 13:51:39 +01:00
Alex d44e8366e7
Reorder and add a hard problem
continuous-integration/drone/push Build is passing Details
2023-01-13 13:16:55 +01:00
Alex cbb522e179
Different lattice figures
continuous-integration/drone/push Build is passing Details
2023-01-13 12:33:27 +01:00
Alex f5746a46f9 Merge pull request 'Add docs about running pict-rs with garage' (#475) from kaiyou/garage:docs-apps into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #475
2023-01-13 10:45:29 +00:00
Jonathan Davies 4962b88f8b tests/s3/website.rs: Added website hosting authorization check tests.
continuous-integration/drone/pr Build is passing Details
2023-01-13 09:39:02 +00:00
Jonathan Davies 100b01e859 Implemented website hosting authorization endpoint.
Fixes: #468
2023-01-13 09:38:58 +00:00
kaiyou 9bf94faaa1 Add docs about running pict-rs with garage
continuous-integration/drone/pr Build is passing Details
2023-01-12 20:46:17 +01:00
Alex 1f5e3aaf8e
Add explanations about quorums
continuous-integration/drone/push Build is passing Details
2023-01-12 17:39:12 +01:00
Alex f5a7bc3736
Add 12 lattice diagrams to explain CRDTs and quorums
continuous-integration/drone/push Build is passing Details
2023-01-12 17:17:13 +01:00
Alex fe850f62c9
Talk 2023-01-18: some WIP talking about consensus
continuous-integration/drone/push Build is passing Details
2023-01-12 16:27:02 +01:00
Alex 7416ba97ef
Talk 2023-01-18 WIP
continuous-integration/drone/push Build is passing Details
2023-01-12 13:25:09 +01:00
Alex 12a4e1f303
Merge branch 'optimal-layout' into next
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-01-11 17:50:42 +01:00
Alex 84b4a868e3
Migration of cluster layout from v0.8 to v0.9
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2023-01-11 17:47:46 +01:00
Alex dac254a6e7
Merge branch 'main' into k2v-watch-range-2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-11 17:09:37 +01:00
Alex 4f409f73dc Merge pull request 'Changed all instances of assignation to assignment' (#465) from jpds/garage:assignments-correction into next
continuous-integration/drone/push Build is passing Details
Reviewed-on: #465
2023-01-11 16:05:27 +00:00
Alex 94d723f27c Merge pull request 'Implement `rpc_secret_file`' (#466) from felix.scheinost/garage:feature/implement-rpc-secret-file into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #466
2023-01-11 16:04:35 +00:00
Alex be6b8f419d Merge pull request 'Implemented system metrics' (#472) from jpds/garage:system-metrics into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #472
Reviewed-by: Alex <alex@adnab.me>
2023-01-11 16:00:31 +00:00
Alex 638c5a3ce0
PollRange: add extra RPC delay after quorum is achieved,
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
to give a chance to the 3rd node to respond
2023-01-11 16:12:07 +01:00
Alex 399f137fd0
add precision in pollrange doc
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-11 15:19:51 +01:00
Alex 5b5ca63cf6
Poll cleanup
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-11 15:17:27 +01:00
Alex cbfae673e8
PollRange & PollItem: min timeout = 1 sec
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-11 15:03:08 +01:00
Alex bba13f40fc
Correctly return bad requests when seeh marker is invalid
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build was killed Details
2023-01-11 12:27:19 +01:00
Alex ba384e61c0
PollRange: return immediately if no seen marker is provided
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-11 12:03:17 +01:00
Alex 09a3dad0f2
Lock once for insert_many
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-11 11:35:36 +01:00
Alex 32aab06929
k2v-client libary poll_range and CLI poll-range
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-11 11:14:29 +01:00
Alex de1111076b
PollRange integration test
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-11 10:04:41 +01:00
Alex b83517d521
Implement PollRange API endpoint
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-10 15:22:25 +01:00
Alex 57eabe7879
Add proposal spec for PollRange API endpoint
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build was killed Details
2023-01-10 15:22:11 +01:00
Alex 43fd6c1526
PollRange RPC
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-10 12:54:24 +01:00
Alex 789540ca37
Type definition for range seen marker
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-10 11:59:57 +01:00
Jonathan Davies 4cfb469d2b block/metrics.rs: Added compression_level metric.
continuous-integration/drone/pr Build is passing Details
2023-01-10 10:40:03 +00:00
Jonathan Davies df1d9a9873 system.rs: Integrated SystemMetrics into System implementation. 2023-01-10 10:39:50 +00:00
Jonathan Davies aac348fe93 Added system_metrics.rs file. 2023-01-10 10:38:50 +00:00
Alex 9f5419f465
Make K2V item timestamps globally increasing on each node
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-10 11:03:52 +01:00
Alex a48e2e0cb2
K2V: Subscription to ranges of items
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-10 10:30:59 +01:00
Mendes 597d64b31a change in gitignore
continuous-integration/drone/push Build is passing Details
2023-01-09 16:06:47 +01:00
Mendes e3cc7a89b0 First draft of t a preprint describing the layout computation algorithm
continuous-integration/drone/push Build is passing Details
2023-01-09 16:05:20 +01:00
Felix Scheinost d6ea0cbefa Add tests for `rpc_secret_file`
continuous-integration/drone/pr Build is passing Details
2023-01-07 14:19:36 +01:00
Felix Scheinost 7b62fe3f0b Error on both `rpc_secret` and `rpc_secret_file` 2023-01-07 13:49:03 +01:00
Jonathan Davies cb07e6145c Changed all instances of assignation to assignment.
continuous-integration/drone/pr Build is passing Details
2023-01-05 11:09:25 +00:00
Felix Scheinost f2106c2733 Implement `rpc_secret_file`
continuous-integration/drone/pr Build is passing Details
2023-01-04 18:35:10 +01:00
Alex 02e8eb167e Merge pull request 'PutObject: better cleanup when request is interrupted in the middle' (#462) from interrupted-cleanup into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #462
2023-01-04 14:43:45 +00:00
Alex 329c0e64f9 Merge pull request 'Improve `garage worker set` and add `garage worker get`' (#464) from worker-get into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #464
2023-01-04 13:47:42 +00:00
Alex 29dbcb8278
bg var operation on all nodes at once
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-04 13:25:57 +01:00
Alex f3f27293df
Uniform framework for bg variable management
continuous-integration/drone/push Build is passing Details
2023-01-04 13:07:13 +01:00
Alex 13c5549886
Remove token_bucket.rs 2023-01-04 11:47:56 +01:00
Alex 80e4abb98d Merge pull request 'Changed all instances of 'key new' to 'key create' to make it the same as the bucket commands.' (#459) from jpds/garage:key-create-standardize into next
continuous-integration/drone/push Build is passing Details
Reviewed-on: #459
2023-01-04 10:35:49 +00:00
Alex 570e5e5bbb
Merge branch 'main' into next
continuous-integration/drone/push Build is passing Details
2023-01-04 11:34:43 +01:00
Alex 936b6cb563
When saving block, delete .tmp file if we could not complete
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2023-01-03 17:34:26 +01:00
Alex 0650a43cf1
PutObject: better cleanup on Drop (incl. when request is interrupted in the middle)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-03 17:05:17 +01:00
Alex 4eb8ca3a52 Merge pull request 'Fix Consul & Kubernetes discovery with new way of doing background things' (#463) from fix-background into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #463
2023-01-03 16:04:40 +00:00
Alex 1fc220886a
Fix Consul & Kubernetes discovery with new way of doing background things
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-03 16:55:59 +01:00
Alex 73ed9c7403 Merge pull request 'Refactor how things are migrated' (#461) from format-migration into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is failing Details
Reviewed-on: #461
2023-01-03 15:28:24 +00:00
Alex 1d5bdc17a4
use impossible enum type
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-03 16:04:06 +01:00
Alex c106304b9c
more idiomatic and shorter
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-03 16:00:19 +01:00
Alex 33f25d26c7
fix doc and add tests for migrate.rs
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-03 15:53:13 +01:00
Alex d6d571d512
cargo fmt
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build was killed Details
2023-01-03 15:30:21 +01:00
Alex a54b67740d
move debug_serialize to garage_util::encode
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-01-03 15:29:29 +01:00
Alex 8d5505514f
Make it explicit when using nonversioned encoding
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-03 15:27:36 +01:00
Alex 426d8784da
cleanup
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-03 15:08:37 +01:00
Alex a81200d345
Update cargo.nix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-03 14:45:47 +01:00
Alex cdb2a591e9
Refactor how things are migrated
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2023-01-03 14:44:47 +01:00
Alex 582b076179 Merge pull request 'Some improvements to Garage internals' (#451) from internals-rework into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #451
2023-01-03 11:37:31 +00:00
Jonathan Davies 8be862aa19 Changed all instances of 'key new' to 'key create' to make it consistent as bucket commands issued normally around the same time.
continuous-integration/drone/pr Build is passing Details
2023-01-03 11:11:12 +00:00
Alex 939a6d67e8
Merge branch 'main' into internals-rework
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-02 15:07:44 +01:00
Alex 76230f2028 Merge pull request 'Bump everything to v0.8.1' (#458) from up-v0.8.1 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #458
2023-01-02 13:32:45 +00:00
Alex 6775569525
Bump everything to v0.8.1
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2023-01-02 14:15:33 +01:00
Alex 6b857a9b8c
cargo fmt
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2023-01-02 13:50:42 +01:00
Alex 1649002e2b Merge pull request 'Add a note about Peertube 5.0 private videos' (#456) from kaiyou/garage:docs-apps into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #456
2023-01-02 12:49:14 +00:00
Alex 822e344845 Merge pull request 'Add some docs about using Python Minio SDK' (#455) from kaiyou/garage:docs-s3-libs into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #455
2023-01-02 12:48:52 +00:00
Alex 7f7d53cfa9 Merge pull request 'improvements to CLI and new debug features' (#448) from cli-improvements into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #448
2023-01-02 12:42:24 +00:00
kaiyou fd10200bec Add a note about Peertube 5.0 private videos
continuous-integration/drone/pr Build is passing Details
2022-12-25 14:20:01 +01:00
kaiyou 0c7ed0b0af Add some docs about using Python Minio SDK
continuous-integration/drone/pr Build is passing Details
2022-12-25 13:55:12 +01:00
kaiyou 559e924cc2 Bump the helm chart version
continuous-integration/drone/pr Build is passing Details
2022-12-25 13:33:44 +01:00
kaiyou e852c91d18 Fix documentation based on new deployment values
continuous-integration/drone/pr Build was killed Details
2022-12-25 13:30:14 +01:00
kaiyou e9b0068079 Set hostPath type for volumes 2022-12-25 13:30:14 +01:00
kaiyou 49a138b670 Fix volume handling and persistence flag 2022-12-25 13:30:14 +01:00
kaiyou e94d6f78d7 Enable daemonset deployment using the helm chart
DaemonSet is a k8s resource that schedules one instance per node,
which is useful for some garage deployment use cases, including
managing garage nodes using k8s node labels
2022-12-25 13:30:14 +01:00
Alex 1af4a5ed56 Merge pull request 'Fix router keyword handling (fix #442)' (#446) from router-keywords-fix into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #446
2022-12-15 08:40:26 +00:00
Alex 1fcd0b371b
online repair workers: retry on error
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-12-14 16:31:31 +01:00
Alex 13c8662126
factorize
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-14 16:16:55 +01:00
Alex e6f14ab5cf
better error message handling
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-14 16:11:19 +01:00
Alex 510b620108
Get rid of background::spawn
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-14 16:08:05 +01:00
Alex dfc131850a
Simplified and more aggressive worker exit logic
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-12-14 15:25:29 +01:00
Alex d4af27f920
Add missing notify
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-14 13:54:21 +01:00
Alex 0d6b05bb6c
Update cargo.nix
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-12-14 12:58:24 +01:00
Alex a19bfef508
Improve error message on rpc connection failure
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-12-14 12:57:33 +01:00
Alex d56c472712
Refactor background runner and get rid of job worker
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-12-14 12:51:42 +01:00
Alex 2183518edc
Spawn all background workers in a separate step 2022-12-14 12:28:07 +01:00
Alex 83c8467e23
Proper queueing for delayed inserts, now backed to disk
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-12-14 11:58:06 +01:00
Alex f8e528c15d
Small refactor of tables internals
continuous-integration/drone/push Build is failing Details
2022-12-14 10:48:49 +01:00
Alex d1279e04f3
Fix error messages
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-13 16:18:01 +01:00
Alex 041b60ed1d
Add block.rc_size, table.size and table.merkle_tree_size metrics
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build was killed Details
2022-12-13 15:54:03 +01:00
Alex f8d5409894
cli: more info displayed on error in garage stats
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-12-13 15:46:04 +01:00
Alex d6040e32a6
cli: prettier table in garage stats
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build was killed Details
2022-12-13 15:43:22 +01:00
Alex d7f90cabb0
Implement `block retry-now` and `block purge`
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build was killed Details
2022-12-13 15:02:42 +01:00
Alex 687660b27f
Implement `block list-errors` and `block info`
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-12-13 14:23:45 +01:00
Alex 9d82196945
cli: new worker info command
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-13 12:24:30 +01:00
Alex a51e8d94c6
cli: rename resync-n-workers into resync-worker-count
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-12-13 11:44:11 +01:00
Alex de9d6cddf7
Prettier worker list table; remove useless CLI log messages
continuous-integration/drone/push Build is passing Details
2022-12-12 17:17:05 +01:00
Alex f7c65e830e Merge pull request 'Properly enforce allow_create_bucket' (#447) from fix-allow-create-bucket into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #447
2022-12-12 14:55:12 +00:00
Alex 0e61e3b6fb
Fix bucket creation tests to take permissions into account
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-12 15:47:55 +01:00
Alex a0abf41762
Fix router keyword handling (fix #442)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-12-12 12:05:37 +01:00
Alex 2ac75018a1
Properly enforce allow_create_bucket
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-12-12 12:03:54 +01:00
Maximilien R 980572a887 Merge pull request 'helm: ingress improvements' (#422) from patrickjahns:helm-refactor-ingress into main
continuous-integration/drone/push Build is passing Details
As discussed in the chat yesterday, I want to propose to disable the ingress per default.

The motivation behind this change is, that per default the ingress is "misconfigured"
meaning it can not work with the default values and requires a user of the chart to
add additional configuration. When installing the chart per default, I would not
expect to already expose garage publicly without my explicit configuration to do so

Commenting the ingressClass resource also allows for relying only on
annotations - otherwise the ingressClass would be always set to nginx
or require a user to override it with ingressClass: null

A small change on top, I've added the ability to specify user defined labels per ingress
2022-12-12 00:53:57 +01:00
Patrick Jahns 7a0014b6f7 chore(helm): bump chart number 2022-12-11 23:11:56 +00:00
Patrick Jahns edb0b9c1ee feat(helm): allow to add custom labels to created ingress resources 2022-12-11 23:11:56 +00:00
Patrick Jahns f58a813a36 refactor(helm): disable the ingress per default
The default values forces people to create an ingress resources,
where per default an ingress is not necessary to start garage.

If someone wants to utilize an ingress, he would need to define
the values for the ingress either way, so enabling the ingress
explicitly makes more sense, then requiring it to be disabled per default
2022-12-11 23:11:56 +00:00
Alex 6e44369cbc Merge pull request 'Optimal layout assignation algorithm' (#296) from optimal-layout into next
continuous-integration/drone/push Build is passing Details
Reviewed-on: #296
2022-12-11 17:41:53 +00:00
Alex 2c2e65ad8b
Merge commit 'ec12d6c' into next
continuous-integration/drone/push Build is passing Details
2022-12-11 18:41:15 +01:00
Alex 9d83364ad9
itertools .unique() doesn't require sorted items
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details
2022-12-11 18:30:02 +01:00
Alex defd7d9e63 Merge pull request 'Implement /health admin API endpoint to check node health' (#440) from admin-health-api into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #440
2022-12-11 17:25:28 +00:00
Alex 533afcf4e1
simplify
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-11 18:17:08 +01:00
Alex 5ea5fd2130
Always return 200 OK on /v0/health, reinstate admin api doc as draft and complete it
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-11 18:11:28 +01:00
Alex 35f8e8e2fb Merge pull request 'Fix typo in documentation' (#441) from felix.scheinost/garage:documentation-typo into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #441
2022-12-07 20:42:24 +00:00
felix.scheinost d5a2502b09 Fix typo in documentation
continuous-integration/drone/pr Build is passing Details
2022-12-07 12:43:49 +00:00
Alex d7868c48a4
Separate /health (simple text answer) and /v0/health (full json answer, authenticated)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-05 15:38:32 +01:00
Alex 280d1be7b1
Refactor health check and add ability to return it in json
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-12-05 15:28:57 +01:00
Alex 2065f011ca
Implement /health admin API endpoint to check node health
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-12-05 14:59:15 +01:00
Alex 243b7c9a1c Merge pull request 'Fix spelling mistake in docs' (#438) from tompearson/garage:fix-typo into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #438
2022-12-05 12:27:14 +00:00
tompearson a3afc761b6 Update 'doc/book/design/goals.md'
continuous-integration/drone/pr Build is passing Details
2022-12-04 16:27:46 +00:00
Alex 19bdd1c799 Merge pull request 'Fix logs appearing twice' (#435) from fix-logs into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #435
2022-11-29 21:30:39 +00:00
Alex 448dcc5cf4 Merge pull request 'Make repository into a Nix flake' (#424) from nix-remove-system into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #424
2022-11-29 21:26:41 +00:00
Alex 26121bb619
Fix logs appearing twice
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-29 22:23:27 +01:00
Alex 280330ac72 Merge pull request 'Add talk to the Capitole du Libre 2022' (#434) from CdL_talk into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #434
2022-11-27 13:38:13 +00:00
vincent 4d7b4d9d20 Add talk to the Capitole du Libre 2022
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is passing Details
2022-11-27 11:36:01 +01:00
Alex fc450ec13a Merge pull request 'Fix #432: documentation issue' (#433) from fix-432 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #433
2022-11-24 14:36:53 +00:00
Alex 379b2049f5
Fix #432: documentation issue
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-24 15:33:33 +01:00
Alex 293139a94a Merge pull request 'Tentative fix #414' (#429) from try-fix-414 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #429
2022-11-21 21:45:17 +00:00
Alex 54e800ef8d
Tentative fix for issue #414
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-21 17:13:41 +01:00
Alex 1e40c93fd0 Merge pull request 'Changes for v0.8.0' (#428) from v0.8.0-tmp into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #428
2022-11-21 13:55:50 +00:00
Alex 0cfb56d33e
update cargo.nix
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-21 14:47:18 +01:00
Alex c1fb65194c
Add sled default in garage_model also
continuous-integration/drone/push Build is passing Details
2022-11-21 14:25:54 +01:00
Alex 67941000ee
put sled as default feature in garage_db 2022-11-21 14:08:21 +01:00
Alex 60c26fbc62
Inject last modified date as git_version; flake cache uploading
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-16 23:47:10 +01:00
Alex e76dba9561
Make repository into a Nix flake
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-11-16 23:25:34 +01:00
Alex 7fafd14a25 Merge pull request 'Documentation updates' (#423) from doc-0.8 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #423
2022-11-16 20:50:45 +00:00
Alex 555a54ec40
doc precisions and fixes
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-11-16 13:40:49 +01:00
Alex fc8f795bba
Rename subsections and add docker compose file
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-16 13:33:33 +01:00
Alex a7af0c8af9
Add best practices and doc of monitoring (fix #419)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-16 13:27:24 +01:00
Alex bcc9772470 Merge pull request 'OpenAPI spec for admin API' (#379) from ecosystem/openapi into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #379
2022-11-16 10:51:04 +00:00
Alex c4e4cc1156 Merge pull request 'Move testing strategy to a dedicated doc section (fix #114)' (#415) from doc-testing-strategy into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #415
2022-11-14 12:38:28 +00:00
Alex 05547f2ba6
Move testing strategy to a dedicated doc section (fix #114)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-14 13:34:00 +01:00
Alex 39ac295eb7 Merge pull request 'Improve Nginx reverse proxy example' (#413) from baptiste/garage:nginx_fix into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #413
2022-11-14 12:21:56 +00:00
Quentin cf23aee183
Add a "build" section, doc for SDK
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-11-13 16:48:52 +01:00
Quentin 74ea449f4b
Add missing parameter
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-12 23:04:37 +01:00
Quentin eabb37b53f
openapi validate fix
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-12 22:37:42 +01:00
Quentin e7824faa17
Finalize the specification of the admin API
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-12 18:08:41 +01:00
Baptiste Jonglez 8dfc909759 Improve Nginx reverse proxy example
continuous-integration/drone/pr Build is passing Details
By default, Nginx does proxy buffering and it may store big replies to a
temporary file up to 1 GB.  It also means that Nginx will read data as
fast as possible from Garage, even if the client downloads slowly.  Both
behaviours are often not wanted, so disable this temporary file in the example.

Ref: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering

Also add an example of upstream with a "backup" server, which may be
useful to only use remote servers as fallback.
2022-11-11 21:50:08 +01:00
Quentin 485109ea60
Bucket CRUD is defined
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-11 18:32:35 +01:00
Quentin ebe8a41f2d
Bucket skeleton
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-11 17:10:41 +01:00
Quentin dc50fa3b34
Fix typo in admin API on BucketInfo
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-11 16:56:56 +01:00
Quentin a976c9190c
Use awscli in the getting started guide
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-11-11 12:48:52 +01:00
Quentin 72a0f90070
Make capacity nullable to allow gateway config
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build was killed Details
2022-11-11 09:22:37 +01:00
Quentin d814deb806
Error is nullable on AddNode 2022-11-11 09:22:37 +01:00
Quentin 6a09f16da7
Set required fields in the spec 2022-11-11 09:22:36 +01:00
Quentin 23207d18a0
Fix case of garage version 2022-11-11 09:22:36 +01:00
Quentin 3024405a65
Add operationId to entrypoints 2022-11-11 09:22:36 +01:00
Quentin 5f0928f89c
Declare Authorization scheme in OpenAPI 2022-11-11 09:22:36 +01:00
Quentin 0a01b34e81
Partial OpenAPI spec for admin API with a viewer 2022-11-11 09:22:36 +01:00
Alex ec12d6c8dd
Slightly simplify code at places
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-08 16:15:45 +01:00
Alex 217abdca18
Fix HTTP return code
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-08 15:38:53 +01:00
Alex fc2729cd81
Fix integration test
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-11-08 15:19:46 +01:00
Alex d75b37b018
Return more info when layout's .check() fails, fix compilation, fix test
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-11-08 14:58:39 +01:00
Alex 73a4ca8b15
Use bytes as capacity units
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-11-07 21:12:11 +01:00
Alex fd5bc142b5
Ensure .sort() is called before counting unique items
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-11-07 20:29:25 +01:00
Alex ea5afc2511
Style improvements
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-11-07 20:11:30 +01:00
Alex 28d7a49f63
Merge branch 'main' into optimal-layout
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-11-07 12:20:59 +01:00
Alex 66f2daa025 Merge pull request 'Add documentation to run Mastodon on Garage' (#411) from baptiste/garage:doc_mastodon into main
continuous-integration/drone/push Build was killed Details
Reviewed-on: #411
2022-11-06 17:06:07 +00:00
Baptiste Jonglez 26b3295aaa Add documentation to run Mastodon on Garage
continuous-integration/drone/pr Build was killed Details
2022-11-06 14:07:31 +01:00
Alex 0d279918b7 Merge pull request 'Improvements to CLI' (#410) from cleanup-uploads-command into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #410
2022-11-04 15:51:16 +00:00
Alex e03d9062f7
Show a nice message and a backtrace when Garage panics
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-11-04 16:39:02 +01:00
Alex 8d3bbf5703
Clearer error messsages
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-11-04 16:07:33 +01:00
Alex 5b18fd8201
Add garage bucket cleanup-incomplete-uploads command
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
2022-11-04 11:55:59 +01:00
Alex 043246c575 Merge pull request 'Fix helm chart with correct configuration syntax' (#406) from fix-helm-chart into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is failing Details
Reviewed-on: #406
2022-10-18 20:30:58 +00:00
Alex d6c77ea327
Fix helm chart with correct configuration syntax
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-10-18 22:30:05 +02:00
Alex 5254750658 Merge pull request 'Add TLS support for Consul discovery + refactoring' (#405) from consul-tls into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #405
2022-10-18 20:20:55 +00:00
Alex 57b5c2c754
Change reqwest rustls features
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-10-18 22:11:27 +02:00
Alex 8bc5caf7aa
Fix issue with 'http(s)://' prefix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-10-18 21:17:11 +02:00
Alex 2da8786f54
move things around
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
2022-10-18 19:13:52 +02:00
Alex 5d8d393054
Load TLS certificates only once
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-10-18 19:11:16 +02:00
Alex 002b9fc50c
Add TLS support for Consul discovery + refactoring
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-10-18 18:38:20 +02:00
Alex 5670599372 Merge pull request 'Use status code 204 No Content for empty responses' (#403) from tobikris/garage:http-no-content into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #403
2022-10-18 14:20:44 +00:00
Alex 7bc9fd34b2 Merge pull request 'upgrade Nix toolchain' (#400) from upgrade-toolchain into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #400
2022-10-18 14:16:52 +00:00
Alex a54a63c491
Add function to upload a build and its dependencies to the cache
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
to faster bootstrap new runner nodes
2022-10-18 14:19:19 +02:00
Tobias Krischer f1c96d108c
update k2v docs for status 204 changes
continuous-integration/drone/pr Build is passing Details
2022-10-18 13:50:56 +02:00
Alex 8fc93abc79
Some things are now in result-bin
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2022-10-18 13:39:21 +02:00
Alex 667ca9d3e3
Cleanup nix scripts
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-10-18 12:48:31 +02:00
Alex 6a5eba0b72
Add garage_db test to CI
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build was killed Details
2022-10-18 12:33:35 +02:00
Alex 00cf076412
Fix cargo2nix feature discovery
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-10-18 12:15:45 +02:00
Alex 7c0c229934
move refresh_toolchain 2022-10-18 12:15:31 +02:00
Tobias Krischer 7865003323
Use status code 204 No Content for empty responses
continuous-integration/drone/pr Build is passing Details
2022-10-17 10:55:26 +02:00
Quentin 4582a8f34a Merge pull request 'Update 'doc/book/reference-manual/features.md'' (#402) from borgified/garage:borgified-patch-1 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #402
2022-10-16 07:41:32 +00:00
borgified 8e442001b9 Update 'doc/book/reference-manual/features.md'
continuous-integration/drone/pr Build is passing Details
typo
2022-10-16 07:13:21 +00:00
Alex c050a59fd0
Fix conditional testing in garage_db
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build was killed Details
2022-10-14 18:27:18 +02:00
Alex fcaee3bea0
definitively expunge openssl from dependencies everywhere
continuous-integration/drone/push Build encountered an error Details
continuous-integration/drone/pr Build is failing Details
2022-10-14 18:10:36 +02:00
Alex e89e047c5a
Fix i386 build with custom toolchain (armv6 unknown state) 2022-10-14 18:10:24 +02:00
Alex 8d04ae7014
cargo2nix unstable (patched), rust 1.63.0, nixpkgs 22.05 (32-bit builds are broken)
continuous-integration/drone/pr Build encountered an error Details
continuous-integration/drone/push Build is failing Details
2022-10-14 14:30:48 +02:00
Alex 3039bb5d43
rm .gitattributes
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-10-13 12:40:42 +02:00
Mendes bcdd1e0c33 Added some comment
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build encountered an error Details
2022-10-11 18:29:21 +02:00
Mendes e5664c9822 Improved the statistics displayed in layout show
corrected a few bugs
2022-10-11 17:17:13 +02:00
Mendes 4abab246f1 cargo fmt
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-10-10 17:21:13 +02:00
Mendes fcf9ac674a Tests written in layout.rs
added staged_parameters to ClusterLayout
removed the serde(default) -> will need a migration function
2022-10-10 17:19:25 +02:00
Mendes 911eb17bd9 corrected warnings of cargo clippy 2022-10-06 14:53:57 +02:00
Mendes 9407df60cc Corrected two bugs:
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
- self.node_id_vec was not properly updated when the previous ring was empty
- ClusterLayout::merge was not considering changes in the layout parameters
2022-10-06 12:54:51 +02:00
Mendes a951b6c452 Added a CLI command to update the parameters for the layout computation (for now, only the zone redundancy)
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-10-05 16:04:19 +02:00
Mendes ceac3713d6 modifications in several files to :
- have consistent error return types
- store the zone redundancy in a Lww
- print the error and message in the CLI (TODO: for the server Api, should msg be returned in the body response?)
2022-10-05 15:29:48 +02:00
Mendes 829f815a89 Merge remote-tracking branch 'origin/main' into optimal-layout
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-10-04 18:14:49 +02:00
Mendes 99f96b9564 deleted zone_redundancy from System struct
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
2022-10-04 18:09:24 +02:00
Alex a096ced355 Merge pull request 'Fix instant substractions that might have panicked' (#398) from fix-time into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #398
2022-10-02 16:41:06 +02:00
Alex e21b672c96 Merge pull request 'Add helm chart' (#331) from chemicstry/garage:helm_chart into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #331
Reviewed-by: maximilien <me@mricher.fr>
2022-10-02 16:40:54 +02:00
Maximilien R db0c8b3980 Updates values.yml with some opinionated and untested defaults
continuous-integration/drone/pr Build is passing Details
2022-09-30 18:46:57 +02:00
Maximilien R 6dba7dadf4 Add missing ClusterRole and bindings for CRDs 2022-09-30 18:46:57 +02:00
chemicstry d2c937a931 Fix typo 2022-09-30 18:46:57 +02:00
chemicstry 744c3b4d94 Update docs 2022-09-30 18:46:57 +02:00
chemicstry b71fa2ddf4 Generate random RPC secret if not provided 2022-09-30 18:46:57 +02:00
chemicstry 37a73d7d37 Move documentation to book 2022-09-30 18:46:57 +02:00
chemicstry d0f08c254e Add secret to overrides 2022-09-30 18:46:57 +02:00
chemicstry fa52558ca1 Add configuration instructions to README 2022-09-30 18:46:57 +02:00
chemicstry 131cc2532b Cleanup values.yaml 2022-09-30 18:46:57 +02:00
chemicstry a93dcce841 Add helm chart 2022-09-30 18:46:57 +02:00
Alex b17d59cfab Merge pull request 'Document db_engine' (#399) from doc-0.8 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #399
2022-09-29 17:29:44 +02:00
Alex ad917ffd3f
Fix instant substractions that might have panicked
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-29 15:53:54 +02:00
Alex 497164d782 Merge pull request 'Shutdown properly on SIGTERM/SIGHUP and on Windows signals' (#397) from handle-sigterm into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #397
2022-09-28 12:16:55 +02:00
Alex 1f97ce37e6
Shutdown properly on SIGTERM/SIGHUP and on Windows signals
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-09-28 10:41:59 +02:00
Alex 0ab0d3cc29
Document db_engine
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-27 16:52:36 +02:00
Alex 2197753dfd Merge pull request 'Add step to generate multi-arch Docker container in CI' (#393) from multi-arch-container into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #393
2022-09-27 11:55:49 +02:00
Alex 3f95a0f717 Merge pull request 'Enable k2v feature flag by default in CI' (#302) from k2v into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #302
2022-09-27 11:38:23 +02:00
Alex 7291747a28 Merge pull request 'Documentation changes for v0.8' (#394) from doc-0.8 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #394
2022-09-27 11:37:12 +02:00
Alex d104ae8711
Add step to generate multi-arch Docker container in CI
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2022-09-26 19:09:55 +02:00
Alex 194e8be1bb
Update docker image links
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-26 18:01:17 +02:00
Alex 69bcc813de
Add garage v0.8 migration guide
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-26 17:46:38 +02:00
Alex ea7a571d88 Merge pull request 'Fix span name for api server requests' (#392) from fix-span-name into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #392
2022-09-26 16:57:37 +02:00
Alex 1778e4b318
Fix span name for api server requests
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-26 16:21:30 +02:00
Mendes bd842e1388 Correction of a few bugs in the tests, modification of ClusterLayout::check
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
2022-09-22 19:30:01 +02:00
Mendes 7f3249a237 New version of the algorithm that calculate the layout.
It takes as paramters the replication factor and the zone redundancy, computes the
largest partition size reachable with these constraints, and among the possible
assignation with this partition size, it computes the one that moves the least number
of partitions compared to the previous assignation.
This computation uses graph algorithms defined in graph_algo.rs
2022-09-21 14:39:59 +02:00
Alex af2b2f26b4 Merge pull request 'Update README (fix #230)' (#391) from new-readme into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #391
2022-09-21 13:28:52 +02:00
Alex a3758dc4c4
Update README
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-21 12:53:02 +02:00
Alex e89f880694
Enable k2v feature flag in CI
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-09-20 17:54:41 +02:00
Alex fc85508648 Merge pull request 'Initialize metrics exporter earlier (fix #389)' (#390) from fix-metrics into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #390
2022-09-20 17:53:46 +02:00
Alex 782630fc27
Initialize metrics exporter earlier (fix #389)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-20 17:50:22 +02:00
Alex 7a901f7aab Merge pull request 'RPC performance changes' (#387) from configurable-timeouts into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
Reviewed-on: #387
2022-09-20 16:17:23 +02:00
Alex ded444f6c9
Ability to have custom timeouts in request strategy (not used)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-20 16:01:41 +02:00
Alex 357b72f4ff
Merge branch 'main' into configurable-timeouts
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-20 15:19:58 +02:00
Alex 2c312e9cbd Merge pull request 'Change a warn! into a debug!' (#388) from less-noise into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #388
2022-09-20 11:57:52 +02:00
Alex 1f7b050b7d
Change a warn! into a debug!
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-20 11:49:48 +02:00
Alex 56592e1853
RPC performance changes
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
- configurable ping timeout
- single, much higher, configurable RPC timeout
- no more concurrency semaphore
2022-09-19 20:31:00 +02:00
Alex fbd32933ea Merge pull request 'Faster GetObject workflow for getting entire objects' (#386) from faster-get into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #386
2022-09-19 15:24:06 +02:00
Alex 5d4b6f2173
Faster GetObject workflow for getting entire objects
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-19 12:19:59 +02:00
Alex 4fba06d62e Merge pull request 'updates to documentation for v0.8' (#385) from doc-0.8 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #385
2022-09-19 10:45:10 +02:00
Alex 1d0a610690
Finish writing about Garage features, and fix from-source instructions
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-15 13:23:57 +02:00
Alex f6aebefcc9
Some work on documentation towards v0.8
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-14 19:31:13 +02:00
Alex 89b8087ba8 Merge pull request 'Properly return HTTP 204 when deleting non-existent object (fix #227)' (#384) from deleteobject-204 into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #384
2022-09-14 17:16:39 +02:00
Alex 76f42a1a2b
Properly return HTTP 204 when deleting non-existent object (fix #227)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-14 17:07:55 +02:00
Alex 82600acf77 Merge pull request 'Allow for hostnames in bootstrap_peers and rpc_public_addr (fix #353)' (#383) from resolve-peer-names into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #383
2022-09-14 16:37:18 +02:00
Alex e46dc2a8ef
Allow for hostnames in bootstrap_peers and rpc_public_addr (fix #353)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-14 16:09:38 +02:00
Alex 80fdbfb0aa Merge pull request 'various fixes for v0.8.0' (#380) from various-fixes-for-0.8 into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build was killed Details
Reviewed-on: #380
2022-09-13 16:49:05 +02:00
Alex ab722cb40f
Add checks on replication_factor of layouts we use (fix #363, fix #364)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-13 16:22:23 +02:00
Alex 38be811b1c
Fix clippy lint that says we should implement Eq
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-13 16:08:00 +02:00
Alex 44733474bb
Remove/change println! in server code (fix #358)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-13 16:01:55 +02:00
Alex 07febd3ecd
Ensure data dir is created immediately when Garage starts (fix #349)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-13 15:57:27 +02:00
Alex 11bdc971e2 Merge pull request 'use netapp streaming body' (#343) from netapp-stream-body into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #343
2022-09-13 15:26:08 +02:00
Alex ff30891999
Use streaming block API for get with Range requests
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-13 15:13:07 +02:00
Alex 28a4af73ca
Use netapp 0.5 published from crates.io
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-13 13:11:44 +02:00
Alex b823151a0b
improvements in block manager
continuous-integration/drone/push Build is passing Details
2022-09-12 16:57:38 +02:00
Alex 309d7aef3f Merge pull request 'performance improvements' (#342) from lx-perf-improvements into main
continuous-integration/drone/push Build is passing Details
Performance improvements included in this PR:

- [x] Use `Bytes` at a few places where appropriate, instead of `Vec<u8>`, to reduce the number of copies
  - [x] StreamChunker now accumulates incoming slices in a `Vec<Bytes>` instead of a `VecDeque<u8>`. Replaces calls to `.extend()` and `.drain()` that were quite costly by a simple `concat()` on a vec of slices which is much more optimized
- [x] Hashing (b2, sha256, md5) is now done on a Tokio thread dedicated to cpu-intensive tasks, using `spawn_blocking`
- [x] Block manager now uses 256 independant locks instead of one big lock for writing, reduces contention when writing several/many objects in parallel
- [x] Better LMDB defaults: we now put flags `NoSync` and `NoMetaSync` to avoid `fsync` at each transaction (extremely slow). Also increased number of LMDB readers to accomodate more intensive workloads

Other changes included in this PR:

- [x] Update to hashing and MAC crates: md5 and sha2 from 0.9 to 0.10, hmac from 0.10 to 0.12
- [x] switch to `tracing_subscriber` for logs, which allows to have timing of each event

Reviewed-on: #342
2022-09-12 16:38:43 +02:00
Alex f91fab8582
Simplify+improve async hasher by using bounded channel
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-12 16:23:43 +02:00
Mendes c4adbeed51 Added the section with description proofs of the parametric assignment computation in the optimal layout report
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-09-10 13:51:12 +02:00
Alex 7f54706b95
Merge branch 'lx-perf-improvements' into netapp-stream-body
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-08 15:50:56 +02:00
Alex d9d199a6c9
Merge branch 'main' into lx-perf-improvements
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-08 15:49:17 +02:00
Alex 03c40a0b24 Merge pull request 'Reorganize dependencies' (#373) from improve-deps into main
continuous-integration/drone/push Build was killed Details
This PR includes work from @jirutka :

- [x] Allow linking against system-provided libraries (libsodium, libsqlite, libzstd) #370
- [x] Make OTLP exporter optional and allow building without Prometheus exporter (/metrics) #372

And also:

- [x] Update `.nix` files
- [x] Remove heed default-features
- [x] Bump versions of all Garage crates to 0.8.0
- [x] Make db engines (lmdb, sled, sqlite) optionnal
- [x] Add documentation for available features
- [x] Directly include code of previous versions used for migration in order to reduce dependencies
- [x] Read variable `GIT_VERSION` from garage main instead of in crate garage_util to make builds faster
- [x] Report features used in the build somewhere? (in `garage --version` or something)
- [x] Check we `warn!` correctly if we try to use deactivated feature
- [x] Allow not to launch S3 endpoint if not in config

Reviewed-on: #373
2022-09-08 15:45:09 +02:00
Mendes d38fb6c250 ignore log files in commit 2022-09-08 12:43:33 +02:00
Alex ceb1f0229a
Move version back into util
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-07 18:36:46 +02:00
Alex f310fce34b
Inject GIT_VERSION even later
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-07 18:30:15 +02:00
Alex 06df301de5
Fix merge
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-07 18:16:01 +02:00
Alex 8adc654713
Merge branch 'main' into improve-deps 2022-09-07 18:13:27 +02:00
Alex 107853334b
Fix build error
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-09-07 18:10:19 +02:00
Alex 1449204439
Add warnings when features are not included in build
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-09-07 18:02:13 +02:00
Alex 2e00809af5
Error messages when system-libs XOR bundled-libs != 1
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
2022-09-07 17:57:12 +02:00
Alex 2559f63e9b
Make all HTTP services optionnal
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
2022-09-07 17:54:16 +02:00
Alex 28d86e7602
Report build features in garage --help
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-09-07 17:05:21 +02:00
Alex db61f41030
Move GIT_VERSION injection later in build chain to reduce build times
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-09-07 11:59:56 +02:00
Alex 907054775d
Faster copy, better get error message
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-06 22:25:23 +02:00
Alex 6b958979bd
Merge branch 'lx-perf-improvements' into netapp-stream-body
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-06 22:13:01 +02:00
Alex d23b3a14fc
Merge branch 'main' into lx-perf-improvements
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-06 21:53:37 +02:00
Alex 4024822585
Update netapp to lastest git version with LAS scheduling
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-09-06 19:45:00 +02:00
Alex c2cc08852b
Reenable node ordering
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-09-06 19:31:42 +02:00
Alex 6f02c36a89
cargo fmt
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-06 17:59:41 +02:00
Alex 0f5689c169
Include code from v0.5.1 directly to remove dependencies
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-09-06 17:52:50 +02:00
Alex 1e92e9f782
Disable k2v tests when feature is disabled
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-06 17:29:46 +02:00
Alex 431dee050f
Remove opentelemetry-otlp dep in api/
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-09-06 17:25:44 +02:00
Alex 2c2b93acdf
Update Nix files with optional db engines
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
2022-09-06 17:20:10 +02:00
Alex bbb970965c
Document available build features
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
2022-09-06 17:16:45 +02:00
Alex b886c75450
Make all DB engines optional build features 2022-09-06 17:09:43 +02:00
Alex 48ffaaadfc
Bump versions to 0.8.0 (compatibility is broken already)
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-09-06 16:47:56 +02:00
Alex 7de53a4d66
Force disable pkg-config for libsodum-sys and libzstd-sys
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-09-06 16:41:58 +02:00
Alex 8d77a76df1
Update .nix files
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-09-06 15:49:41 +02:00
Alex 454d8474ef
Fix clippy 2022-09-06 15:43:50 +02:00
Alex ed7796924b Merge pull request 'Make OTLP exporter optional and allow building without Prometheus exporter (/metrics)' (#372) from jirutka/garage:telemetry-and-metrics into improve-deps
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
Reviewed-on: #372
Reviewed-by: Alex <alex@adnab.me>
2022-09-06 15:11:30 +02:00
Jakub Jirutka ea36b9ff90 Allow building without Prometheus exporter (/metrics endpoint)
continuous-integration/drone/pr Build is failing Details
prometheus and opentelemetry-prometheus add 7 extra dependencies in
total and increases the size of the garage binary by ~7 % (with
fat LTO).
2022-09-06 01:15:09 +02:00
Jakub Jirutka e7af006c1c Make OTLP exporter optional via feature "telemetry-otlp"
opentelemetry-otlp add 48 (!) extra dependencies and increases the
size of the garage binary by ~11 % (with fat LTO).
2022-09-06 01:14:47 +02:00
Jakub Jirutka db72812f01 Use the new cargo feature resolver "2"
Garage currently uses the legacy resolver "1". The new one is used
by default if the root package specifies 'edition = 2021', which
Garage does not (yet).

The problem with the legacy resolver is, among others, that features
enabled by dev-dependencies are propagated to normal dependencies.
This affects e.g. hyper - one of the dev-dependencies enables "http2"
feature that adds many extra dependencies. If we build garage without
opentelemetry-otlp (this is enabled in the following commit), there's
no normal dependency enabling "http2" feature.

See https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2
2022-09-06 01:14:19 +02:00
Alex 729a910e14
Remove Heed default features
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-05 16:40:13 +02:00
Alex 9f5433db82 Merge pull request 'Update .drone.yml signature' (#374) from fix-drone-signature into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #374
2022-09-05 16:18:15 +02:00
Alex fd8074ad9b
Update .drone.yml signature
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-05 16:09:01 +02:00
Alex 07e6bcde85
Merge branch 'main' into lx-perf-improvements
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-05 12:40:17 +02:00
Alex 0009fd136c Merge pull request 'Make block resync speed dynamically configurable' (#369) from resync-ajustable-speed into main
continuous-integration/drone/push Build is passing Details
Included in this PR:

- [x] Small refactor, resync code is moved to a separate `block/resync.rs` file
- [x] Block resync tranquility is no longer in config file, it is set dynamically using `garage worker set resync-tranquility` (this parameter is persisted over Garage restarts)
- [x] Up to 4 block resync workers can be activated to run simultaneously to speed up big resyncs, this parameter is set dynamically using `garage worker set resync-n-workers`

Reviewed-on: #369
2022-09-05 12:35:08 +02:00
Jakub Jirutka 7511ba5530 Allow linking against system-provided libsqlite
continuous-integration/drone/push Build is pending Details
continuous-integration/drone/pr Build is pending Details
Unfortunately, rusqlite uses the opposite logic for enabling/disabling
bundled libraries to others (libsodium-sys, zstd-sys). Cargo features
are very limited and doesn't allow to enable feature A in a dependency
iff feature B is disabled.

Note, lmdb-rkv-sys doesn't need any special treatment because it
automatically links against system liblmdb if found via pkgconf.

Linux distros should build garage with
`--no-default-features --features system-libs` to disable bundled-libs
and enable system-libs.
2022-09-03 19:15:57 +02:00
Jakub Jirutka a6e40b75ea Add feature "system-libs" to enable linking against system libraries
If this feature is enabled, libsodium-sys and zstd-sys will link
dynamically against system-provided libraries instead of building
and linking statically the bundled (possibly outdated and vulnerable)
copies of them. This feature is intended mainly for linux package
maintainers.
2022-09-03 18:44:34 +02:00
Alex e1751c8a9c
fix clippy
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-02 17:24:26 +02:00
Alex 5d4b937a00
Ability to have up to 4 concurrently working resync workers
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-09-02 17:18:13 +02:00
Alex 5e8baa433d
Make BlockManagerLocked fully private again
continuous-integration/drone/push Build is passing Details
2022-09-02 16:52:22 +02:00
Alex 47be652a1f
block manager: refactor: split resync into separate file
continuous-integration/drone/push Build is passing Details
2022-09-02 16:47:15 +02:00
Alex 943d76c583
Ability to dynamically set resync tranquility
continuous-integration/drone/push Build is passing Details
2022-09-02 15:34:21 +02:00
Alex 6226f5ceca
Update to netapp 0.4.5 - fixed ping
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-02 14:33:12 +02:00
Alex 13b5f28c7e
Make use of BytesBuf from new Netapp
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-02 13:46:42 +02:00
Alex 1ef87ac4cb
cargo fmt
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-02 13:38:29 +02:00
Alex 99b532b85b
Apply PRIO_SECONDARY to block data transfers
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-09-01 16:35:43 +02:00
Alex e648bf7b69
update cargo.nix
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-09-01 16:31:04 +02:00
Alex df094bd807
Less strict timeouts 2022-09-01 16:30:44 +02:00
Alex f3bf34b6a1
update netapp: straming + fix-ping
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-01 14:23:54 +02:00
Alex bc977f9a7a
Update to Netapp with OrderTag support and exploit OrderTags
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-09-01 12:58:20 +02:00
Alex 4b726b0941
netapp recv with unbounded channel removes deadlock
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-09-01 09:47:28 +02:00
Alex 70231d68b2
Fix bytes_read counter
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-08-31 19:44:27 +02:00
Alex e598231ca4
update netapp git commit
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-08-31 19:27:25 +02:00
Alex c9bc9d89de
Merge branch 'lx-perf-improvements' into netapp-stream-body
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-08-31 17:42:31 +02:00
Alex eb97e13a6a
update cargo.nix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-08-31 17:42:00 +02:00
Alex efbca67ce4
Add env filter to tracing subscriber
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-08-31 14:39:12 +02:00
Alex 44cd98d2e4
Tracing-subscriber: write to stderr
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-08-31 14:28:17 +02:00
Alex dd5304f6fc
Replace logging crate pretty_env_logger by tracing_subscriber::fmt
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-08-31 14:24:41 +02:00
Alex 322dafc761
Try to fix clippy
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build was killed Details
continuous-integration/drone Build was killed Details
2022-08-29 17:32:45 +02:00
Alex 5d065b8a0f
cargo2nix fix to fetchCrateGit
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-08-29 17:24:53 +02:00
Alex 52749e28f7
Merge branch 'lx-perf-improvements' into netapp-stream-body
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone Build is failing Details
2022-08-29 16:48:43 +02:00
Alex 4da67b0035
Update drone signature
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
2022-08-29 16:48:31 +02:00
Alex 1921f4f7e6
Merge branch 'lx-perf-improvements' into netapp-stream-body
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-08-29 16:45:05 +02:00
Alex ebc20a8798
Merge branch 'main' into lx-perf-improvements
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-08-29 16:44:13 +02:00
Mendes 81083dd415 Added a first draft version of the algorithm and analysis for the non-strict mode.
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-08-19 21:21:41 +02:00
Quentin 532eca7ff9
Add some documentation for Caddy
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is pending Details
2022-08-12 10:33:41 +02:00
Quentin 2c7bae935a
Configure structopt to report the right version
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is passing Details
By default, structopt reports the value provided by
the env var CARGO_PKG_VERSION, feeded by Cargo when reading
Cargo.toml. However for Garage we use a versioning based on git,
so we often report a version that is behind the real version.
In this commit, we create garage_util::version::garage() that
reports the right version and configure all structopt subcommands
to call this function instead of using the env var.
2022-08-11 10:21:45 +02:00
Quentin 8cd02639dc
drone: set TARGET env as needed by "to_s3" func
continuous-integration/drone Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-08-03 11:19:26 +02:00
Alex e935861854
Factor out node request order selection logic & use in manager
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone Build is failing Details
2022-07-29 12:25:03 +02:00
Alex f0ee3056d3
Update cargo.nix 2022-07-29 12:25:03 +02:00
Alex 126b037307
update netapp 2022-07-29 12:25:03 +02:00
Alex 33750c04ed
Update cargo.nix 2022-07-29 12:25:03 +02:00
Alex 68087ee13d
Fix clippy 2022-07-29 12:25:03 +02:00
Alex 605a630333
Use streaming in block manager 2022-07-29 12:25:02 +02:00
Alex a35d4da721
update netapp to 0.5 2022-07-29 12:25:02 +02:00
Alex 8e7e680afe
First adaptation to WIP netapp with streaming body 2022-07-29 12:25:02 +02:00
Alex 16f6a1a65d
fix clippy
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-07-29 12:24:49 +02:00
Alex ad35b18bb1
Faster chunker 2022-07-29 12:24:49 +02:00
Alex 49154a78d8
Update cargo.nix 2022-07-29 12:24:48 +02:00
Alex ff4771c36a
cargo fmt 2022-07-29 12:24:48 +02:00
Alex 381eb9a5a1
Fix tests 2022-07-29 12:24:48 +02:00
Alex 2cad656a03
More make clippy happy 2022-07-29 12:24:48 +02:00
Alex 0176da3ad2
Make clippy happy 2022-07-29 12:24:48 +02:00
Alex 40150527b8
Update cargo.nix 2022-07-29 12:24:48 +02:00
Alex 2f111e6b3d
Performance improvements:
- reduce contention on mutation_lock by having 256 of them
- better lmdb defaults
2022-07-29 12:24:48 +02:00
Alex 1b2e1296eb
Compute hashes on dedicated threads 2022-07-29 12:24:44 +02:00
Quentin a184f0d0b5
Migrate to nix-daemon builders
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-07-29 08:37:33 +02:00
Quentin fcb04843f7
Run clippy in nix, leveraging nix caching ability
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-07-26 18:27:52 +02:00
Quentin 5fb8584247
Refactor default.nix to follow Nix Flakes patterns 2022-07-26 18:27:52 +02:00
Quentin 96561c48a1
Bump Nix image to 22.05 2022-07-26 18:27:52 +02:00
Quentin a49d0ea19f
Fix: compile aarch64+armv6 as static binaries 2022-07-26 18:27:51 +02:00
Quentin 9c9e483375
Put log-lines in nix.conf 2022-07-26 18:27:51 +02:00
Quentin 76cb34a0ae
Fail if compiled binary is dynamic 2022-07-26 18:27:46 +02:00
Mendes 7b2c065c82 Merge branch 'optimal-layout' of https://git.deuxfleurs.fr/Deuxfleurs/garage into optimal-layout
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-07-19 13:30:49 +02:00
Mendes 03e3a1bd15 Added the latex report on the optimal layout algorithm 2022-07-18 22:35:29 +02:00
Alex ac03fa7937
Uniformize tracing::* imports (hopefully fixes 32-bit build)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-07-15 18:31:19 +02:00
Alex 4f38cadf6e Background task manager (#332)
continuous-integration/drone/push Build is passing Details
- [x] New background worker trait
- [x] Adapt all current workers to use new API
- [x] Command to list currently running workers, and whether they are active, idle, or dead
- [x] Error reporting
- Optimizations
  - [x] Merkle updater: several items per iteration
  - [ ] Use `tokio::task::spawn_blocking` where appropriate so that CPU-intensive tasks don't block other things going on
- scrub:
  - [x] have only one worker with a channel to start/pause/cancel
  - [x] automatic scrub
  - [x] ability to view and change tranquility from CLI
  - [x] persistence of a few info
- [ ] Testing

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #332
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-07-08 13:30:26 +02:00
Alex aab34bfe54
add delays in k2v test_items_and_indices
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-07-08 10:41:57 +02:00
Alex fe3fa83de7 Publish k2v-client crate to crates.io (#337)
continuous-integration/drone/push Build is passing Details
Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #337
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-07-04 18:27:25 +02:00
Alex b6d59ec19a
Fix poll item when item didn't change
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-07-04 14:00:02 +02:00
Alex 0850bac874 Add `poll` command to `k2v-cli` (#335)
continuous-integration/drone/push Build is passing Details
Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #335
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-07-04 12:45:32 +02:00
Alex b74b533b7b Fix typo
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-06-29 11:50:51 +02:00
Alex 996f2a6d58 Slides for talk at IMT Atlantique / STACK on 2022-06-23 (#333)
continuous-integration/drone/push Build is passing Details
Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #333
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-06-23 14:28:40 +02:00
Alex 77e3fd6db2 improve internal item counter mechanisms and implement bucket quotas (#326)
continuous-integration/drone/push Build is passing Details
- [x] Refactoring of internal counting API
- [x] Repair procedure for counters (it's an offline procedure!!!)
- [x] New counter for objects in buckets
- [x] Add quotas to buckets struct
- [x] Add CLI to manage bucket quotas
- [x] Add admin API to manage bucket quotas
- [x] Apply quotas by adding checks on put operations
- [x] Proof-read

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #326
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-06-15 20:20:28 +02:00
Quentin d544a0e0e0
Send CORS headers for all requests
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-06-13 10:19:52 +02:00
Alex 138e13071b
Fix garage_db build on 32-bit systems
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-06-09 14:55:20 +02:00
Alex b44d3fc796 Abstract database behind generic interface and implement alternative drivers (#322)
continuous-integration/drone/push Build is passing Details
- [x] Design interface
- [x] Implement Sled backend
  - [x] Re-implement the SledCountedTree hack ~~on Sled backend~~ on all backends (i.e. over the abstraction)
- [x] Convert Garage code to use generic interface
- [x] Proof-read converted Garage code
- [ ] Test everything well
- [x] Implement sqlite backend
- [x] Implement LMDB backend
- [ ] (Implement Persy backend?)
- [ ] (Implement other backends? (like RocksDB, ...))
- [x] Implement backend choice in config file and garage server module
- [x] Add CLI for converting between DB formats
- Exploit the new interface to put more things in transactions
  - [x] `.updated()` trigger on Garage tables

Fix #284

**Bugs**

- [x] When exporting sqlite, trees iterate empty??
- [x] LMDB doesn't work

**Known issues for various back-ends**

- Sled:
  - Eats all my RAM and also all my disk space
  - `.len()` has to traverse the whole table
  - Is actually quite slow on some operations
  - And is actually pretty bad code...
- Sqlite:
  - Requires a lock to be taken on all operations. The lock is also taken when iterating on a table with `.iter()`, and the lock isn't released until the iterator is dropped. This means that we must be VERY carefull to not do anything else inside a `.iter()` loop or else we will have a deadlock! Most such cases have been eliminated from the Garage codebase, but there might still be some that remain. If your Garage-over-Sqlite seems to hang/freeze, this is the reason.
  - (adapter uses a bunch of unsafe code)
- Heed (LMDB):
  - Not suited for 32-bit machines as it has to map the whole DB in memory.
  - (adpater uses a tiny bit of unsafe code)

**My recommendation:** avoid 32-bit machines and use LMDB as much as possible.

**Converting databases** is actually quite easy. For example from Sled to LMDB:

```bash
cd src/db
cargo run --features cli --bin convert -- -i path/to/garage/meta/db -a sled -o path/to/garage/meta/db.lmdb -b lmdb
```

Then, just add this to your `config.toml`:

```toml
db_engine = "lmdb"
```

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #322
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-06-08 10:01:44 +02:00
Simon C 7eed3ceda9 docs: Add Trafik reverse proxy documentation
continuous-integration/drone/push Build is passing Details
2022-06-07 16:16:52 +02:00
Simon C 4b8f48f3c5 docs: Fix title level
continuous-integration/drone/push Build is passing Details
2022-06-07 13:32:52 +02:00
Simon C 7d3b5585f1 docs: Add link to facilitate navigation in the documentation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-06-07 09:38:59 +02:00
Quentin a1abed0378
Remove useless MC_REGION env variable
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build was killed Details
2022-06-02 12:50:11 +02:00
Alex b54a938724 Fix garage_version() now that GIT_VERSION is read in crate garage_rpc
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build was killed Details
2022-06-02 12:00:10 +02:00
Alex ff06d3f082
Fix Content-Type headers for {admin,k2v} errors and admin responses
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
Fix #315
2022-05-25 17:09:33 +02:00
Alex 93eab8eaa3 Fixes to S3 compatibility page (#314)
continuous-integration/drone/push Build is passing Details
Mention PostObject is implemented, fix english mistakes

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #314
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-05-25 16:54:44 +02:00
Quentin 43ddc933f9
Update Ceph S3 endpoints compatibility
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-05-25 15:20:08 +02:00
Alex 9f303f6308
Shorter page title
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-05-24 15:47:42 +02:00
Alex 3be43f3372
Add lost content for Restic with Garage
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
Suggested-by: Quentin <quentin@deuxfleurs.fr>
2022-05-24 15:32:42 +02:00
Alex 2da448b43f
Add documentation for new Admin API and a few infos on K2V
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-05-24 15:28:37 +02:00
Alex b2a2d3859f K2V client improvements (#307)
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
- [x] Better distinguish error types
- [x] Parse error messages received from server
- [x] Remove `src/` folder layer, we don't have that for other crates

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #307
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-05-24 12:48:05 +02:00
Alex 382e74c798 First version of admin API (#298)
continuous-integration/drone/push Build is passing Details
**Spec:**

- [x] Start writing
- [x] Specify all layout endpoints
- [x] Specify all endpoints for operations on keys
- [x] Specify all endpoints for operations on key/bucket permissions
- [x] Specify all endpoints for operations on buckets
- [x] Specify all endpoints for operations on bucket aliases

View rendered spec at <https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/admin-api/doc/drafts/admin-api.md>

**Code:**

- [x] Refactor code for admin api to use common api code that was created for K2V

**General endpoints:**

- [x] Metrics
- [x] GetClusterStatus
- [x] ConnectClusterNodes
- [x] GetClusterLayout
- [x] UpdateClusterLayout
- [x] ApplyClusterLayout
- [x] RevertClusterLayout

**Key-related endpoints:**

- [x] ListKeys
- [x] CreateKey
- [x] ImportKey
- [x] GetKeyInfo
- [x] UpdateKey
- [x] DeleteKey

**Bucket-related endpoints:**

- [x] ListBuckets
- [x] CreateBucket
- [x] GetBucketInfo
- [x] DeleteBucket
- [x] PutBucketWebsite
- [x] DeleteBucketWebsite

**Operations on key/bucket permissions:**

- [x] BucketAllowKey
- [x] BucketDenyKey

**Operations on bucket aliases:**

- [x] GlobalAliasBucket
- [x] GlobalUnaliasBucket
- [x] LocalAliasBucket
- [x] LocalUnaliasBucket

**And also:**

- [x] Separate error type for the admin API (this PR includes a quite big refactoring of error handling)
- [x] Add management of website access
- [ ] Check that nothing is missing wrt what can be done using the CLI
- [ ] Improve formatting of the spec
- [x] Make sure everyone is cool with the API design

Fix #231
Fix #295

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #298
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-05-24 12:16:39 +02:00
trinity-1686a 64c193e3db Add a K2V client library and CLI (#303)
continuous-integration/drone/push Build is passing Details
lib.rs could use getting split in modules, but I'm not sure how exactly

Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr>
Reviewed-on: #303
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2022-05-18 22:24:09 +02:00
Alex c692f55d5c
K2V: Fix `end` parameter and add tests (fix #305)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-05-17 11:50:23 +02:00
Alex 7b474855e3
Make background runner terminate correctly 2022-05-17 11:38:31 +02:00
Alex 176715c5b2
Fix ReadIndex spec and add JSON5 remark to doc
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-05-16 11:54:37 +02:00
Alex 5768bf3622 First implementation of K2V (#293)
continuous-integration/drone/push Build is passing Details
**Specification:**

View spec at [this URL](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/k2v/doc/drafts/k2v-spec.md)

- [x] Specify the structure of K2V triples
- [x] Specify the DVVS format used for causality detection
- [x] Specify the K2V index (just a counter of number of values per partition key)
- [x] Specify single-item endpoints: ReadItem, InsertItem, DeleteItem
- [x] Specify index endpoint: ReadIndex
- [x] Specify multi-item endpoints: InsertBatch, ReadBatch, DeleteBatch
- [x] Move to JSON objects instead of tuples
- [x] Specify endpoints for polling for updates on single values (PollItem)

**Implementation:**

- [x] Table for K2V items, causal contexts
- [x] Indexing mechanism and table for K2V index
- [x] Make API handlers a bit more generic
- [x] K2V API endpoint
- [x] K2V API router
- [x] ReadItem
- [x] InsertItem
- [x] DeleteItem
- [x] PollItem
- [x] ReadIndex
- [x] InsertBatch
- [x] ReadBatch
- [x] DeleteBatch

**Testing:**

- [x] Just a simple Python script that does some requests to check visually that things are going right (does not contain parsing of results or assertions on returned values)
- [x] Actual tests:
  - [x] Adapt testing framework
  - [x] Simple test with InsertItem + ReadItem
  - [x] Test with several Insert/Read/DeleteItem + ReadIndex
  - [x] Test all combinations of return formats for ReadItem
  - [x] Test with ReadBatch, InsertBatch, DeleteBatch
  - [x] Test with PollItem
  - [x] Test error codes
- [ ] Fix most broken stuff
  - [x] test PollItem broken randomly
  - [x] when invalid causality tokens are given, errors should be 4xx not 5xx

**Improvements:**

- [x] Descending range queries
  - [x] Specify
  - [x] Implement
  - [x] Add test
- [x] Batch updates to index counter
- [x] Put K2V behind `k2v` feature flag

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #293
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-05-10 13:16:57 +02:00
Alex def78c5e6f
Update netapp to 0.4.4, fix #300
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-05-09 12:08:47 +02:00
Alex 277a20ec44 Fix `layout show` to not show changes when there are no changes (#297)
continuous-integration/drone/push Build is passing Details
fixes #295, partially

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #297
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-05-09 11:14:55 +02:00
Alex 617f28bfa4
Correct small formatting issue
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-05-05 14:21:57 +02:00
Mendes 948ff93cf1 Corrected the warnings and errors issued by cargo clippy
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2022-05-01 16:05:39 +02:00
Alex 3ba2c5b424
updated cargo.lock
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-05-01 10:11:43 +02:00
Alex 2aeaddd5e2
Apply cargo fmt
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-05-01 09:57:05 +02:00
Alex c1d1646c4d
Change the way new layout assignations are computed.
continuous-integration/drone/push Build is failing Details
The function now computes an optimal assignation (with respect to partition size) that minimizes the distance to the former assignation, using flow algorithms.

This commit was written by Mendes Oulamara <mendes.oulamara@pm.me>
2022-05-01 09:54:19 +02:00
Alex c9ef3e461b
fix clippy
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-04-19 12:50:40 +02:00
Alex c93008d333
Prettier code for defragmentation 2022-04-19 12:50:40 +02:00
Alex e5341ca47b
Defragmentation in UploadPartCopy: first pass (not pretty but it compiles) 2022-04-19 12:50:36 +02:00
withinboredom a4f9f19ac3 remove size limitation in UploadPartCopy (#280)
continuous-integration/drone/push Build is passing Details
This removes the >1mb s3_copy restriction.

This restriction doesn't seem to be documented anywhere (I could be wrong). It also causes some software to fail (such as #248).

Co-authored-by: Rob Landers <landers.robert@gmail.com>
Reviewed-on: #280
Co-authored-by: withinboredom <landers.robert@gmail.com>
Co-committed-by: withinboredom <landers.robert@gmail.com>
2022-04-19 12:49:43 +02:00
Baptiste Jonglez 47e57518ec Add documentation on running Kopia with Garage
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-04-10 13:04:07 +02:00
Alex dffcd9f4b1
update Cargo.nix
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-04-08 14:35:09 +02:00
Alex 5d404dcd54
Add missing opentelemetry features 2022-04-08 14:21:04 +02:00
Quentin 62f0715abe Add/Fix OpenTelemetry
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-04-07 16:12:35 +02:00
Quentin 7e1ac51b58 Add files to quickly test k8s 2022-04-07 16:12:35 +02:00
Alex 94f1e48fff Update to netapp 0.4.2 (a tiny fix)
continuous-integration/drone/push Build is passing Details
2022-04-07 11:50:03 +02:00
Alex cb5836d53c Bring maximum exponential backoff time down from 16h to 1h
continuous-integration/drone/push Build is passing Details
2022-04-07 11:49:29 +02:00
Quentin 8e3ee82c3e Be clearer on what upgrades are (not) supported
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-04-06 21:45:59 +02:00
Quentin a122a8cb46 Add an "upgrading" section, add a guide for 0.7
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-04-05 10:08:31 +02:00
Quentin 9fd8ec1dee Add documentation for winscp+sftpgo
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-31 10:25:56 +02:00
Alex 0091002ef2
New replication modes and their documentation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-28 16:26:04 +02:00
Alex 8f9cf3a5d1
fix a clippy lint
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-28 15:48:55 +02:00
Alex 913f7754bb
Add blocks in errored state to `garage stats`
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-03-28 15:47:23 +02:00
Alex 42dde54126
Log admin GET requests at debug level instead of info
to reduce noise in logs
2022-03-28 15:46:52 +02:00
Alex dca2ffdf91
document administrative options
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-28 12:26:08 +02:00
Quentin 0cf4efac89 Compile kuberetes-discovery only when release=true
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
2022-03-24 16:57:43 +01:00
Alex 9d0ed78887 Add feature flag for Kubernetes discovery 2022-03-24 16:57:43 +01:00
Alex 509d256c58
Make layout optimization work in relative terms
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-24 15:27:14 +01:00
Alex 2814d41842
Allow `garage layout assign` to assign to several nodes at once 2022-03-24 15:27:13 +01:00
Alex 7e0e2ffda2
Slight change and add comment to layout assignation algo 2022-03-24 15:27:13 +01:00
Alex 413ab0eaed
Small change to partition assignation algorithm
This change helps ensure that nodes for each partition are spread
over all datacenters, a property that wasn't ensured previously
when going from a 2 DC deployment to a 3 DC deployment
2022-03-24 15:27:10 +01:00
Alex 43945234ae
Add missing src/block to toplevel cargo.toml
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-23 10:26:10 +01:00
Alex 3dc9214172
Add lots of comments on how the resync queue works
(I don't really want to change/refactor that code though)
2022-03-23 10:25:39 +01:00
Alex 077dd1cde9
Clippy 2022-03-23 10:25:39 +01:00
Alex 2d13f0aa13
run cargo2nix 2022-03-23 10:25:37 +01:00
Alex e480aaf338
Make background tranquility a configurable parameter 2022-03-23 10:25:19 +01:00
Alex 8fd6745745
Move block RC code to separate `rc.rs` 2022-03-23 10:25:19 +01:00
Alex c3982a90b6
Move DataBlock out of manager.rs 2022-03-23 10:25:19 +01:00
Alex c1d9854d2c
Move block manager to separate module 2022-03-23 10:25:15 +01:00
trinity-1686a 8565f7dc31 cleanup
continuous-integration/drone/push Build is passing Details
2022-03-23 10:22:37 +01:00
trinity-1686a 8db6b84559 add test for create bucket and put website with streaming signature 2022-03-23 10:22:37 +01:00
trinity-1686a 1eb7fdb08f add test framework for arbitraty S3 requests
and implement some basic test with it
2022-03-23 10:22:36 +01:00
Jill e934934f14 garage_api: Update streaming payload stream unit tests 2022-03-23 10:22:36 +01:00
Jill 98545a16dd garage_api: Handle streaming payload early in request handling 2022-03-23 10:22:36 +01:00
Alex 822128e3c8 Talk a bit about capacity balancing between regions
continuous-integration/drone/push Build is passing Details
2022-03-22 12:07:13 +01:00
Rune Henriksen aea8b41728 document request routing logic
continuous-integration/drone/push Build is passing Details
2022-03-21 12:03:57 +01:00
Rune Henriksen 71e6645e09 add short tutorial for duplicati usage with garage
continuous-integration/drone/push Build is passing Details
2022-03-21 11:58:19 +01:00
Steam 15da2156f6 Change position of the node-id argument
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-19 18:03:23 +01:00
Quentin 0529f3c34d Patch cargo2nix openssl override
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-17 12:17:38 +01:00
Alex db46cdef79
Update netapp to v0.4.1
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-15 17:09:57 +01:00
Alex ba6b56ae68
Fix some new clippy lints
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-14 12:27:49 +01:00
Alex 0af314b295
Add comment for fsync
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build was killed Details
2022-03-14 11:54:00 +01:00
Alex d78bf379fb
Fix resync queue to not drop items
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-03-14 11:51:37 +01:00
Alex f7e6f4616f
Spawn a single resync worker 2022-03-14 11:51:37 +01:00
Alex dc5ec4ecf9
Add appropriate fsync() calls in write_block
to ensure that data is persisted properly
2022-03-14 11:51:32 +01:00
Alex fe62d01b7e
Implement exponential backoff for resync retries
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-03-14 11:41:20 +01:00
Alex bfb4353df5
Update Grafana dashboard
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-14 10:55:30 +01:00
Alex 9b2b531f4d
Make admin server optional
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details
2022-03-14 10:54:25 +01:00
Alex a19341b188
Add Grafana dashboard for Garage 2022-03-14 10:54:25 +01:00
Alex 2377a92f6b
Add wrapper over sled tree to count items (used for big queues) 2022-03-14 10:54:25 +01:00
Alex 203e8d2c34
Bump version to 0.7 because of incompatible Netapp 2022-03-14 10:54:24 +01:00
Alex f869ca625d
Add spans to table calls, change span names in RPC 2022-03-14 10:54:12 +01:00
Alex 0cc31ee169
add missing netapp telemetry feature 2022-03-14 10:54:11 +01:00
Alex dc8d0496cc
Refactoring: rename config files, make modifications less invasive 2022-03-14 10:53:51 +01:00
Alex d9a35359bf
Add metrics to web endpoint 2022-03-14 10:53:50 +01:00
Alex 2a5609b292
Add metrics to API endpoint 2022-03-14 10:53:36 +01:00
Alex 818daa5c78
Refactor how durations are measured 2022-03-14 10:53:35 +01:00
Alex f0d0cd9a20
Remove strum crate dependency; add protobuf nix dependency 2022-03-14 10:53:00 +01:00
Alex 55d4471599
Remove ... at end of hex IDs 2022-03-14 10:52:31 +01:00
Alex bb04d94fa9
Update to Netapp 0.4 which supports distributed tracing 2022-03-14 10:52:30 +01:00
Alex 8c2fb0c066
Add tracing integration with opentelemetry 2022-03-14 10:52:13 +01:00
Maximilien b6561f6e1b
Add docker-compose for traces & metrics 2022-03-14 10:51:52 +01:00
Alex 2cab84b1fe
Add many metrics in table/ and rpc/ 2022-03-14 10:51:50 +01:00
Maximilien R 1e2cf26373
Implement basic metrics in table 2022-03-14 10:51:17 +01:00
mricher e349af13a7
Update dependencies and add admin module with metrics
- Global dependencies updated in Cargo.lock
- New module created in src/admin to host:
  - the (future) admin REST API
  - the metric collection
- add configuration block

No metrics implemented yet
2022-03-14 10:51:12 +01:00
Max Audron 9d44127245
add support for kubernetes service discovery
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
This commit adds support to discover garage instances running in
kubernetes.

Once enabled by setting `kubernetes_namespace` and
`kubernetes_service_name` garage will create a Custom Resources
`garagenodes.deuxfleurs.fr` with nodes public key as the resource name.
and IP and Port information as spec in the namespace configured by
`kubernetes_namespace`.

For discovering nodes the resources are filtered with the optionally set
`kubernetes_service_name` which sets a label
`garage.deuxfleurs.fr/service` on the resources.

This allows to separate multiple garage deployments in a single
namespace.

the `kubernetes_skip_crd` variable allows to disable the creation of the
CRD by garage itself. The user must deploy this manually.
2022-03-12 13:05:52 +01:00
Quentin c00b2c9948 Functional tests for admin commands
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-07 17:32:07 +01:00
Quentin 8df1e186de Functional tests for website endpoints 2022-03-07 17:32:07 +01:00
Quentin 2ef60b8417 Functional test for multipart endpoints 2022-03-07 17:32:07 +01:00
Quentin 1e639ec67c Functional test for ListMultipartUploads 2022-03-07 17:32:07 +01:00
Quentin cfea1e0315 Functional tests for bucket endpoints 2022-03-07 17:32:02 +01:00
Quentin 05eb79929e Functional tests for object operations 2022-03-07 17:05:10 +01:00
Quentin 0f4e0e8bb9 Move ListObjects tests to Rust 2022-03-07 17:05:10 +01:00
Quentin 2a3afcaf65 Test WinSCP
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-03-03 14:29:10 +01:00
Alex 8a5bbc3b0b
More permissive OPTIONS on S3 API
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
2022-03-01 11:15:16 +01:00
Alex 97f245f218
Add tracing output to signature calculation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-28 12:22:39 +01:00
Alex 8129a98291
Process CORS earlier in pipeline 2022-02-28 12:22:39 +01:00
Quentin 54e02b4c3b Force static builds for all platforms
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-24 16:12:37 +01:00
trinity-1686a f6f8b7f1ad Support for PostObject (#222)
continuous-integration/drone/push Build is passing Details
Add support for [PostObject](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html)

- [x] routing PostObject properly
- [x] parsing multipart body
- [x] validating signature
- [x] validating policy
- [x] validating content length
- [x] actually saving data

Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr>
Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #222
Reviewed-by: Alex <alex@adnab.me>
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2022-02-21 23:02:30 +01:00
Alex e312ba977e
Add FOSDEM talk and move all .pdf files to Git LFS
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-16 20:01:36 +01:00
Alex 2465163e39
documentation: add mention to install build-essential
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-02-16 12:18:24 +01:00
Jill 84613e66a2
garage(tests): Remove RNG stuff
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-11 10:50:55 +01:00
Jill c8b30ebc79
garage(tests): Remove superfluous test 2022-02-10 17:55:51 +01:00
Jill d7decda3f4
garage(tests): Add random suffix to created buckets. 2022-02-10 17:55:50 +01:00
Jill cd13ea461b
garage(tests): Add some unsafe-usage doc and tweaks 2022-02-10 17:55:50 +01:00
Quentin 5d19f3d2d7
Add integration tests to Drone 2022-02-10 17:55:50 +01:00
Quentin 084dcdbd3a
Upgrade cargo2nix 2022-02-10 17:55:50 +01:00
Jill 3baa841d6f
tests: Fix garage integration test 2022-02-10 17:55:49 +01:00
Jill dd407e7041
tests: Add garage integration tests (base) 2022-02-10 17:55:49 +01:00
Alex af261e1789 Fix a bug when a migration is followed by a rebalance
continuous-integration/drone/push Build is passing Details
Nodes would stabilize on different encoding formats for the values,
some having the pre-migration format and some having the post-migration
format. This would be reflected in the Merkle trees never converging
and thus having an infinite resync loop.
2022-02-10 17:38:27 +01:00
Alex 4ae03aa774 Small documentation updates (#237)
continuous-integration/drone/push Build is passing Details
Fixes #234, among other things

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #237
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-02-10 15:58:09 +01:00
Quentin 3e1373fafc Add a new S3 comparison Matrix to documentation (#220)
continuous-integration/drone/push Build is passing Details
Co-authored-by: Quentin Dufour <quentin@deuxfleurs.fr>
Reviewed-on: #220
Co-authored-by: Quentin <quentin@dufour.io>
Co-committed-by: Quentin <quentin@dufour.io>
2022-02-07 16:04:52 +01:00
Alex 7d68b7060e
Fix anchors in links
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-07 16:01:48 +01:00
Quentin 99ed67503c
Update quickstart to set endpoints ending in localhost 2022-02-07 16:01:48 +01:00
Quentin 5a1fb7cce7
Improve integration part of the doc 2022-02-07 16:01:45 +01:00
Alex 1c0ba930b8 Reorganize documentation for new website (#213)
continuous-integration/drone/push Build is passing Details
This PR should be merged after the new website is deployed.

- [x] Rename files
- [x] Add front matter section to all `.md` files in the book (necessary for Zola)
- [x] Change all internal links to use Zola's linking system that checks broken links
- [x] Some updates to documentation contents and organization

Co-authored-by: Alex Auvolat <alex@adnab.me>
Reviewed-on: #213
Co-authored-by: Alex <alex@adnab.me>
Co-committed-by: Alex <alex@adnab.me>
2022-02-07 11:51:12 +01:00
Alex 45d6d377d2
Remove website publishing (new website is now online)
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-06 09:25:04 +01:00
Quentin 6f7ef11537 Generate and upload a JSON result
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-02-05 22:09:43 +01:00
Alex 241db1e1f5 Add URL field to JSON builds 2022-02-05 22:09:43 +01:00
Quentin ecd76977ea Generate JSON build description 2022-02-05 22:09:43 +01:00
Alex 935670690f
Probably fix test-smoke
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
2022-02-02 17:34:19 +01:00
Alex ae2f32baf1
Hide deleted key in bucket info (fix #211)
continuous-integration/drone/push Build is failing Details
2022-02-02 17:12:48 +01:00
Quentin f67029ce2a Improve testing conf + test CORS
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is failing Details
2022-02-01 17:55:14 +01:00
Alex 2760f1cb17
Add advice about --fast-list
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build encountered an error Details
2022-01-31 16:51:39 +01:00
Alex 26849ed066
Add step to 0.6.0 migration guide
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-27 14:31:25 +01:00
Alex c99f55c420
Add restriction on part ordering in CompleteMultipartUpload
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
2022-01-25 12:45:00 +01:00
Alex acdf893362
Fix partnumber 2022-01-25 12:25:23 +01:00
Alex 338b1b83ee
Implement part_number for GetObject
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-24 21:04:42 +01:00
Alex 6dab836f3a
Multipart improvements
- support part_number for HeadObject
- add checks in complete_multipart_upload
2022-01-24 21:04:40 +01:00
Alex 513a6b15f9
Handle OPTIONS on website endpoint
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-24 12:32:28 +01:00
Alex ea7fb901eb
Implement {Put,Get,Delete}BucketCors and CORS in general
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
- OPTIONS request against API endpoint
- Returning corresponding CORS headers on API calls
- Returning corresponding CORS headers on website GET's
2022-01-24 11:58:00 +01:00
Trinity Pointard 820924534a use clamp instead of min(max())
continuous-integration/drone/push Build is passing Details
2022-01-24 11:56:59 +01:00
Quentin 94f0e7c135 Test ListParts endpoint with awscli
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-21 10:42:35 +01:00
Quentin 440374524b Implement ListParts 2022-01-21 10:42:30 +01:00
Quentin fe003d6fbc Add ListPartsResult structure 2022-01-20 16:38:55 +01:00
trinity-1686a e55fa38c99 Add date verification to presigned urls (#196)
continuous-integration/drone/push Build is passing Details
fix #96
fix #162 by returning Forbidden instead Bad Request

Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #196
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2022-01-18 12:22:31 +01:00
trinity-1686a 178e35f868 refactor s3_router and api_server to make unused Endpoint parameters more obvious
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-17 15:50:24 +01:00
Alex 7c049f1c94 Fix extreme value to be less extreme so that integration test works on 32bits
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-01-17 12:56:29 +01:00
Jill fdcddbe168 Fix Multipart Upload with WinSCP (#164) (#193)
continuous-integration/drone/push Build is passing Details
Closes #164.

Reviewed-on: #193
Co-authored-by: Jill <kokakiwi@deuxfleurs.fr>
Co-committed-by: Jill <kokakiwi@deuxfleurs.fr>
2022-01-17 11:18:40 +01:00
Jill b45dcc1925 Support STREAMING-AWS4-HMAC-SHA256-PAYLOAD (#64) (#156)
continuous-integration/drone/push Build is passing Details
Closes #64.

Reviewed-on: #156
Co-authored-by: Jill <kokakiwi@deuxfleurs.fr>
Co-committed-by: Jill <kokakiwi@deuxfleurs.fr>
2022-01-17 10:55:31 +01:00
Alex 60c0033c8b
Update documentation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build encountered an error Details
2022-01-13 14:25:22 +01:00
Alex d4dd2e2640
Make use of website config, return error document on error 2022-01-13 14:25:19 +01:00
Alex 9eb211948e
Allow setting index document and error document on the CLI 2022-01-13 14:25:19 +01:00
Alex 3ea8ca1b9e
Implement GetBucketWebsite 2022-01-13 14:23:52 +01:00
Alex f7349f4005
Add quotes in returned etags
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-13 14:03:33 +01:00
Alex 1ee8f596ee
Testing for UploadPartCopies and bugfixes in AWS signatures 2022-01-13 14:03:30 +01:00
Alex 6617a72220
Implement UploadPartCopy 2022-01-13 13:58:47 +01:00
Alex 3770a34e3d
Implement x-amz-copy-if-xxx copy preconditions and return more headers on copy (fix #187) 2022-01-13 13:56:55 +01:00
Quentin b4592a00fe Implement ListMultipartUploads (#171)
continuous-integration/drone/push Build is passing Details
Implement ListMultipartUploads, also refactor ListObjects and ListObjectsV2.

It took me some times as I wanted to propose the following things:
  - Using an iterator instead of the loop+goto pattern. I find it easier to read and it should enable some optimizations. For example, when consuming keys of a common prefix, we do many [redundant checks](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/api/s3_list.rs#L125-L156) while the only thing to do is to [check if the following key is still part of the common prefix](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/feature/s3-multipart-compat/src/api/s3_list.rs#L476).
  - Try to name things (see ExtractionResult and RangeBegin enums) and to separate concerns (see ListQuery and Accumulator)
  - An IO closure to make unit tests possibles.
  - Unit tests, to track regressions and document how to interact with the code
  - Integration tests with `s3api`. In the future, I would like to move them in Rust with the aws rust SDK.

Merging of the logic of ListMultipartUploads and ListObjects was not a goal but a consequence of the previous modifications.

Some points that we might want to discuss:
  - ListObjectsV1, when using pagination and delimiters, has a weird behavior (it lists multiple times the same prefix) with `aws s3api` due to the fact that it can not use our optimization to skip the whole prefix. It is independant from my refactor and can be tested with the commented `s3api` tests in `test-smoke.sh`. It probably has the same weird behavior on the official AWS S3 implementation.
  - Considering ListMultipartUploads, I had to "abuse" upload id marker to support prefix skipping. I send an `upload-id-marker` with the hardcoded value `include` to emulate your "including" token.
  - Some ways to test ListMultipartUploads with existing software (my tests are limited to s3api for now).

Co-authored-by: Quentin Dufour <quentin@deuxfleurs.fr>
Reviewed-on: #171
Co-authored-by: Quentin <quentin@dufour.io>
Co-committed-by: Quentin <quentin@dufour.io>
2022-01-12 19:04:55 +01:00
Alex 9cb2e9e57c
Add documentation to migrate to 0.6
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-01-10 14:42:58 +01:00
Alex 3586c7257c
Clarify error message
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-10 14:10:04 +01:00
Alex 17ea28a438
Fix trivial bug in CLI
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
2022-01-10 12:38:33 +01:00
Alex 8f39360f22
Update documentation
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2022-01-07 17:14:37 +01:00
Alex 7ee11f0eb6
Fix unit tests
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-05 17:34:48 +01:00
Alex 168a90dfb5
Fix some error codes
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-01-05 17:07:36 +01:00
Alex fb1e31add0
Small CLI changes
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
2022-01-05 16:28:46 +01:00
Alex 135858d067
Implement DeleteBucket 2022-01-05 16:28:19 +01:00
Alex 8395030e48
Implement CreateBucket
continuous-integration/drone/push Build is failing Details
2022-01-05 15:56:48 +01:00
Alex 9431090b1e
Implement key allow|deny --create-bucket
continuous-integration/drone/push Build is failing Details
2022-01-05 15:12:59 +01:00
Alex 677ab60cc1
Small changes in key model and refactoring
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-04 18:59:17 +01:00
Alex df35feba18
New buckets for 0.6.0: make bucket id a SK and not a HK, CLI updates
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2022-01-04 12:53:14 +01:00
Alex 1bcd6fabbd
New buckets for 0.6.0: small changes
- Fix bucket delete

- fix merge of bucket creation date

- Replace deletable with option in aliases
    Rationale: if two aliases point to conflicting bucket, resolving
    by making an arbitrary choice risks making data accessible when it
    shouldn't be. We'd rather resolve to deleting the alias until
    someone puts it back.
2022-01-04 12:52:47 +01:00
Alex ba7f268b99
Rename and change query filters 2022-01-04 12:52:46 +01:00
Alex de37658b94
Hopefully fix Nix build 2022-01-04 12:52:46 +01:00
Alex e59c23a69d
Refactor logic for setting/unsetting aliases 2022-01-04 12:52:46 +01:00
Alex 2140cd7205
Remove website redirects 2022-01-04 12:52:46 +01:00
Alex beeef4758e
Some movement of helper code and refactoring of error handling 2022-01-04 12:52:46 +01:00
Alex d8ab5bdc3e
New buckets for 0.6.0: fix model and migration 2022-01-04 12:47:28 +01:00
Alex c7d5c73244
Add must_use to some CRDT functions 2022-01-04 12:47:28 +01:00
Alex b76d0580a0
Fix forgotten flag 2022-01-04 12:47:28 +01:00
Alex 87121dce9d
New buckets for 0.6.0: documentation and build files 2022-01-04 12:47:06 +01:00
Alex b1cfd16913
New buckets for 0.6.0: small fixes, including:
- ensure bucket names are correct aws s3 names
- when making aliases, ensure timestamps of links in both ways are the
  same
- fix small remarks by trinity
- don't have a separate website_access field
2022-01-04 12:46:41 +01:00
Alex 5db600e231
More complete output to bucket info and key info 2022-01-04 12:46:41 +01:00
Alex 4d30e62db4
New buckets for 0.6.0: migration code and build files 2022-01-04 12:46:13 +01:00
Alex 0bbb6673e7
Model changes 2022-01-04 12:45:52 +01:00
Alex 53f71b3a57
Implement bucket alias and bucket unalias 2022-01-04 12:45:51 +01:00
Alex 5b1117e582
New model for buckets 2022-01-04 12:45:46 +01:00
Alex 8f6026de5e
Make table name a const in trait 2021-12-15 15:39:10 +01:00
trinity-1686a 945b75dbf1 update s3 compatibility list (#177)
continuous-integration/drone/push Build is passing Details
Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #177
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2021-12-15 15:05:54 +01:00
trinity-1686a ca7b438f3f less strict ListBuckets (#178)
continuous-integration/drone/push Build is passing Details
fix #175

Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #178
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2021-12-15 15:05:36 +01:00
trinity-1686a 1eb972b1ac Add compression using zstd (#173)
continuous-integration/drone/push Build is passing Details
fix #27

Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #173
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2021-12-15 11:26:43 +01:00
trinity-1686a 60d4459926 BucketWebsite (#174)
continuous-integration/drone/push Build is passing Details
fix #77

this does not store anything but a on/off switch for website, and does not implement GetBucketWebsite as it would require storing more. GetBucketWebsite should be pretty easy to implement once data is stored though.

Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #174
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2021-12-15 10:41:39 +01:00
Quentin 3b3a1f275f
Add a second plot
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-12-13 11:58:03 +01:00
Quentin dba9af2968
Update benchmark
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-12-09 18:42:45 +01:00
Quentin e9358054ac
Typos and dead links
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-12-08 14:40:14 +01:00
Quentin f9e5520ffb
Add a benchmark page with a first benchmark
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-12-08 11:30:07 +01:00
Alex 4b369347c0
S3 compatibility target
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build encountered an error Details
2021-12-06 17:18:45 +01:00
Alex 224c89ad6e
Reorganize and improve documentation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-12-06 16:33:01 +01:00
Quentin 7c2037ba87
WIP front page garage 2021-12-06 15:33:43 +01:00
trinity-1686a c4ac8835d3 add proper request router for s3 api (#163)
continuous-integration/drone/push Build is passing Details
fix #161

Current request router was organically grown, and is getting messier and messier with each addition.
This router cover exaustively existing API endpoints (with exceptions listed in [#161(comment)](#161 (comment)) either because new and old api endpoint can't feasabily be differentied, or it's more lambda than s3).

Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #163
Reviewed-by: Alex <alex@adnab.me>
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2021-12-06 15:17:47 +01:00
Alex ccce75bc25
Remove TODO and genkeys.sh
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-12-06 13:15:50 +01:00
trinity-1686a 7f26ed55cd Improved handling of HTTP ranges
continuous-integration/drone/push Build is failing Details
- correct HTTP code when range syntax is invalid (fix #140)
- when multiple ranges are given, simply ignore and send whole file

Co-authored-by: Trinity Pointard <trinity.pointard@gmail.com>
Reviewed-on: #157
Reviewed-by: Alex <alex@adnab.me>
Co-authored-by: trinity-1686a <trinity.pointard@gmail.com>
Co-committed-by: trinity-1686a <trinity.pointard@gmail.com>
2021-11-29 11:52:42 +01:00
Quentin 8811bb08e6
In ListBuckets, hide entry if no perms
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
2021-11-22 12:10:28 +01:00
Quentin 85b2e4ca29
Start socat only once
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone Build is passing Details
Fixes #124
2021-11-17 10:59:32 +01:00
Alex c94406f428
Improve how node roles are assigned in Garage
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
- change the terminology: the network configuration becomes the role
  table, the configuration of a nodes becomes a node's role
- the modification of the role table takes place in two steps: first,
  changes are staged in a CRDT data structure. Then, once the user is
  happy with the changes, they can commit them all at once (or revert
  them).
- update documentation
- fix tests
- implement smarter partition assignation algorithm

This patch breaks the format of the network configuration: when
migrating, the cluster will be in a state where no roles are assigned.
All roles must be re-assigned and commited at once. This migration
should not pose an issue.
2021-11-16 16:05:53 +01:00
Trinity Pointard 53888995bd update doc and comments
continuous-integration/drone/push Build is passing Details
2021-11-16 15:41:41 +01:00
Trinity Pointard f0893b904d update cargo.nix 2021-11-16 15:41:41 +01:00
Trinity Pointard 396fe4c702 clippy 2021-11-16 15:41:41 +01:00
Trinity Pointard 02158ee666 fix issue where list on vhost-bucket would list bucket instead of bucket content 2021-11-16 15:41:41 +01:00
Trinity Pointard 57df9c6e2d add s3_api.root_domain to doc book 2021-11-16 15:41:41 +01:00
Trinity Pointard 9c58ec28d3 add support for vhost-style s3 bucket 2021-11-16 15:41:41 +01:00
adrien cdeb5b4dbb added link to RFID Garage talk (#155)
continuous-integration/drone/push Build is passing Details
Co-authored-by: ADRN <adrien@luxeylab.net>
Reviewed-on: #155
Co-authored-by: adrien <adrien@luxeylab.net>
Co-committed-by: adrien <adrien@luxeylab.net>
2021-11-16 15:39:08 +01:00
Quentin 100aad8bf4
Add rclone mount doc
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2021-11-10 18:38:17 +01:00
Quentin 80a87929b0
Improve CLI documentation
continuous-integration/drone/push Build is passing Details
2021-11-10 18:18:34 +01:00
Quentin 76d21be1b9
Add skeleton for backups, fuse and code sections
continuous-integration/drone/push Build is passing Details
2021-11-10 18:05:07 +01:00
Quentin 1928f59d54
Add documentation for Gitea.
continuous-integration/drone/push Build is passing Details
2021-11-10 12:41:09 +01:00
Quentin 323514be15
Documentation for Nix binary cache 2021-11-10 10:02:22 +01:00
Quentin ad8d5139cf
hugo deploy does not build website, fix doc 2021-11-10 10:02:22 +01:00
769 changed files with 160492 additions and 11719 deletions

3
.cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

View File

@ -1,516 +0,0 @@
---
kind: pipeline
name: default
workspace:
base: /drone/garage
volumes:
- name: nix_store
host:
path: /var/lib/drone/nix
- name: nix_config
temp: {}
environment:
HOME: /drone/garage
steps:
- name: setup nix
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- cp nix/nix.conf /etc/nix/nix.conf
- nix-build --no-build-output --no-out-link shell.nix --arg release false -A inputDerivation
- name: code quality
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-shell --arg release false --run "cargo fmt -- --check"
- nix-shell --arg release false --run "cargo clippy -- --deny warnings"
- name: build
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-build --no-build-output --argstr target x86_64-unknown-linux-musl --arg release false --argstr git_version $DRONE_COMMIT
- name: unit tests
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- |
nix-build \
--no-build-output \
--argstr target x86_64-unknown-linux-musl \
--argstr compileMode test
- ./result*/bin/garage_api*
- ./result*/bin/garage_model*
- ./result*/bin/garage_rpc*
- ./result*/bin/garage_table*
- ./result*/bin/garage_util*
- ./result*/bin/garage_web*
- ./result*/bin/garage*
- name: smoke-test
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-build --no-build-output --argstr target x86_64-unknown-linux-musl --arg release false --argstr git_version $DRONE_COMMIT
- nix-shell --arg release false --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
trigger:
event:
- custom
- push
- pull_request
- tag
- cron
node:
nix: 1
---
kind: pipeline
name: website
steps:
- name: build
image: hrektts/mdbook
commands:
- cd doc/book
- mdbook build
- name: upload
image: plugins/s3
settings:
bucket: garagehq.deuxfleurs.fr
access_key:
from_secret: garagehq_aws_access_key_id
secret_key:
from_secret: garagehq_aws_secret_access_key
source: doc/book/book/**/*
strip_prefix: doc/book/book/
target: /
path_style: true
endpoint: https://garage.deuxfleurs.fr
region: garage
when:
event:
- push
branch:
- main
repo:
- Deuxfleurs/garage
trigger:
event:
- custom
- push
- pull_request
node:
nix: 1
---
kind: pipeline
type: docker
name: release-linux-x86_64
volumes:
- name: nix_store
host:
path: /var/lib/drone/nix
- name: nix_config
temp: {}
environment:
TARGET: x86_64-unknown-linux-musl
steps:
- name: setup nix
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- cp nix/nix.conf /etc/nix/nix.conf
- nix-build --no-build-output --no-out-link shell.nix -A inputDerivation
- name: build
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
- name: integration
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-shell --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
- name: push static binary
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
AWS_ACCESS_KEY_ID:
from_secret: garagehq_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: garagehq_aws_secret_access_key
commands:
- nix-shell --arg rust false --arg integration false --run "to_s3"
- name: docker build and publish
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
DOCKER_AUTH:
from_secret: docker_auth
DOCKER_PLATFORM: "linux/amd64"
CONTAINER_NAME: "dxflrs/amd64_garage"
HOME: "/kaniko"
commands:
- mkdir -p /kaniko/.docker
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
- nix-shell --arg rust false --arg integration false --run "to_docker"
trigger:
event:
- promote
- cron
node:
nix: 1
---
kind: pipeline
type: docker
name: release-linux-i686
volumes:
- name: nix_store
host:
path: /var/lib/drone/nix
- name: nix_config
temp: {}
environment:
TARGET: i686-unknown-linux-musl
steps:
- name: setup nix
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- cp nix/nix.conf /etc/nix/nix.conf
- nix-build --no-build-output --no-out-link shell.nix -A inputDerivation
- name: build
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
- name: integration
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-shell --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
- name: push static binary
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
AWS_ACCESS_KEY_ID:
from_secret: garagehq_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: garagehq_aws_secret_access_key
commands:
- nix-shell --arg rust false --arg integration false --run "to_s3"
- name: docker build and publish
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
DOCKER_AUTH:
from_secret: docker_auth
DOCKER_PLATFORM: "linux/386"
CONTAINER_NAME: "dxflrs/386_garage"
HOME: "/kaniko"
commands:
- mkdir -p /kaniko/.docker
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
- nix-shell --arg rust false --arg integration false --run "to_docker"
trigger:
event:
- promote
- cron
node:
nix: 1
---
kind: pipeline
type: docker
name: release-linux-aarch64
volumes:
- name: nix_store
host:
path: /var/lib/drone/nix
- name: nix_config
temp: {}
environment:
TARGET: aarch64-unknown-linux-musl
steps:
- name: setup nix
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- cp nix/nix.conf /etc/nix/nix.conf
- nix-build --no-build-output --no-out-link ./shell.nix --arg rust false --arg integration false -A inputDerivation
- name: build
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
- name: push static binary
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
AWS_ACCESS_KEY_ID:
from_secret: garagehq_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: garagehq_aws_secret_access_key
commands:
- nix-shell --arg rust false --arg integration false --run "to_s3"
- name: docker build and publish
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
DOCKER_AUTH:
from_secret: docker_auth
DOCKER_PLATFORM: "linux/arm64"
CONTAINER_NAME: "dxflrs/arm64_garage"
HOME: "/kaniko"
commands:
- mkdir -p /kaniko/.docker
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
- nix-shell --arg rust false --arg integration false --run "to_docker"
trigger:
event:
- promote
- cron
node:
nix: 1
---
kind: pipeline
type: docker
name: release-linux-armv6l
volumes:
- name: nix_store
host:
path: /var/lib/drone/nix
- name: nix_config
temp: {}
environment:
TARGET: armv6l-unknown-linux-musleabihf
steps:
- name: setup nix
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- cp nix/nix.conf /etc/nix/nix.conf
- nix-build --no-build-output --no-out-link --arg rust false --arg integration false -A inputDerivation
- name: build
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
commands:
- nix-build --no-build-output --argstr target $TARGET --arg release true --argstr git_version $DRONE_COMMIT
- name: push static binary
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
AWS_ACCESS_KEY_ID:
from_secret: garagehq_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: garagehq_aws_secret_access_key
commands:
- nix-shell --arg integration false --arg rust false --run "to_s3"
- name: docker build and publish
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
- name: nix_config
path: /etc/nix
environment:
DOCKER_AUTH:
from_secret: docker_auth
DOCKER_PLATFORM: "linux/arm"
CONTAINER_NAME: "dxflrs/arm_garage"
HOME: "/kaniko"
commands:
- mkdir -p /kaniko/.docker
- echo $DOCKER_AUTH > /kaniko/.docker/config.json
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
- nix-shell --arg rust false --arg integration false --run "to_docker"
trigger:
event:
- promote
- cron
node:
nix: 1
---
kind: pipeline
type: docker
name: refresh-release-page
volumes:
- name: nix_store
host:
path: /var/lib/drone/nix
steps:
- name: refresh-index
image: nixpkgs/nix:nixos-21.05
volumes:
- name: nix_store
path: /nix
environment:
AWS_ACCESS_KEY_ID:
from_secret: garagehq_aws_access_key_id
AWS_SECRET_ACCESS_KEY:
from_secret: garagehq_aws_secret_access_key
commands:
- mkdir -p /etc/nix && cp nix/nix.conf /etc/nix/nix.conf
- nix-shell --arg integration false --arg rust false --run "refresh_index"
depends_on:
- release-linux-x86_64
- release-linux-i686
- release-linux-aarch64
- release-linux-armv6l
trigger:
event:
- promote
- cron
node:
nix: 1
---
kind: signature
hmac: 1c33490cc2902564c4250a409c156683d0d549b8c9d5aee4e46d1bde4e0ccf2c
...

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/pki
**/*.rs.bk
*.swp
/.direnv

48
.woodpecker/debug.yaml Normal file
View File

@ -0,0 +1,48 @@
when:
event:
- push
- tag
- pull_request
- deployment
- cron
steps:
- name: check formatting
image: nixpkgs/nix:nixos-22.05
commands:
- nix-shell --attr devShell --run "cargo fmt -- --check"
- name: build
image: nixpkgs/nix:nixos-22.05
commands:
- nix-build --no-build-output --attr clippy.amd64 --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- name: unit + func tests
image: nixpkgs/nix:nixos-22.05
environment:
GARAGE_TEST_INTEGRATION_EXE: result-bin/bin/garage
GARAGE_TEST_INTEGRATION_PATH: tmp-garage-integration
commands:
- nix-build --no-build-output --attr clippy.amd64 --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- nix-build --no-build-output --attr test.amd64
- ./result/bin/garage_db-*
- ./result/bin/garage_api-*
- ./result/bin/garage_model-*
- ./result/bin/garage_rpc-*
- ./result/bin/garage_table-*
- ./result/bin/garage_util-*
- ./result/bin/garage_web-*
- ./result/bin/garage-*
- GARAGE_TEST_INTEGRATION_DB_ENGINE=sled ./result/bin/integration-* || (cat tmp-garage-integration/stderr.log; false)
- nix-shell --attr ci --run "killall -9 garage" || true
- GARAGE_TEST_INTEGRATION_DB_ENGINE=lmdb ./result/bin/integration-* || (cat tmp-garage-integration/stderr.log; false)
- nix-shell --attr ci --run "killall -9 garage" || true
- GARAGE_TEST_INTEGRATION_DB_ENGINE=sqlite ./result/bin/integration-* || (cat tmp-garage-integration/stderr.log; false)
- rm result
- rm -rv tmp-garage-integration
- name: integration tests
image: nixpkgs/nix:nixos-22.05
commands:
- nix-build --no-build-output --attr clippy.amd64 --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- nix-shell --attr ci --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)

29
.woodpecker/publish.yaml Normal file
View File

@ -0,0 +1,29 @@
when:
event:
- deployment
- cron
depends_on:
- release
steps:
- name: refresh-index
image: nixpkgs/nix:nixos-22.05
secrets:
- source: garagehq_aws_access_key_id
target: AWS_ACCESS_KEY_ID
- source: garagehq_aws_secret_access_key
target: AWS_SECRET_ACCESS_KEY
commands:
- mkdir -p /etc/nix && cp nix/nix.conf /etc/nix/nix.conf
- nix-shell --attr ci --run "refresh_index"
- name: multiarch-docker
image: nixpkgs/nix:nixos-22.05
secrets:
- docker_auth
commands:
- mkdir -p /root/.docker
- echo $DOCKER_AUTH > /root/.docker/config.json
- export CONTAINER_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- nix-shell --attr ci --run "multiarch_docker"

70
.woodpecker/release.yaml Normal file
View File

@ -0,0 +1,70 @@
when:
event:
- deployment
- cron
matrix:
include:
- ARCH: amd64
TARGET: x86_64-unknown-linux-musl
- ARCH: i386
TARGET: i686-unknown-linux-musl
- ARCH: arm64
TARGET: aarch64-unknown-linux-musl
- ARCH: arm
TARGET: armv6l-unknown-linux-musleabihf
steps:
- name: build
image: nixpkgs/nix:nixos-22.05
commands:
- nix-build --no-build-output --attr pkgs.${ARCH}.release --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- name: check is static binary
image: nixpkgs/nix:nixos-22.05
commands:
- nix-build --no-build-output --attr pkgs.${ARCH}.release --argstr git_version ${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- nix-shell --attr ci --run "./script/not-dynamic.sh result-bin/bin/garage"
- name: integration tests
image: nixpkgs/nix:nixos-22.05
commands:
- nix-shell --attr ci --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
when:
- matrix:
ARCH: amd64
- matrix:
ARCH: i386
- name: upgrade tests
image: nixpkgs/nix:nixos-22.05
commands:
- nix-shell --attr ci --run "./script/test-upgrade.sh v0.8.4 x86_64-unknown-linux-musl" || (cat /tmp/garage.log; false)
when:
- matrix:
ARCH: amd64
- name: push static binary
image: nixpkgs/nix:nixos-22.05
environment:
TARGET: "${TARGET}"
secrets:
- source: garagehq_aws_access_key_id
target: AWS_ACCESS_KEY_ID
- source: garagehq_aws_secret_access_key
target: AWS_SECRET_ACCESS_KEY
commands:
- nix-shell --attr ci --run "to_s3"
- name: docker build and publish
image: nixpkgs/nix:nixos-22.05
environment:
DOCKER_PLATFORM: "linux/${ARCH}"
CONTAINER_NAME: "dxflrs/${ARCH}_garage"
secrets:
- docker_auth
commands:
- mkdir -p /root/.docker
- echo $DOCKER_AUTH > /root/.docker/config.json
- export CONTAINER_TAG=${CI_COMMIT_TAG:-$CI_COMMIT_SHA}
- nix-shell --attr ci --run "to_docker"

4234
Cargo.lock generated

File diff suppressed because it is too large Load Diff

7000
Cargo.nix

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,148 @@
[workspace]
resolver = "2"
members = [
"src/db",
"src/util",
"src/net",
"src/rpc",
"src/table",
"src/block",
"src/model",
"src/api",
"src/web",
"src/garage",
"src/k2v-client",
"src/format-table",
]
default-members = ["src/garage"]
[workspace.dependencies]
# Internal Garage crates
format_table = { version = "0.1.1", path = "src/format-table" }
garage_api = { version = "0.9.3", path = "src/api" }
garage_block = { version = "0.9.3", path = "src/block" }
garage_db = { version = "0.9.3", path = "src/db", default-features = false }
garage_model = { version = "0.9.3", path = "src/model", default-features = false }
garage_net = { version = "0.9.3", path = "src/net" }
garage_rpc = { version = "0.9.3", path = "src/rpc" }
garage_table = { version = "0.9.3", path = "src/table" }
garage_util = { version = "0.9.3", path = "src/util" }
garage_web = { version = "0.9.3", path = "src/web" }
k2v-client = { version = "0.0.4", path = "src/k2v-client" }
# External crates from crates.io
arc-swap = "1.0"
argon2 = "0.5"
async-trait = "0.1.7"
backtrace = "0.3"
base64 = "0.21"
blake2 = "0.10"
bytes = "1.0"
bytesize = "1.1"
cfg-if = "1.0"
chrono = "0.4"
crypto-common = "0.1"
digest = "0.10"
err-derive = "0.3"
gethostname = "0.4"
git-version = "0.3.4"
hex = "0.4"
hexdump = "0.1"
hmac = "0.12"
idna = "0.5"
itertools = "0.12"
lazy_static = "1.4"
md-5 = "0.10"
mktemp = "0.5"
nix = { version = "0.27", default-features = false, features = ["fs"] }
nom = "7.1"
parse_duration = "2.1"
pin-project = "1.0.12"
pnet_datalink = "0.34"
rand = "0.8"
sha2 = "0.10"
timeago = { version = "0.4", default-features = false }
xxhash-rust = { version = "0.8", default-features = false, features = ["xxh3"] }
sodiumoxide = { version = "0.2.5-0", package = "kuska-sodiumoxide" }
kuska-handshake = { version = "0.2.0", features = ["default", "async_std"] }
clap = { version = "4.1", features = ["derive", "env"] }
pretty_env_logger = "0.5"
structopt = { version = "0.3", default-features = false }
syslog-tracing = "0.3"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
heed = { version = "0.11", default-features = false, features = ["lmdb"] }
rusqlite = "0.31.0"
r2d2 = "0.8"
r2d2_sqlite = "0.24"
sled = "0.34"
async-compression = { version = "0.4", features = ["tokio", "zstd"] }
zstd = { version = "0.13", default-features = false }
quick-xml = { version = "0.26", features = [ "serialize" ] }
rmp-serde = "1.1.2"
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
serde_bytes = "0.11"
serde_json = "1.0"
toml = { version = "0.8", default-features = false, features = ["parse"] }
# newer version requires rust edition 2021
k8s-openapi = { version = "0.21", features = ["v1_24"] }
kube = { version = "0.88", default-features = false, features = ["runtime", "derive", "client", "rustls-tls"] }
schemars = "0.8"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls-manual-roots", "json"] }
form_urlencoded = "1.0.0"
http = "1.0"
httpdate = "1.0"
http-range = "0.1"
http-body-util = "0.1"
hyper = { version = "1.0", default-features = false }
hyper-util = { version = "0.1", features = [ "full" ] }
multer = "3.0"
percent-encoding = "2.2"
roxmltree = "0.19"
url = "2.3"
futures = "0.3"
futures-util = "0.3"
tokio = { version = "1.0", default-features = false, features = ["net", "rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
tokio-util = { version = "0.7", features = ["compat", "io"] }
tokio-stream = { version = "0.1", features = ["net"] }
opentelemetry = { version = "0.17", features = [ "rt-tokio", "metrics", "trace" ] }
opentelemetry-prometheus = "0.10"
opentelemetry-otlp = "0.10"
opentelemetry-contrib = "0.9"
prometheus = "0.13"
# used by the k2v-client crate only
aws-sigv4 = { version = "1.1" }
hyper-rustls = { version = "0.26", features = ["http2"] }
log = "0.4"
thiserror = "1.0"
# ---- used only as build / dev dependencies ----
assert-json-diff = "2.0"
rustc_version = "0.4.0"
static_init = "1.0"
aws-config = "1.1.4"
aws-sdk-config = "1.13"
aws-sdk-s3 = "1.14"
[profile.dev]
#lto = "thin" # disabled for now, adds 2-4 min to each CI build
lto = "off"
[profile.release]
debug = true
lto = true
codegen-units = 1
opt-level = "s"
strip = true

View File

@ -3,5 +3,5 @@ FROM scratch
ENV RUST_BACKTRACE=1
ENV RUST_LOG=garage=info
COPY result/bin/garage /
COPY result-bin/bin/garage /
CMD [ "/garage", "server"]

View File

@ -1,13 +1,27 @@
.PHONY: doc all release shell
.PHONY: doc all release shell run1 run2 run3
all:
clear; cargo build
doc:
cd doc/book; mdbook build
release:
nix-build --arg release true
nix-build --attr pkgs.amd64.release --no-build-output
shell:
nix-shell
# ----
run1:
RUST_LOG=garage=debug ./target/debug/garage -c tmp/config1.toml server
run1rel:
RUST_LOG=garage=debug ./target/release/garage -c tmp/config1.toml server
run2:
RUST_LOG=garage=debug ./target/debug/garage -c tmp/config2.toml server
run2rel:
RUST_LOG=garage=debug ./target/release/garage -c tmp/config2.toml server
run3:
RUST_LOG=garage=debug ./target/debug/garage -c tmp/config3.toml server
run3rel:
RUST_LOG=garage=debug ./target/release/garage -c tmp/config3.toml server

View File

@ -1,26 +1,38 @@
Garage [![Build Status](https://drone.deuxfleurs.fr/api/badges/Deuxfleurs/garage/status.svg?ref=refs/heads/main)](https://drone.deuxfleurs.fr/Deuxfleurs/garage)
Garage [![status-badge](https://woodpecker.deuxfleurs.fr/api/badges/1/status.svg)](https://woodpecker.deuxfleurs.fr/repos/1)
===
<p align="center" style="text-align:center;">
<a href="https://garagehq.deuxfleurs.fr">
<img alt="Garage logo" src="doc/logo/garage.png" height="200" />
<img alt="Garage logo" src="https://garagehq.deuxfleurs.fr/img/logo.svg" height="200" />
</a>
</p>
Garage is a lightweight S3-compatible distributed object store, with the following goals:
<p align="center" style="text-align:center;">
[ <strong><a href="https://garagehq.deuxfleurs.fr/">Website and documentation</a></strong>
| <a href="https://garagehq.deuxfleurs.fr/_releases.html">Binary releases</a>
| <a href="https://git.deuxfleurs.fr/Deuxfleurs/garage">Git repository</a>
| <a href="https://matrix.to/#/%23garage:deuxfleurs.fr">Matrix channel</a>
]
</p>
- As self-contained as possible
- Easy to set up
- Highly resilient to network failures, network latency, disk failures, sysadmin failures
- Relatively simple
- Made for multi-datacenter deployments
Garage is an S3-compatible distributed object storage service
designed for self-hosting at a small-to-medium scale.
Non-goals include:
Garage is designed for storage clusters composed of nodes running
at different physical locations,
in order to easily provide a storage service that replicates data at these different
locations and stays available even when some servers are unreachable.
Garage also focuses on being lightweight, easy to operate, and highly resilient to
machine failures.
- Extremely high performance
- Complete implementation of the S3 API
- Erasure coding (our replication model is simply to copy the data as is on several nodes, in different datacenters if possible)
Garage is built by [Deuxfleurs](https://deuxfleurs.fr),
an experimental small-scale self hosted service provider,
which has been using it in production since its first release in 2020.
Our main use case is to provide a distributed storage layer for small-scale self hosted services such as [Deuxfleurs](https://deuxfleurs.fr).
Learn more on our dedicated documentation pages:
**[Go to the documentation](https://garagehq.deuxfleurs.fr)**
- [Goals and use cases](https://garagehq.deuxfleurs.fr/documentation/design/goals/)
- [Features](https://garagehq.deuxfleurs.fr/documentation/reference-manual/features/)
- [Quick start](https://garagehq.deuxfleurs.fr/documentation/quick-start/)
Garage is entirely free software released under the terms of the AGPLv3.

27
TODO
View File

@ -1,27 +0,0 @@
Testing
-------
How are we going to test that our replication method works correctly?
We will have to introduce lots of dummy data and then add/remove nodes many times.
Attaining S3 compatibility
--------------------------
- test multipart uploads
- get ranges
- fix sync not working in some cases ? (when starting from empty?)
- api_server following the S3 semantics for head/get/put/list/delete: verify more that it works as intended
- PUT requests: verify content-md5 if provided
- possibly other necessary endpoints ?
Lower priority
--------------
- less a priority: hinted handoff
- repair: re-propagate block ref table to rc
- FIXME in rpc_server when garage shuts down and futures can be interrupted
(tokio::spawn should be replaced by a new function background::spawn_joinable)

View File

@ -1,66 +1,56 @@
{
system ? builtins.currentSystem,
release ? false,
target ? "x86_64-unknown-linux-musl",
compileMode ? null,
git_version ? null,
}:
{ system ? builtins.currentSystem, git_version ? null, }:
with import ./nix/common.nix;
let
crossSystem = { config = target; };
in let
pkgs = import pkgsSrc {
inherit system crossSystem;
overlays = [ cargo2nixOverlay ];
pkgs = import pkgsSrc { };
compile = import ./nix/compile.nix;
build_debug_and_release = (target: {
debug = (compile {
inherit system target git_version pkgsSrc cargo2nixOverlay;
release = false;
}).workspace.garage { compileMode = "build"; };
release = (compile {
inherit system target git_version pkgsSrc cargo2nixOverlay;
release = true;
}).workspace.garage { compileMode = "build"; };
});
test = (rustPkgs:
pkgs.symlinkJoin {
name = "garage-tests";
paths =
builtins.map (key: rustPkgs.workspace.${key} { compileMode = "test"; })
(builtins.attrNames rustPkgs.workspace);
});
in {
pkgs = {
amd64 = build_debug_and_release "x86_64-unknown-linux-musl";
i386 = build_debug_and_release "i686-unknown-linux-musl";
arm64 = build_debug_and_release "aarch64-unknown-linux-musl";
arm = build_debug_and_release "armv6l-unknown-linux-musleabihf";
};
/*
The following complexity should be abstracted by makePackageSet' (note the final quote).
However its code uses deprecated features of rust-overlay that can lead to bug.
Instead, we build our own rustChannel object with the recommended API of rust-overlay.
*/
rustChannel = pkgs.rustPlatform.rust;
overrides = pkgs.buildPackages.rustBuilder.overrides.all ++ [
(pkgs.rustBuilder.rustLib.makeOverride {
name = "garage";
overrideAttrs = drv: if git_version != null then {
preConfigure = ''
${drv.preConfigure or ""}
export GIT_VERSION="${git_version}"
'';
} else {};
})
];
packageFun = import ./Cargo.nix;
rustPkgs = pkgs.rustBuilder.makePackageSet {
inherit packageFun rustChannel release;
packageOverrides = overrides;
buildRustPackages = pkgs.buildPackages.rustBuilder.makePackageSet {
inherit rustChannel packageFun;
packageOverrides = overrides;
};
localPatterns = [
/*
The way the default rules are written make think we match recursively, on full path, but the rules are misleading.
In fact, the regex is only called on root elements of the crate (and not recursively).
This behavior does not work well with our nested modules.
We tried to build a "deny list" but negative lookup ahead are not supported on Nix.
As a workaround, we have to register all our submodules in this allow list...
*/
''^(src|tests)'' # fixed default
''.*\.(rs|toml)$'' # fixed default
''^(crdt|replication|cli)'' # our crate submodules
];
test = {
amd64 = test (compile {
inherit system git_version pkgsSrc cargo2nixOverlay;
target = "x86_64-unknown-linux-musl";
features = [
"garage/bundled-libs"
"garage/k2v"
"garage/sled"
"garage/lmdb"
"garage/sqlite"
];
});
};
in
if compileMode == "test"
then builtins.mapAttrs (name: value: rustPkgs.workspace.${name} { inherit compileMode; }) rustPkgs.workspace
else rustPkgs.workspace.garage { inherit compileMode; }
clippy = {
amd64 = (compile {
inherit system git_version pkgsSrc cargo2nixOverlay;
target = "x86_64-unknown-linux-musl";
compiler = "clippy";
}).workspace.garage { compileMode = "build"; };
};
}

17
doc/api/README.md Normal file
View File

@ -0,0 +1,17 @@
# Browse doc
Run in this directory:
```
python3 -m http.server
```
And open in your browser:
- http://localhost:8000/garage-admin-v0.html
# Validate doc
```
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.1.0/openapi-generator-cli-6.1.0.jar -O openapi-generator-cli.jar
java -jar openapi-generator-cli.jar validate -i garage-admin-v0.yml
```

59
doc/api/css/redoc.css Normal file
View File

@ -0,0 +1,59 @@
/* montserrat-300 - latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 300;
src: local(''),
url('../fonts/montserrat-v25-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/montserrat-v25-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* montserrat-regular - latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: local(''),
url('../fonts/montserrat-v25-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/montserrat-v25-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* montserrat-700 - latin */
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 700;
src: local(''),
url('../fonts/montserrat-v25-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/montserrat-v25-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* roboto-300 - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local(''),
url('../fonts/roboto-v30-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/roboto-v30-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* roboto-regular - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local(''),
url('../fonts/roboto-v30-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/roboto-v30-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* roboto-700 - latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local(''),
url('../fonts/roboto-v30-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/roboto-v30-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Garage Adminstration API v0</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="./css/redoc.css" rel="stylesheet">
<!--
Redoc doesn't change outer page styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url='./garage-admin-v0.yml'></redoc>
<script src="./redoc.standalone.js"> </script>
</body>
</html>

1218
doc/api/garage-admin-v0.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Garage Adminstration API v0</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="./css/redoc.css" rel="stylesheet">
<!--
Redoc doesn't change outer page styles
-->
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<redoc spec-url='./garage-admin-v1.yml'></redoc>
<script src="./redoc.standalone.js"> </script>
</body>
</html>

1363
doc/api/garage-admin-v1.yml Normal file

File diff suppressed because it is too large Load Diff

1806
doc/api/redoc.standalone.js Normal file

File diff suppressed because one or more lines are too long

3
doc/book/README Normal file
View File

@ -0,0 +1,3 @@
These are the sources for the documentation but not the whole website.
The website templates and other things are in garage_website, which
uses this as a submodule.

5
doc/book/_index.md Normal file
View File

@ -0,0 +1,5 @@
+++
template = "documentation.html"
page_template = "documentation.html"
redirect_to = "documentation/quick-start/"
+++

View File

@ -1,6 +0,0 @@
[book]
authors = ["Quentin Dufour"]
language = "en"
multilingual = false
src = "src"
title = "Garage Documentation"

54
doc/book/build/_index.md Normal file
View File

@ -0,0 +1,54 @@
+++
title = "Build your own app"
weight = 40
sort_by = "weight"
template = "documentation.html"
+++
Garage has many API that you can rely on to build complex applications.
In this section, we reference the existing SDKs and give some code examples.
## ⚠️ DISCLAIMER
**K2V AND ADMIN SDK ARE TECHNICAL PREVIEWS**. The following limitations apply:
- The API is not complete, some actions are possible only through the `garage` binary
- The underlying admin API is not yet stable nor complete, it can breaks at any time
- The generator configuration is currently tweaked, the library might break at any time due to a generator change
- Because the API and the library are not stable, none of them are published in a package manager (npm, pypi, etc.)
- This code has not been extensively tested, some things might not work (please report!)
To have the best experience possible, please consider:
- Make sure that the version of the library you are using is pinned (`go.sum`, `package-lock.json`, `requirements.txt`).
- Before upgrading your Garage cluster, make sure that you can find a version of this SDK that works with your targeted version and that you are able to update your own code to work with this new version of the library.
- Join our Matrix channel at `#garage:deuxfleurs.fr`, say that you are interested by this SDK, and report any friction.
- If stability is critical, mirror this repository on your own infrastructure, regenerate the SDKs and upgrade them at your own pace.
## About the APIs
Code can interact with Garage through 3 different APIs: S3, K2V, and Admin.
Each of them has a specific scope.
### S3
De-facto standard, introduced by Amazon, designed to store blobs of data.
### K2V
A simple database API similar to RiakKV or DynamoDB.
Think a key value store with some additional operations.
Its design is inspired by Distributed Hash Tables (DHT).
More information:
- [In the reference manual](@/documentation/reference-manual/k2v.md)
### Administration
Garage operations can also be automated through a REST API.
We are currently building this SDK for [Python](@/documentation/build/python.md#admin-api), [Javascript](@/documentation/build/javascript.md#administration) and [Golang](@/documentation/build/golang.md#administration).
More information:
- [In the reference manual](@/documentation/reference-manual/admin-api.md)
- [Full specifiction](https://garagehq.deuxfleurs.fr/api/garage-admin-v0.html)

123
doc/book/build/golang.md Normal file
View File

@ -0,0 +1,123 @@
+++
title = "Golang"
weight = 30
+++
## S3
*Coming soon*
Some refs:
- Minio minio-go-sdk
- [Reference](https://docs.min.io/docs/golang-client-api-reference.html)
- Amazon aws-sdk-go-v2
- [Installation](https://aws.github.io/aws-sdk-go-v2/docs/getting-started/)
- [Reference](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/s3)
- [Example](https://aws.github.io/aws-sdk-go-v2/docs/code-examples/s3/putobject/)
## K2V
*Coming soon*
## Administration
Install the SDK with:
```bash
go get git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-golang
```
A short example:
```go
package main
import (
"context"
"fmt"
"os"
"strings"
garage "git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-golang"
)
func main() {
// Initialization
configuration := garage.NewConfiguration()
configuration.Host = "127.0.0.1:3903"
client := garage.NewAPIClient(configuration)
ctx := context.WithValue(context.Background(), garage.ContextAccessToken, "s3cr3t")
// Nodes
fmt.Println("--- nodes ---")
nodes, _, _ := client.NodesApi.GetNodes(ctx).Execute()
fmt.Fprintf(os.Stdout, "First hostname: %v\n", nodes.KnownNodes[0].Hostname)
capa := int64(1000000000)
change := []garage.NodeRoleChange{
garage.NodeRoleChange{NodeRoleUpdate: &garage.NodeRoleUpdate {
Id: *nodes.KnownNodes[0].Id,
Zone: "dc1",
Capacity: *garage.NewNullableInt64(&capa),
Tags: []string{ "fast", "amd64" },
}},
}
staged, _, _ := client.LayoutApi.AddLayout(ctx).NodeRoleChange(change).Execute()
msg, _, _ := client.LayoutApi.ApplyLayout(ctx).LayoutVersion(*garage.NewLayoutVersion(staged.Version + 1)).Execute()
fmt.Printf(strings.Join(msg.Message, "\n")) // Layout configured
health, _, _ := client.NodesApi.GetHealth(ctx).Execute()
fmt.Printf("Status: %s, nodes: %v/%v, storage: %v/%v, partitions: %v/%v\n", health.Status, health.ConnectedNodes, health.KnownNodes, health.StorageNodesOk, health.StorageNodes, health.PartitionsAllOk, health.Partitions)
// Key
fmt.Println("\n--- key ---")
key := "openapi-key"
keyInfo, _, _ := client.KeyApi.AddKey(ctx).AddKeyRequest(garage.AddKeyRequest{Name: *garage.NewNullableString(&key) }).Execute()
defer client.KeyApi.DeleteKey(ctx).Id(*keyInfo.AccessKeyId).Execute()
fmt.Printf("AWS_ACCESS_KEY_ID=%s\nAWS_SECRET_ACCESS_KEY=%s\n", *keyInfo.AccessKeyId, *keyInfo.SecretAccessKey.Get())
id := *keyInfo.AccessKeyId
canCreateBucket := true
updateKeyRequest := *garage.NewUpdateKeyRequest()
updateKeyRequest.SetName("openapi-key-updated")
updateKeyRequest.SetAllow(garage.UpdateKeyRequestAllow { CreateBucket: &canCreateBucket })
update, _, _ := client.KeyApi.UpdateKey(ctx).Id(id).UpdateKeyRequest(updateKeyRequest).Execute()
fmt.Printf("Updated %v with key name %v\n", *update.AccessKeyId, *update.Name)
keyList, _, _ := client.KeyApi.ListKeys(ctx).Execute()
fmt.Printf("Keys count: %v\n", len(keyList))
// Bucket
fmt.Println("\n--- bucket ---")
global_name := "global-ns-openapi-bucket"
local_name := "local-ns-openapi-bucket"
bucketInfo, _, _ := client.BucketApi.CreateBucket(ctx).CreateBucketRequest(garage.CreateBucketRequest{
GlobalAlias: &global_name,
LocalAlias: &garage.CreateBucketRequestLocalAlias {
AccessKeyId: keyInfo.AccessKeyId,
Alias: &local_name,
},
}).Execute()
defer client.BucketApi.DeleteBucket(ctx).Id(*bucketInfo.Id).Execute()
fmt.Printf("Bucket id: %s\n", *bucketInfo.Id)
updateBucketRequest := *garage.NewUpdateBucketRequest()
website := garage.NewUpdateBucketRequestWebsiteAccess()
website.SetEnabled(true)
website.SetIndexDocument("index.html")
website.SetErrorDocument("errors/4xx.html")
updateBucketRequest.SetWebsiteAccess(*website)
quotas := garage.NewUpdateBucketRequestQuotas()
quotas.SetMaxSize(1000000000)
quotas.SetMaxObjects(999999999)
updateBucketRequest.SetQuotas(*quotas)
updatedBucket, _, _ := client.BucketApi.UpdateBucket(ctx).Id(*bucketInfo.Id).UpdateBucketRequest(updateBucketRequest).Execute()
fmt.Printf("Bucket %v website activation: %v\n", *updatedBucket.Id, *updatedBucket.WebsiteAccess)
bucketList, _, _ := client.BucketApi.ListBuckets(ctx).Execute()
fmt.Printf("Bucket count: %v\n", len(bucketList))
}
```
See also:
- [generated doc](https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-golang)
- [examples](https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-generator/src/branch/main/example/golang)

View File

@ -0,0 +1,55 @@
+++
title = "Javascript"
weight = 10
+++
## S3
*Coming soon*.
Some refs:
- Minio SDK
- [Reference](https://docs.min.io/docs/javascript-client-api-reference.html)
- Amazon aws-sdk-js
- [Installation](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-started.html)
- [Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html)
- [Example](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/s3-example-creating-buckets.html)
## K2V
*Coming soon*
## Administration
Install the SDK with:
```bash
npm install --save git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-js.git
```
A short example:
```javascript
const garage = require('garage_administration_api_v1garage_v0_9_0');
const api = new garage.ApiClient("http://127.0.0.1:3903/v1");
api.authentications['bearerAuth'].accessToken = "s3cr3t";
const [node, layout, key, bucket] = [
new garage.NodesApi(api),
new garage.LayoutApi(api),
new garage.KeyApi(api),
new garage.BucketApi(api),
];
node.getNodes().then((data) => {
console.log(`nodes: ${Object.values(data.knownNodes).map(n => n.hostname)}`)
}, (error) => {
console.error(error);
});
```
See also:
- [sdk repository](https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-js)
- [examples](https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-generator/src/branch/main/example/javascript)

49
doc/book/build/others.md Normal file
View File

@ -0,0 +1,49 @@
+++
title = "Others"
weight = 99
+++
## S3
If you are developping a new application, you may want to use Garage to store your user's media.
The S3 API that Garage uses is a standard REST API, so as long as you can make HTTP requests,
you can query it. You can check the [S3 REST API Reference](https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html) from Amazon to learn more.
Developping your own wrapper around the REST API is time consuming and complicated.
Instead, there are some libraries already avalaible.
Some of them are maintained by Amazon, some by Minio, others by the community.
### PHP
- Amazon aws-sdk-php
- [Installation](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/getting-started_installation.html)
- [Reference](https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html)
- [Example](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-creating-buckets.html)
### Java
- Minio SDK
- [Reference](https://docs.min.io/docs/java-client-api-reference.html)
- Amazon aws-sdk-java
- [Installation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html)
- [Reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/s3/S3Client.html)
- [Example](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/examples-s3-objects.html)
### .NET
- Minio SDK
- [Reference](https://docs.min.io/docs/dotnet-client-api-reference.html)
- Amazon aws-dotnet-sdk
### C++
- Amazon aws-cpp-sdk
### Haskell
- Minio SDK
- [Reference](https://docs.min.io/docs/haskell-client-api-reference.html)

139
doc/book/build/python.md Normal file
View File

@ -0,0 +1,139 @@
+++
title = "Python"
weight = 20
+++
## S3
### Using Minio SDK
First install the SDK:
```bash
pip3 install minio
```
Then instantiate a client object using garage root domain, api key and secret:
```python
import minio
client = minio.Minio(
"your.domain.tld",
"GKyourapikey",
"abcd[...]1234",
# Force the region, this is specific to garage
region="region",
)
```
Then use all the standard S3 endpoints as implemented by the Minio SDK:
```
# List buckets
print(client.list_buckets())
# Put an object containing 'content' to /path in bucket named 'bucket':
content = b"content"
client.put_object(
"bucket",
"path",
io.BytesIO(content),
len(content),
)
# Read the object back and check contents
data = client.get_object("bucket", "path").read()
assert data == content
```
For further documentation, see the Minio SDK
[Reference](https://docs.min.io/docs/python-client-api-reference.html)
### Using Amazon boto3
*Coming soon*
See the official documentation:
- [Installation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html)
- [Reference](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html)
- [Example](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html)
## K2V
*Coming soon*
## Admin API
You need at least Python 3.6, pip, and setuptools.
Because the python package is in a subfolder, the command is a bit more complicated than usual:
```bash
pip3 install --user 'git+https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-python'
```
Now, let imagine you have a fresh Garage instance running on localhost, with the admin API configured on port 3903 with the bearer `s3cr3t`:
```python
import garage_admin_sdk
from garage_admin_sdk.apis import *
from garage_admin_sdk.models import *
configuration = garage_admin_sdk.Configuration(
host = "http://localhost:3903/v1",
access_token = "s3cr3t"
)
# Init APIs
api = garage_admin_sdk.ApiClient(configuration)
nodes, layout, keys, buckets = NodesApi(api), LayoutApi(api), KeyApi(api), BucketApi(api)
# Display some info on the node
status = nodes.get_nodes()
print(f"running garage {status.garage_version}, node_id {status.node}")
# Change layout of this node
current = layout.get_layout()
layout.add_layout([
NodeRoleChange(
id = status.node,
zone = "dc1",
capacity = 1000000000,
tags = [ "dev" ],
)
])
layout.apply_layout(LayoutVersion(
version = current.version + 1
))
# Create key, allow it to create buckets
kinfo = keys.add_key(AddKeyRequest(name="openapi"))
allow_create = UpdateKeyRequestAllow(create_bucket=True)
keys.update_key(kinfo.access_key_id, UpdateKeyRequest(allow=allow_create))
# Create a bucket, allow key, set quotas
binfo = buckets.create_bucket(CreateBucketRequest(global_alias="documentation"))
binfo = buckets.allow_bucket_key(AllowBucketKeyRequest(
bucket_id=binfo.id,
access_key_id=kinfo.access_key_id,
permissions=AllowBucketKeyRequestPermissions(read=True, write=True, owner=True),
))
binfo = buckets.update_bucket(binfo.id, UpdateBucketRequest(
quotas=UpdateBucketRequestQuotas(max_size=19029801,max_objects=1500)))
# Display key
print(f"""
cluster ready
key id is {kinfo.access_key_id}
secret key is {kinfo.secret_access_key}
bucket {binfo.global_aliases[0]} contains {binfo.objects}/{binfo.quotas.max_objects} objects
""")
```
*This example is named `short.py` in the example folder. Other python examples are also available.*
See also:
- [sdk repo](https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-python)
- [examples](https://git.deuxfleurs.fr/garage-sdk/garage-admin-sdk-generator/src/branch/main/example/python)

47
doc/book/build/rust.md Normal file
View File

@ -0,0 +1,47 @@
+++
title = "Rust"
weight = 40
+++
## S3
*Coming soon*
Some refs:
- Amazon aws-rust-sdk
- [Github](https://github.com/awslabs/aws-sdk-rust)
## K2V
*Coming soon*
Some refs: https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/k2v-client
```bash
# all these values can be provided on the cli instead
export AWS_ACCESS_KEY_ID=GK123456
export AWS_SECRET_ACCESS_KEY=0123..789
export AWS_REGION=garage
export K2V_ENDPOINT=http://172.30.2.1:3903
export K2V_BUCKET=my-bucket
cargo run --features=cli -- read-range my-partition-key --all
cargo run --features=cli -- insert my-partition-key my-sort-key --text "my string1"
cargo run --features=cli -- insert my-partition-key my-sort-key --text "my string2"
cargo run --features=cli -- insert my-partition-key my-sort-key2 --text "my string"
cargo run --features=cli -- read-range my-partition-key --all
causality=$(cargo run --features=cli -- read my-partition-key my-sort-key2 -b | head -n1)
cargo run --features=cli -- delete my-partition-key my-sort-key2 -c $causality
causality=$(cargo run --features=cli -- read my-partition-key my-sort-key -b | head -n1)
cargo run --features=cli -- insert my-partition-key my-sort-key --text "my string3" -c $causality
cargo run --features=cli -- read-range my-partition-key --all
```
## Admin API
*Coming soon*

View File

@ -1,7 +1,26 @@
# Connect it to
+++
title = "Existing integrations"
weight = 30
sort_by = "weight"
template = "documentation.html"
+++
To configure an S3 client to interact with Garage, you will need the following
parameters:
Garage implements the Amazon S3 protocol, which makes it compatible with many existing software programs.
In particular, you will find here instructions to connect it with:
- [Applications](@/documentation/connect/apps/index.md)
- [Browsing tools](@/documentation/connect/cli.md)
- [FUSE](@/documentation/connect/fs.md)
- [Observability](@/documentation/connect/observability.md)
- [Software repositories](@/documentation/connect/repositories.md)
- [Website hosting](@/documentation/connect/websites.md)
### Generic instructions
To configure S3-compatible software to interact with Garage,
you will need the following parameters:
- An **API endpoint**: this corresponds to the HTTP or HTTPS address
used to contact the Garage server. When runing Garage locally this will usually
@ -13,26 +32,17 @@ parameters:
like this: `GK3515373e4c851ebaad366558` (access key),
`7d37d093435a41f2aab8f13c19ba067d9776c90215f56614adad6ece597dbb34` (secret key).
These keys are created and managed using the `garage` CLI, as explained in the
[quick start](../quick_start/index.md) guide.
[quick start](@/documentation/quick-start/_index.md) guide.
Most S3 clients can be configured easily with these parameters,
provided that you follow the following guidelines:
- **Force path style:** Garage does not support DNS-style buckets, which are now by default
on Amazon S3. Instead, Garage uses the legacy path-style bucket addressing.
Remember to configure your client to acknowledge this fact.
- **Be careful to DNS-style/path-style access:** Garage supports both DNS-style buckets, which are now by default
on Amazon S3, and legacy path-style buckets. If you use a reverse proxy in front of Garage,
make sure that you configured it to support the access-style required by the software you want to use.
- **Configuring the S3 region:** Garage requires your client to talk to the correct "S3 region",
which is set in the configuration file. This is often set just to `garage`.
If this is not configured explicitly, clients usually try to talk to region `us-east-1`.
Garage should normally redirect your client to the correct region,
but in case your client does not support this you might have to configure it manually.
We will now provide example configurations for the most common clients per category:
- [Apps](./apps.md)
- [Websites](./websites.md)
- [Repositories](./repositories.md)
- [CLI tools](./cli.md)
- [Your code](./code.md)

View File

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 197 KiB

View File

@ -0,0 +1,619 @@
+++
title = "Apps (Nextcloud, Peertube...)"
weight = 5
+++
In this section, we cover the following web applications:
| Name | Status | Note |
|------|--------|------|
| [Nextcloud](#nextcloud) | ✅ | Both Primary Storage and External Storage are supported |
| [Peertube](#peertube) | ✅ | Supported with the website endpoint, proxifying private videos unsupported |
| [Mastodon](#mastodon) | ✅ | Natively supported |
| [Matrix](#matrix) | ✅ | Tested with `synapse-s3-storage-provider` |
| [ejabberd](#ejabberd) | ✅ | `mod_s3_upload` |
| [Pixelfed](#pixelfed) | ❓ | Not yet tested |
| [Pleroma](#pleroma) | ❓ | Not yet tested |
| [Lemmy](#lemmy) | ✅ | Supported with pict-rs |
| [Funkwhale](#funkwhale) | ❓ | Not yet tested |
| [Misskey](#misskey) | ❓ | Not yet tested |
| [Prismo](#prismo) | ❓ | Not yet tested |
| [Owncloud OCIS](#owncloud-infinite-scale-ocis) | ❓| Not yet tested |
## Nextcloud
Nextcloud is a popular file synchronisation and backup service.
By default, Nextcloud stores its data on the local filesystem.
If you want to expand your storage to aggregate multiple servers, Garage is the way to go.
A S3 backend can be configured in two ways on Nextcloud, either as Primary Storage or as an External Storage.
Primary storage will store all your data on S3, in an opaque manner, and will provide the best performances.
External storage enable you to select which data will be stored on S3, your file hierarchy will be preserved in S3, but it might be slower.
In the following, we cover both methods but before reading our guide, we suppose you have done some preliminary steps.
First, we expect you have an already installed and configured Nextcloud instance.
Second, we suppose you have created a key and a bucket.
As a reminder, you can create a key for your nextcloud instance as follow:
```bash
garage key create nextcloud-key
```
Keep the Key ID and the Secret key in a pad, they will be needed later.
Then you can create a bucket and give read/write rights to your key on this bucket with:
```bash
garage bucket create nextcloud
garage bucket allow nextcloud --read --write --key nextcloud-key
```
### Primary Storage
Now edit your Nextcloud configuration file to enable object storage.
On my installation, the config. file is located at the following path: `/var/www/nextcloud/config/config.php`.
We will add a new root key to the `$CONFIG` dictionnary named `objectstore`:
```php
<?php
$CONFIG = array(
/* your existing configuration */
'objectstore' => [
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => [
'bucket' => 'nextcloud', // Your bucket name, must be created before
'autocreate' => false, // Garage does not support autocreate
'key' => 'xxxxxxxxx', // The Key ID generated previously
'secret' => 'xxxxxxxxx', // The Secret key generated previously
'hostname' => '127.0.0.1', // Can also be a domain name, eg. garage.example.com
'port' => 3900, // Put your reverse proxy port or your S3 API port
'use_ssl' => false, // Set it to true if you have a TLS enabled reverse proxy
'region' => 'garage', // Garage has only one region named "garage"
'use_path_style' => true // Garage supports only path style, must be set to true
],
],
```
That's all, your Nextcloud will store all your data to S3.
To test your new configuration, just reload your Nextcloud webpage and start sending data.
*External link:* [Nextcloud Documentation > Primary Storage](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html)
### External Storage
**From the GUI.** Activate the "External storage support" app from the "Applications" page (click on your account icon on the top right corner of your screen to display the menu). Go to your parameters page (also located below your account icon). Click on external storage (or the corresponding translation in your language).
[![Screenshot of the External Storage form](cli-nextcloud-gui.png)](cli-nextcloud-gui.png)
*Click on the picture to zoom*
Add a new external storage. Put what you want in "folder name" (eg. "shared"). Select "Amazon S3". Keep "Access Key" for the Authentication field.
In Configuration, put your bucket name (eg. nextcloud), the host (eg. 127.0.0.1), the port (eg. 3900 or 443), the region (garage). Tick the SSL box if you have put an HTTPS proxy in front of garage. You must tick the "Path access" box and you must leave the "Legacy authentication (v2)" box empty. Put your Key ID (eg. GK...) and your Secret Key in the last two input boxes. Finally click on the tick symbol on the right of your screen.
Now go to your "Files" app and a new "linked folder" has appeared with the name you chose earlier (eg. "shared").
*External link:* [Nextcloud Documentation > External Storage Configuration GUI](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html)
**From the CLI.** First install the external storage application:
```bash
php occ app:install files_external
```
Then add a new mount point with:
```bash
php occ files_external:create \
-c bucket=nextcloud \
-c hostname=127.0.0.1 \
-c port=3900 \
-c region=garage \
-c use_ssl=false \
-c use_path_style=true \
-c legacy_auth=false \
-c key=GKxxxx \
-c secret=xxxx \
shared amazons3 amazons3::accesskey
```
Adapt the `hostname`, `port`, `use_ssl`, `key`, and `secret` entries to your configuration.
Do not change the `use_path_style` and `legacy_auth` entries, other configurations are not supported.
*External link:* [Nextcloud Documentation > occ command > files external](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#files-external-label)
## Peertube
Peertube proposes a clever integration of S3 by directly exposing its endpoint instead of proxifying requests through the application.
In other words, Peertube is only responsible of the "control plane" and offload the "data plane" to Garage.
In return, this system is a bit harder to configure.
We show how it is still possible to configure Garage with Peertube, allowing you to spread the load and the bandwidth usage on the Garage cluster.
Starting from version 5.0, Peertube also supports improving the security for private videos by not exposing them directly
but relying on a single control point in the Peertube instance. This is based on S3 per-object and prefix ACL, which are not currently supported
in Garage, so this feature is unsupported. While this technically impedes security for private videos, it is not a blocking issue and could be
a reasonable trade-off for some instances.
### Create resources in Garage
Create a key for Peertube:
```bash
garage key create peertube-key
```
Keep the Key ID and the Secret key in a pad, they will be needed later.
We need two buckets, one for normal videos (named peertube-video) and one for webtorrent videos (named peertube-playlist).
```bash
garage bucket create peertube-videos
garage bucket create peertube-playlist
```
Now we allow our key to read and write on these buckets:
```
garage bucket allow peertube-playlists --read --write --owner --key peertube-key
garage bucket allow peertube-videos --read --write --owner --key peertube-key
```
We also need to expose these buckets publicly to serve their content to users:
```bash
garage bucket website --allow peertube-playlists
garage bucket website --allow peertube-videos
```
Finally, we must allow Cross-Origin Resource Sharing (CORS).
CORS are required by your browser to allow requests triggered from the peertube website (eg. peertube.tld) to your bucket's domain (eg. peertube-videos.web.garage.tld)
```bash
export CORS='{"CORSRules":[{"AllowedHeaders":["*"],"AllowedMethods":["GET"],"AllowedOrigins":["*"]}]}'
aws --endpoint http://s3.garage.localhost s3api put-bucket-cors --bucket peertube-playlists --cors-configuration $CORS
aws --endpoint http://s3.garage.localhost s3api put-bucket-cors --bucket peertube-videos --cors-configuration $CORS
```
These buckets are now accessible on the web port (by default 3902) with the following URL: `http://<bucket><root_domain>:<web_port>` where the root domain is defined in your configuration file (by default `.web.garage`). So we have currently the following URLs:
* http://peertube-playlists.web.garage:3902
* http://peertube-videos.web.garage:3902
Make sure you (will) have a corresponding DNS entry for them.
### Configure Peertube
You must edit the file named `config/production.yaml`, we are only modifying the root key named `object_storage`:
```yaml
object_storage:
enabled: true
# Put localhost only if you have a garage instance running on that node
endpoint: 'http://localhost:3900' # or "garage.example.com" if you have TLS on port 443
# Garage supports only one region for now, named garage
region: 'garage'
credentials:
access_key_id: 'GKxxxx'
secret_access_key: 'xxxx'
max_upload_part: 2GB
proxy:
# You may enable this feature, yet it will not provide any security benefit, so
# you should rather benefit from Garage public endpoint for all videos
proxify_private_files: false
streaming_playlists:
bucket_name: 'peertube-playlist'
# Keep it empty for our example
prefix: ''
# You must fill this field to make Peertube use our reverse proxy/website logic
base_url: 'http://peertube-playlists.web.garage.localhost' # Example: 'https://mirror.example.com'
# Same settings but for webtorrent videos
videos:
bucket_name: 'peertube-videos'
prefix: ''
# You must fill this field to make Peertube use our reverse proxy/website logic
base_url: 'http://peertube-videos.web.garage.localhost'
```
### That's all
Everything must be configured now, simply restart Peertube and try to upload a video.
Peertube will start by serving the video from its own domain while it is encoding.
Once the encoding is done, the video is uploaded to Garage.
You can now reload the page and see in your browser console that data are fetched directly from your bucket.
*External link:* [Peertube Documentation > Remote Storage](https://docs.joinpeertube.org/admin-remote-storage)
## Mastodon
Mastodon natively supports the S3 protocol to store media files, and it works out-of-the-box with Garage.
You will need to expose your Garage bucket as a website: that way, media files will be served directly from Garage.
### Performance considerations
Mastodon tends to store many small objects over time: expect hundreds of thousands of objects,
with average object size ranging from 50 KB to 150 KB.
As such, your Garage cluster should be configured appropriately for good performance:
- use Garage v0.8.0 or higher with the [LMDB database engine](@documentation/reference-manual/configuration.md#db-engine-since-v0-8-0).
With the default Sled database engine, your database could quickly end up taking tens of GB of disk space.
- the Garage database should be stored on a SSD
### Creating your bucket
This is the usual Garage setup:
```bash
garage key create mastodon-key
garage bucket create mastodon-data
garage bucket allow mastodon-data --read --write --key mastodon-key
```
Note the Key ID and Secret Key.
### Exposing your bucket as a website
Create a DNS name to serve your media files, such as `my-social-media.mydomain.tld`.
This name will be publicly exposed to the users of your Mastodon instance: they
will load images directly from this DNS name.
As [documented here](@/documentation/cookbook/exposing-websites.md),
add this DNS name as alias to your bucket, and expose it as a website:
```bash
garage bucket alias mastodon-data my-social-media.mydomain.tld
garage bucket website --allow mastodon-data
```
Then you will likely need to [setup a reverse proxy](@/documentation/cookbook/reverse-proxy.md)
in front of it to serve your media files over HTTPS.
### Cleaning up old media files before migration
Mastodon instance quickly accumulate a lot of media files from the federation.
Most of them are not strictly necessary because they can be fetched again from
other servers. As such, it is highly recommended to clean them up before
migration, this will greatly reduce the migration time.
From the [official Mastodon documentation](https://docs.joinmastodon.org/admin/tootctl/#media):
```bash
$ RAILS_ENV=production bin/tootctl media remove --days 3
$ RAILS_ENV=production bin/tootctl media remove-orphans
$ RAILS_ENV=production bin/tootctl preview_cards remove --days 15
```
Here is a typical disk usage for a small but multi-year instance after cleanup:
```bash
$ RAILS_ENV=production bin/tootctl media usage
Attachments: 5.67 GB (1.14 GB local)
Custom emoji: 295 MB (0 Bytes local)
Preview cards: 154 MB
Avatars: 3.77 GB (127 KB local)
Headers: 8.72 GB (242 KB local)
Backups: 0 Bytes
Imports: 1.7 KB
Settings: 0 Bytes
```
Unfortunately, [old avatars and headers cannot currently be cleaned up](https://github.com/mastodon/mastodon/issues/9567).
### Migrating your data
Data migration should be done with an efficient S3 client.
The [minio client](@documentation/connect/cli.md#minio-client) is a good choice
thanks to its mirror mode:
```bash
mc mirror ./public/system/ garage/mastodon-data
```
Here is a typical bucket usage after all data has been migrated:
```bash
$ garage bucket info mastodon-data
Size: 20.3 GiB (21.8 GB)
Objects: 175968
```
### Configuring Mastodon
In your `.env.production` configuration file:
```bash
S3_ENABLED=true
# Internal access to Garage
S3_ENDPOINT=http://my-garage-instance.mydomain.tld:3900
S3_REGION=garage
S3_BUCKET=mastodon-data
# Change this (Key ID and Secret Key of your Garage key)
AWS_ACCESS_KEY_ID=GKe88df__CHANGETHIS__c5145
AWS_SECRET_ACCESS_KEY=a2f7__CHANGETHIS__77fcfcf7a58f47a4aa4431f2e675c56da37821a1070000
# What name gets exposed to users (HTTPS is implicit)
S3_ALIAS_HOST=my-social-media.mydomain.tld
```
For more details, see the [reference Mastodon documentation](https://docs.joinmastodon.org/admin/config/#cdn).
Restart all Mastodon services and everything should now be using Garage!
You can check the URLs of images in the Mastodon web client, they should start
with `https://my-social-media.mydomain.tld`.
### Last migration sync
After Mastodon is successfully using Garage, you can run a last sync from the local filesystem to Garage:
```bash
mc mirror --newer-than "3h" ./public/system/ garage/mastodon-data
```
### References
[cybrespace's guide to migrate to S3](https://github.com/cybrespace/cybrespace-meta/blob/master/s3.md)
(the guide is for Amazon S3, so the configuration is a bit different, but the rest is similar)
## Matrix
Matrix is a chat communication protocol. Its main stable server implementation, [Synapse](https://matrix-org.github.io/synapse/latest/), provides a module to store media on a S3 backend. Additionally, a server independent media store supporting S3 has been developped by the community, it has been made possible thanks to how the matrix API has been designed and will work with implementations like Conduit, Dendrite, etc.
### synapse-s3-storage-provider (synapse only)
Supposing you have a working synapse installation, you can add the module with pip:
```bash
pip3 install --user git+https://github.com/matrix-org/synapse-s3-storage-provider.git
```
Now create a bucket and a key for your matrix instance (note your Key ID and Secret Key somewhere, they will be needed later):
```bash
garage key create matrix-key
garage bucket create matrix
garage bucket allow matrix --read --write --key matrix-key
```
Then you must edit your server configuration (eg. `/etc/matrix-synapse/homeserver.yaml`) and add the `media_storage_providers` root key:
```yaml
media_storage_providers:
- module: s3_storage_provider.S3StorageProviderBackend
store_local: True # do we want to store on S3 media created by our users?
store_remote: True # do we want to store on S3 media created
# by users of others servers federated to ours?
store_synchronous: True # do we want to wait that the file has been written before returning?
config:
bucket: matrix # the name of our bucket, we chose matrix earlier
region_name: garage # only "garage" is supported for the region field
endpoint_url: http://localhost:3900 # the path to the S3 endpoint
access_key_id: "GKxxx" # your Key ID
secret_access_key: "xxxx" # your Secret Key
```
Note that uploaded media will also be stored locally and this behavior can not be deactivated, it is even required for
some operations like resizing images.
In fact, your local filesysem is considered as a cache but without any automated way to garbage collect it.
We can build our garbage collector with `s3_media_upload`, a tool provided with the module.
If you installed the module with the command provided before, you should be able to bring it in your path:
```
PATH=$HOME/.local/bin/:$PATH
command -v s3_media_upload
```
Now we can write a simple script (eg `~/.local/bin/matrix-cache-gc`):
```bash
#!/bin/bash
## CONFIGURATION ##
AWS_ACCESS_KEY_ID=GKxxx
AWS_SECRET_ACCESS_KEY=xxxx
AWS_ENDPOINT_URL=http://localhost:3900
S3_BUCKET=matrix
MEDIA_STORE=/var/lib/matrix-synapse/media
PG_USER=matrix
PG_PASS=xxxx
PG_DB=synapse
PG_HOST=localhost
PG_PORT=5432
## CODE ##
PATH=$HOME/.local/bin/:$PATH
cat > database.yaml <<EOF
user: $PG_USER
password: $PG_PASS
database: $PG_DB
host: $PG_HOST
port: $PG_PORT
EOF
s3_media_upload update-db 1d
s3_media_upload --no-progress check-deleted $MEDIA_STORE
s3_media_upload --no-progress upload $MEDIA_STORE $S3_BUCKET --delete --endpoint-url $AWS_ENDPOINT_URL
```
This script will list all the medias that were not accessed in the 24 hours according to your database.
It will check if, in this list, the file still exists in the local media store.
For files that are still in the cache, it will upload them to S3 if they are not already present (in case of a crash or an initial synchronisation).
Finally, the script will delete these files from the cache.
Make this script executable and check that it works:
```bash
chmod +x $HOME/.local/bin/matrix-cache-gc
matrix-cache-gc
```
Add it to your crontab. Open the editor with:
```bash
crontab -e
```
And add a new line. For example, to run it every 10 minutes:
```cron
*/10 * * * * $HOME/.local/bin/matrix-cache-gc
```
*External link:* [Github > matrix-org/synapse-s3-storage-provider](https://github.com/matrix-org/synapse-s3-storage-provider)
### matrix-media-repo (server independent)
*External link:* [matrix-media-repo Documentation > S3](https://docs.t2bot.io/matrix-media-repo/configuration/s3-datastore.html)
## ejabberd
ejabberd is an XMPP server implementation which, with the `mod_s3_upload`
module in the [ejabberd-contrib](https://github.com/processone/ejabberd-contrib)
repository, can be integrated to store chat media files in Garage.
For uploads, this module leverages presigned URLs - this allows XMPP clients to
directly send media to Garage. Receiving clients then retrieve this media
through the [static website](@/documentation/cookbook/exposing-websites.md)
functionality.
As the data itself is publicly accessible to someone with knowledge of the
object URL - users are recommended to use
[E2EE](@/documentation/cookbook/encryption.md) to protect this data-at-rest
from unauthorized access.
Install the module with:
```bash
ejabberdctl module_install mod_s3_upload
```
Create the required key and bucket with:
```bash
garage key new --name ejabberd
garage bucket create objects.xmpp-server.fr
garage bucket allow objects.xmpp-server.fr --read --write --key ejabberd
garage bucket website --allow objects.xmpp-server.fr
```
The module can then be configured with:
```
mod_s3_upload:
#bucket_url: https://objects.xmpp-server.fr.my-garage-instance.mydomain.tld
bucket_url: https://my-garage-instance.mydomain.tld/objects.xmpp-server.fr
access_key_id: GK...
access_key_secret: ...
region: garage
download_url: https://objects.xmpp-server.fr
```
Other configuration options can be found in the
[configuration YAML file](https://github.com/processone/ejabberd-contrib/blob/master/mod_s3_upload/conf/mod_s3_upload.yml).
## Pixelfed
[Pixelfed Technical Documentation > Configuration](https://docs.pixelfed.org/technical-documentation/env.html#filesystem)
## Pleroma
[Pleroma Documentation > Pleroma.Uploaders.S3](https://docs-develop.pleroma.social/backend/configuration/cheatsheet/#pleromauploaderss3)
## Lemmy
Lemmy uses pict-rs that [supports S3 backends](https://git.asonix.dog/asonix/pict-rs/commit/f9f4fc63d670f357c93f24147c2ee3e1278e2d97).
This feature requires `pict-rs >= 4.0.0`.
### Creating your bucket
This is the usual Garage setup:
```bash
garage key new --name pictrs-key
garage bucket create pictrs-data
garage bucket allow pictrs-data --read --write --key pictrs-key
```
Note the Key ID and Secret Key.
### Migrating your data
If your pict-rs instance holds existing data, you first need to migrate to the S3 bucket.
Stop pict-rs, then run the migration utility from local filesystem to the bucket:
```
pict-rs \
filesystem -p /path/to/existing/files \
object-store \
-e my-garage-instance.mydomain.tld:3900 \
-b pictrs-data \
-r garage \
-a GK... \
-s abcdef0123456789...
```
This is pretty slow, so hold on while migrating.
### Running pict-rs with an S3 backend
Pict-rs supports both a configuration file and environment variables.
Either set the following section in your `pict-rs.toml`:
```
[store]
type = 'object_storage'
endpoint = 'http://my-garage-instance.mydomain.tld:3900'
bucket_name = 'pictrs-data'
region = 'garage'
access_key = 'GK...'
secret_key = 'abcdef0123456789...'
```
... or set these environment variables:
```
PICTRS__STORE__TYPE=object_storage
PICTRS__STORE__ENDPOINT=http://my-garage-instance.mydomain.tld:3900
PICTRS__STORE__BUCKET_NAME=pictrs-data
PICTRS__STORE__REGION=garage
PICTRS__STORE__ACCESS_KEY=GK...
PICTRS__STORE__SECRET_KEY=abcdef0123456789...
```
## Funkwhale
[Funkwhale Documentation > S3 Storage](https://docs.funkwhale.audio/admin/configuration.html#s3-storage)
## Misskey
[Misskey Github > commit 9d94424](https://github.com/misskey-dev/misskey/commit/9d944243a3a59e8880a360cbfe30fd5a3ec8d52d)
## Prismo
[Prismo Gitlab > .env.production.sample](https://gitlab.com/prismosuite/prismo/-/blob/dev/.env.production.sample#L26-33)
## Owncloud Infinite Scale (ocis)
OCIS could be compatible with S3:
- [Deploying OCIS with S3](https://owncloud.dev/ocis/deployment/ocis_s3/)
- [OCIS 1.7 release note](https://central.owncloud.org/t/owncloud-infinite-scale-tech-preview-1-7-enables-s3-storage/32514/3)
## Unsupported
- Mobilizon: No S3 integration
- WriteFreely: No S3 integration
- Plume: No S3 integration

163
doc/book/connect/backup.md Normal file
View File

@ -0,0 +1,163 @@
+++
title = "Backups (restic, duplicity...)"
weight = 25
+++
Backups are essential for disaster recovery but they are not trivial to manage.
Using Garage as your backup target will enable you to scale your storage as needed while ensuring high availability.
## Borg Backup
Borg Backup is very popular among the backup tools but it is not yet compatible with the S3 API.
We recommend using any other tool listed in this guide because they are all compatible with the S3 API.
If you still want to use Borg, you can use it with `rclone mount`.
## git-annex
[git-annex](https://git-annex.branchable.com/) supports synchronizing files
with its [S3 special remote](https://git-annex.branchable.com/special_remotes/S3/).
Note that `git-annex` requires to be compiled with Haskell package version
`aws-0.24` to work with Garage.
```bash
garage key new --name my-key
garage bucket create my-git-annex
garage bucket allow my-git-annex --read --write --key my-key
```
Register your Key ID and Secret key in your environment:
```bash
export AWS_ACCESS_KEY_ID=GKxxx
export AWS_SECRET_ACCESS_KEY=xxxx
```
Within a git-annex enabled repository, configure your Garage S3 endpoint with
the following command:
```bash
git annex initremote garage type=S3 encryption=none host=my-garage-instance.mydomain.tld protocol=https bucket=my-git-annex requeststyle=path region=garage signature=v4
```
Files can now be synchronized using the usual `git-annex` `copy` or `get`
commands.
Note that for simplicity - this example does not enable encryption for the files
sent to Garage - please refer to the
[git-annex encryption page](https://git-annex.branchable.com/encryption/) for
how to configure this.
## Restic
Create your key and bucket:
```bash
garage key create my-key
garage bucket create backups
garage bucket allow backups --read --write --key my-key
```
Then register your Key ID and Secret key in your environment:
```bash
export AWS_ACCESS_KEY_ID=GKxxx
export AWS_SECRET_ACCESS_KEY=xxxx
```
Configure restic from environment too:
```bash
export RESTIC_REPOSITORY="s3:http://localhost:3900/backups"
echo "Generated password (save it safely): $(openssl rand -base64 32)"
export RESTIC_PASSWORD=xxx # copy paste your generated password here
```
Do not forget to save your password safely (in your password manager or print it). It will be needed to decrypt your backups.
Now you can use restic:
```bash
# Initialize the bucket, must be run once
restic init
# Backup your PostgreSQL database
# (We suppose your PostgreSQL daemon is stopped for all commands)
restic backup /var/lib/postgresql
# Show backup history
restic snapshots
# Backup again your PostgreSQL database, it will be faster as only changes will be uploaded
restic backup /var/lib/postgresql
# Show backup history (again)
restic snapshots
# Restore a backup
# (79766175 is the ID of the snapshot you want to restore)
mv /var/lib/postgresql /var/lib/postgresql.broken
restic restore 79766175 --target /var/lib/postgresql
```
Restic has way more features than the ones presented here.
You can discover all of them by accessing its documentation from the link below.
Files on Android devices can also be backed up with [restic-android](https://github.com/lhns/restic-android).
*External links:* [Restic Documentation > Amazon S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3)
## Duplicity
*External links:* [Duplicity > man](https://duplicity.gitlab.io/duplicity-web/vers8/duplicity.1.html) (scroll to "URL Format" and "A note on Amazon S3")
## Duplicati
*External links:* [Duplicati Documentation > Storage Providers](https://duplicati.readthedocs.io/en/latest/05-storage-providers/#s3-compatible)
The following fields need to be specified:
```
Storage Type: S3 Compatible
Use SSL: [ ] # Only if you have SSL
Server: Custom server url (s3.garage.localhost:3900)
Bucket name: bucket-name
Bucket create region: Custom region value (garage) # Or as you've specified in garage.toml
AWS Access ID: Key ID from "garage key info key-name"
AWS Access Key: Secret key from "garage key info key-name"
Client Library to use: Minio SDK
```
Click `Test connection` and then no when asked `The bucket name should start with your username, prepend automatically?`. Then it should say `Connection worked!`.
## knoxite
*External links:* [Knoxite Documentation > Storage Backends](https://knoxite.com/docs/storage-backends/#amazon-s3)
## kopia
*External links:* [Kopia Documentation > Repositories](https://kopia.io/docs/repositories/#amazon-s3)
To create the Kopia repository, you need to specify the region, the HTTP(S) endpoint, the bucket name and the access keys.
For instance, if you have an instance of garage running on `https://garage.example.com`:
```
kopia repository create s3 --region=garage --bucket=mybackups --access-key=KEY_ID --secret-access-key=SECRET_KEY --endpoint=garage.example.com
```
Or if you have an instance running on localhost, without TLS:
```
kopia repository create s3 --region=garage --bucket=mybackups --access-key=KEY_ID --secret-access-key=SECRET_KEY --endpoint=localhost:3900 --disable-tls
```
After the repository has been created, check that everything works as expected:
```
kopia repository validate-provider
```
You can then run all the standard kopia commands: `kopia snapshot create`, `kopia mount`...
Everything should work out-of-the-box.

317
doc/book/connect/cli.md Normal file
View File

@ -0,0 +1,317 @@
+++
title = "Browsing tools"
weight = 20
+++
Browsing tools allow you to query the S3 API without too many abstractions.
These tools are particularly suitable for debug, backups, website deployments or any scripted task that need to handle data.
| Name | Status | Note |
|------|--------|------|
| [Minio client](#minio-client) | ✅ | Recommended |
| [AWS CLI](#aws-cli) | ✅ | Recommended |
| [rclone](#rclone) | ✅ | |
| [s3cmd](#s3cmd) | ✅ | |
| [s5cmd](#s5cmd) | ✅ | |
| [(Cyber)duck](#cyberduck) | ✅ | |
| [WinSCP (libs3)](#winscp) | ✅ | CLI instructions only |
| [sftpgo](#sftpgo) | ✅ | |
## Minio client
Use the following command to set an "alias", i.e. define a new S3 server to be
used by the Minio client:
```bash
mc alias set \
garage \
<endpoint> \
<access key> \
<secret key> \
--api S3v4
```
Remember that `mc` is sometimes called `mcli` (such as on Arch Linux), to avoid conflicts
with Midnight Commander.
Some commands:
```bash
# list buckets
mc ls garage/
# list objets in a bucket
mc ls garage/my_files
# copy from your filesystem to garage
mc cp /proc/cpuinfo garage/my_files/cpuinfo.txt
# copy from garage to your filesystem
mc cp garage/my_files/cpuinfo.txt /tmp/cpuinfo.txt
# mirror a folder from your filesystem to garage
mc mirror --overwrite ./book garage/garagehq.deuxfleurs.fr
```
## AWS CLI
Create a file named `~/.aws/credentials` and put:
```toml
[default]
aws_access_key_id=xxxx
aws_secret_access_key=xxxx
```
Then a file named `~/.aws/config` and put:
```toml
[default]
region=garage
endpoint_url=http://127.0.0.1:3900
```
Now, supposing Garage is listening on `http://127.0.0.1:3900`, you can list your buckets with:
```bash
aws s3 ls
```
If you're using awscli `<1.29.0` or `<2.13.0`, you need to pass `--endpoint-url` to each CLI invocation explicitly.
As a workaround, you can redefine the aws command by editing the file `~/.bashrc` in this case:
```
function aws { command aws --endpoint-url http://127.0.0.1:3900 $@ ; }
```
*Do not forget to run `source ~/.bashrc` or to start a new terminal before running the next commands.*
Now you can simply run:
```bash
# list buckets
aws s3 ls
# list objects of a bucket
aws s3 ls s3://my_files
# copy from your filesystem to garage
aws s3 cp /proc/cpuinfo s3://my_files/cpuinfo.txt
# copy from garage to your filesystem
aws s3 cp s3/my_files/cpuinfo.txt /tmp/cpuinfo.txt
```
## `rclone`
`rclone` can be configured using the interactive assistant invoked using `rclone config`.
You can also configure `rclone` by writing directly its configuration file.
Here is a template `rclone.ini` configuration file (mine is located at `~/.config/rclone/rclone.conf`):
```ini
[garage]
type = s3
provider = Other
env_auth = false
access_key_id = <access key>
secret_access_key = <secret key>
region = <region>
endpoint = <endpoint>
force_path_style = true
acl = private
bucket_acl = private
```
Now you can run:
```bash
# list buckets
rclone lsd garage:
# list objects of a bucket aggregated in directories
rclone lsd garage:my-bucket
# copy from your filesystem to garage
echo hello world > /tmp/hello.txt
rclone copy /tmp/hello.txt garage:my-bucket/
# copy from garage to your filesystem
rclone copy garage:quentin.divers/hello.txt .
# see all available subcommands
rclone help
```
**Advice with rclone:** use the `--fast-list` option when accessing buckets with large amounts of objects.
This will tremendously accelerate operations such as `rclone sync` or `rclone ncdu` by reducing the number
of ListObjects calls that are made.
## `s3cmd`
Here is a template for the `s3cmd.cfg` file to talk with Garage:
```ini
[default]
access_key = <access key>
secret_key = <secret key>
host_base = <endpoint without http(s)://>
host_bucket = <same as host_base>
use_https = <False or True>
```
And use it as follow:
```bash
# List buckets
s3cmd ls
# s3cmd objects inside a bucket
s3cmd ls s3://my-bucket
# copy from your filesystem to garage
echo hello world > /tmp/hello.txt
s3cmd put /tmp/hello.txt s3://my-bucket/
# copy from garage to your filesystem
s3cmd get s3://my-bucket/hello.txt hello.txt
```
## `s5cmd`
Configure a credentials file as follows:
```bash
export AWS_ACCESS_KEY_ID=GK...
export AWS_SECRET_ACCESS_KEY=
export AWS_DEFAULT_REGION='garage'
export AWS_ENDPOINT='http://localhost:3900'
```
After adding these environment variables in your shell, `s5cmd` can be used
with:
```bash
s5cmd --endpoint-url=$AWS_ENDPOINT ls
```
See its usage output for other commands available.
## Cyberduck & duck {#cyberduck}
Both Cyberduck (the GUI) and duck (the CLI) have a concept of "Connection Profiles" that contain some presets for a specific provider.
Within Cyberduck, a
[Garage connection profile](https://docs.cyberduck.io/protocols/s3/garage/) is
available within the `Preferences -> Profiles` section. This can enabled and
then connections to Garage may be configured.
### Instuctions for the CLI
To configure duck (Cyberduck's CLI tool), start by creating its folder hierarchy:
```
mkdir -p ~/.duck/profiles/
```
Then, save the connection profile for Garage in `~/.duck/profiles/garage.cyberduckprofile`.
To set your credentials in `~/.duck/credentials`, use the following commands to generate the appropriate string:
```bash
export AWS_ACCESS_KEY_ID="GK..."
export AWS_SECRET_ACCESS_KEY="..."
export HOST="s3.garage.localhost"
export PORT="4443"
export PROTOCOL="https"
cat > ~/.duck/credentials <<EOF
$PROTOCOL\://$AWS_ACCESS_KEY_ID@$HOST\:$PORT=$AWS_SECRET_ACCESS_KEY
EOF
```
And finally, I recommend appending a small wrapper to your `~/.bashrc` to avoid setting the username on each command (do not forget to replace `GK...` by your access key):
```bash
function duck { command duck --username GK... $@ ; }
```
Finally, you can then use `duck` as follow:
```bash
# List buckets
duck --list garage:/
# List objects in a bucket
duck --list garage:/my-files/
# Download an object
duck --download garage:/my-files/an-object.txt /tmp/object.txt
# Upload an object
duck --upload /tmp/object.txt garage:/my-files/another-object.txt
# Delete an object
duck --delete garage:/my-files/an-object.txt
```
## WinSCP (libs3) {#winscp}
*You can find instructions on how to use the GUI in french [in our wiki](https://guide.deuxfleurs.fr/prise_en_main/winscp/).*
How to use `winscp.com`, the CLI interface of WinSCP:
```
open s3://GKxxxxx:yyyyyyy@127.0.0.1:4443 -certificate=* -rawsettings S3DefaultRegion=garage S3UrlStyle=1
ls
ls my-files/
get my-files/an-object.txt Z:\tmp\object.txt
put Z:\tmp\object.txt my-files/another-object.txt
rm my-files/an-object
exit
```
Notes:
- It seems WinSCP supports only TLS connections for S3
- `-certificate=*` allows self-signed certificates, remove it if you have valid certificates
## sftpgo {#sftpgo}
sftpgo needs a database to work, by default it uses sqlite and does not require additional configuration.
You can then directly init it:
```
sftpgo initprovider
```
Then you can directly launch the daemon that will listen by default on `:8080 (http)` and `:2022 (ssh)`:
```
sftpgo serve
```
Go to the admin web interface (http://[::1]:8080/web/admin/), create the required admin account, then create a user account.
Choose a username (eg: `ada`) and a password.
In the filesystem section, choose:
- Storage: AWS S3 (Compatible)
- Bucket: *your bucket name*
- Region: `garage` (or the one you defined in `config.toml`)
- Access key: *your access key*
- Access secret: *your secret key*
- Endpoint: *your endpoint*, eg. `https://garage.example.tld`, note that the protocol (`https` here) must be specified. Non standard ports and `http` have not been tested yet.
- Keep the default values for other fields
- Tick "Use path-style addressing". It should work without ticking it if you have correctly configured your instance to use URL vhost-style.
Now you can access your bucket through SFTP:
```
sftp -P2022 ada@[::1]
ls
```
And through the web interface at http://[::1]:8080/web/client

71
doc/book/connect/fs.md Normal file
View File

@ -0,0 +1,71 @@
+++
title = "FUSE (s3fs, goofys, s3backer...)"
weight = 25
+++
**WARNING! Garage is not POSIX compatible.
Mounting S3 buckets as filesystems will not provide POSIX compatibility.
If you are not careful, you will lose or corrupt your data.**
Do not use these FUSE filesystems to store any database files (eg. MySQL, Postgresql, Mongo or sqlite),
any daemon cache (dovecot, openldap, gitea, etc.),
and more generally any software that use locking, advanced filesystems features or make any synchronisation assumption.
Ideally, avoid these solutions at all for any serious or production use.
## rclone mount
rclone uses the same configuration when used [in CLI](@/documentation/connect/cli.md) and mount mode.
We suppose you have the following entry in your `rclone.ini` (mine is located in `~/.config/rclone/rclone.conf`):
```toml
[garage]
type = s3
provider = Other
env_auth = false
access_key_id = <access key>
secret_access_key = <secret key>
region = <region>
endpoint = <endpoint>
force_path_style = true
acl = private
bucket_acl = private
```
Then you can mount and access any bucket as follow:
```bash
# mount the bucket
mkdir /tmp/my-bucket
rclone mount --daemon garage:my-bucket /tmp/my-bucket
# set your working directory to the bucket
cd /tmp/my-bucket
# create a file
echo hello world > hello.txt
# access the file
cat hello.txt
# unmount the bucket
cd
fusermount -u /tmp/my-bucket
```
*External link:* [rclone documentation > rclone mount](https://rclone.org/commands/rclone_mount/)
## s3fs
*External link:* [s3fs github > README.md](https://github.com/s3fs-fuse/s3fs-fuse#user-content-examples)
## goofys
*External link:* [goofys github > README.md](https://github.com/kahing/goofys#user-content-usage)
## s3backer
*External link:* [s3backer github > manpage](https://github.com/archiecobbs/s3backer/wiki/ManPage)
## csi-s3
*External link:* [csi-s3 Github > README.md](https://github.com/ctrox/csi-s3)

View File

@ -0,0 +1,57 @@
+++
title = "Observability"
weight = 25
+++
An object store can be used as data storage location for metrics, and logs which
can then be leveraged for systems observability.
## Metrics
### Prometheus
Prometheus itself has no object store capabilities, however two projects exist
which support storing metrics in an object store:
- [Cortex](https://cortexmetrics.io/)
- [Thanos](https://thanos.io/)
## System logs
### Vector
[Vector](https://vector.dev/) natively supports S3 as a
[data sink](https://vector.dev/docs/reference/configuration/sinks/aws_s3/)
(and [source](https://vector.dev/docs/reference/configuration/sources/aws_s3/)).
This can be configured with Garage with the following:
```bash
garage key new --name vector-system-logs
garage bucket create system-logs
garage bucket allow system-logs --read --write --key vector-system-logs
```
The `vector.toml` can then be configured as follows:
```toml
[sources.journald]
type = "journald"
current_boot_only = true
[sinks.out]
encoding.codec = "json"
type = "aws_s3"
inputs = [ "journald" ]
bucket = "system-logs"
key_prefix = "%F/"
compression = "none"
region = "garage"
endpoint = "https://my-garage-instance.mydomain.tld"
auth.access_key_id = ""
auth.secret_access_key = ""
```
This is an example configuration - please refer to the Vector documentation for
all configuration and transformation possibilities. Also note that Garage
performs its own compression, so this should be disabled in Vector.

View File

@ -0,0 +1,211 @@
+++
title = "Repositories (Docker, Nix, Git...)"
weight = 15
+++
Whether you need to store and serve binary packages or source code, you may want to deploy a tool referred as a repository or registry.
Garage can also help you serve this content.
| Name | Status | Note |
|------|--------|------|
| [Gitea](#gitea) | ✅ | |
| [Docker](#docker) | ✅ | Requires garage >= v0.6.0 |
| [Nix](#nix) | ✅ | |
| [Gitlab](#gitlab) | ❓ | Not yet tested |
## Gitea
You can use Garage with Gitea to store your [git LFS](https://git-lfs.github.com/) data, your users' avatar, and their attachements.
You can configure a different target for each data type (check `[lfs]` and `[attachment]` sections of the Gitea documentation) and you can provide a default one through the `[storage]` section.
Let's start by creating a key and a bucket (your key id and secret will be needed later, keep them somewhere):
```bash
garage key create gitea-key
garage bucket create gitea
garage bucket allow gitea --read --write --key gitea-key
```
Then you can edit your configuration (by default `/etc/gitea/conf/app.ini`):
```ini
[storage]
STORAGE_TYPE=minio
MINIO_ENDPOINT=localhost:3900
MINIO_ACCESS_KEY_ID=GKxxx
MINIO_SECRET_ACCESS_KEY=xxxx
MINIO_BUCKET=gitea
MINIO_LOCATION=garage
MINIO_USE_SSL=false
```
You can also pass this configuration through environment variables:
```bash
GITEA__storage__STORAGE_TYPE=minio
GITEA__storage__MINIO_ENDPOINT=localhost:3900
GITEA__storage__MINIO_ACCESS_KEY_ID=GKxxx
GITEA__storage__MINIO_SECRET_ACCESS_KEY=xxxx
GITEA__storage__MINIO_BUCKET=gitea
GITEA__storage__MINIO_LOCATION=garage
GITEA__storage__MINIO_USE_SSL=false
```
Then restart your gitea instance and try to upload a custom avatar.
If it worked, you should see some content in your gitea bucket (you must configure your `aws` command before):
```
$ aws s3 ls s3://gitea/avatars/
2021-11-10 12:35:47 190034 616ba79ae2b84f565c33d72c2ec50861
```
*External link:* [Gitea Documentation > Configuration Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/)
## Docker
Create a bucket and a key for your docker registry, then create `config.yml` with the following content:
```yml
version: 0.1
http:
addr: 0.0.0.0:5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
s3:
accesskey: GKxxxx
secretkey: yyyyy
region: garage
regionendpoint: http://localhost:3900
bucket: docker
secure: false
v4auth: true
rootdirectory: /
```
Replace the `accesskey`, `secretkey`, `bucket`, `regionendpoint` and `secure` values by the one fitting your deployment.
Then simply run the docker registry:
```bash
docker run \
--net=host \
-v `pwd`/config.yml:/etc/docker/registry/config.yml \
registry:2
```
*We started a plain text registry but docker clients require encrypted registries. You must either [setup TLS](https://docs.docker.com/registry/deploying/#run-an-externally-accessible-registry) on your registry or add `--insecure-registry=localhost:5000` to your docker daemon parameters.*
*External link:* [Docker Documentation > Registry storage drivers > S3 storage driver](https://docs.docker.com/registry/storage-drivers/s3/)
## Nix
Nix has no repository in its terminology: instead, it breaks down this concept in 2 parts: binary cache and channel.
**A channel** is a set of `.nix` definitions that generate definitions for all the software you want to serve.
Because we do not want all our clients to compile all these derivations by themselves,
we can compile them once and then serve them as part of our **binary cache**.
It is possible to use a **binary cache** without a channel, you only need to serve your nix definitions
through another support, like a git repository.
As a first step, we will need to create a bucket on Garage and enabling website access on it:
```bash
garage key create nix-key
garage bucket create nix.example.com
garage bucket allow nix.example.com --read --write --key nix-key
garage bucket website nix.example.com --allow
```
If you need more information about exposing buckets as websites on Garage,
check [Exposing buckets as websites](@/documentation/cookbook/exposing-websites.md)
and [Configuring a reverse proxy](@/documentation/cookbook/reverse-proxy.md).
Next, we want to check that our bucket works:
```bash
echo nix repo > /tmp/index.html
mc cp /tmp/index.html garage/nix/
rm /tmp/index.html
curl https://nix.example.com
# output: nix repo
```
### Binary cache
To serve binaries as part of your cache, you need to sign them with a key specific to nix.
You can generate the keypair as follow:
```bash
nix-store --generate-binary-cache-key <name> cache-priv-key.pem cache-pub-key.pem
```
You can then manually sign the packages of your store with the following command:
```bash
nix sign-paths --all -k cache-priv-key.pem
```
Setting a key in `nix.conf` will do the signature at build time automatically without additional commands.
Edit the `nix.conf` of your builder:
```toml
secret-key-files = /etc/nix/cache-priv-key.pem
```
Now that your content is signed, you can copy a derivation to your cache.
For example, if you want to copy a specific derivation of your store:
```bash
nix copy /nix/store/wadmyilr414n7bimxysbny876i2vlm5r-bash-5.1-p8 --to 's3://nix?endpoint=garage.example.com&region=garage'
```
*Note that if you have not signed your packages, you can append to the end of your S3 URL `&secret-key=/etc/nix/cache-priv-key.pem`.*
Sometimes you don't want to hardcode this store path in your script.
Let suppose that you are working on a codebase that you build with `nix-build`, you can then run:
```bash
nix copy $(nix-build) --to 's3://nix?endpoint=garage.example.com&region=garage'
```
*This command works because the only thing that `nix-build` outputs on stdout is the paths of the built derivations in your nix store.*
You can include your derivation dependencies:
```bash
nix copy $(nix-store -qR $(nix-build)) --to 's3://nix?endpoint=garage.example.com&region=garage'
```
Now, your binary cache stores your derivation and all its dependencies.
Just inform your users that they must update their `nix.conf` file with the following lines:
```toml
substituters = https://cache.nixos.org https://nix.example.com
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix.example.com:eTGL6kvaQn6cDR/F9lDYUIP9nCVR/kkshYfLDJf1yKs=
```
*You must re-add cache.nixorg.org because redeclaring these keys override the previous configuration instead of extending it.*
Now, when your clients will run `nix-build` or any command that generates a derivation for which a hash is already present
on the binary cache, the client will download the result from the cache instead of compiling it, saving lot of time and CPU!
### Channels
Channels additionnaly serve Nix definitions, ie. a `.nix` file referencing
all the derivations you want to serve.
## Gitlab
*External link:* [Gitlab Documentation > Object storage](https://docs.gitlab.com/ee/administration/object_storage.html)

View File

@ -0,0 +1,86 @@
+++
title = "Websites (Hugo, Jekyll, Publii...)"
weight = 10
+++
Garage is also suitable [to host static websites](@/documentation/cookbook/exposing-websites.md).
While they can be deployed with traditional CLI tools, some static website generators have integrated options to ease your workflow.
| Name | Status | Note |
|------|--------|------|
| [Hugo](#hugo) | ✅ | Publishing logic is integrated in the tool |
| [Publii](#publii) | ✅ | Require a correctly configured s3 vhost endpoint |
| [Generic Static Site Generator](#generic-static-site-generator) | ✅ | Works for Jekyll, Zola, Gatsby, Pelican, etc. |
## Hugo
Add to your `config.toml` the following section:
```toml
[[deployment.targets]]
URL = "s3://<bucket>?endpoint=<endpoint>&disableSSL=<bool>&s3ForcePathStyle=true&region=garage"
```
For example:
```toml
[[deployment.targets]]
URL = "s3://my-blog?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true&region=garage"
```
Then inform hugo of your credentials:
```bash
export AWS_ACCESS_KEY_ID=GKxxx
export AWS_SECRET_ACCESS_KEY=xxx
```
And finally build and deploy your website:
```bsh
hugo
hugo deploy
```
*External links:*
- [gocloud.dev > aws > Supported URL parameters](https://pkg.go.dev/gocloud.dev/aws?utm_source=godoc#ConfigFromURLParams)
- [Hugo Documentation > hugo deploy](https://gohugo.io/hosting-and-deployment/hugo-deploy/)
## Publii
[![A screenshot of Publii's GUI](./publii.png)](./publii.png)
Deploying a website to Garage from Publii is natively supported.
First, make sure that your Garage administrator allowed and configured Garage to support vhost access style.
We also suppose that your bucket ("my-bucket") and key is already created and configured.
Then, from the left menu, click on server. Choose "S3" as the protocol.
In the configuration window, enter:
- Your finale website URL (eg. "http://my-bucket.web.garage.localhost:3902")
- Tick "Use a custom S3 provider"
- Set the S3 endpoint, (eg. "http://s3.garage.localhost:3900")
- Then put your access key (eg. "GK..."), your secret key, and your bucket (eg. "my-bucket")
- And hit the button "Save settings"
Now, each time you want to publish your website from Publii, just hit the bottom left button "Sync your website"!
## Generic Static Site Generator
Some tools do not support sending to a S3 backend but output a compiled folder on your system.
We can then use any CLI tool to upload this content to our S3 target.
First, start by [configuring minio client](@/documentation/connect/cli.md#minio-client).
Then build your website (example for jekyll):
```bash
jekyll build
```
And copy its output folder (`_site` for Jekyll) on S3:
```bash
mc mirror --overwrite _site garage/my-site
```

View File

@ -0,0 +1,39 @@
+++
title="Cookbook"
template = "documentation.html"
weight = 20
sort_by = "weight"
+++
A cookbook, when you cook, is a collection of recipes.
Similarly, Garage's cookbook contains a collection of recipes that are known to work well!
This chapter could also be referred as "Tutorials" or "Best practices".
- **[Multi-node deployment](@/documentation/cookbook/real-world.md):** This page will walk you through all of the necessary
steps to deploy Garage in a real-world setting.
- **[Building from source](@/documentation/cookbook/from-source.md):** This page explains how to build Garage from
source in case a binary is not provided for your architecture, or if you want to
hack with us!
- **[Binary packages](@/documentation/cookbook/binary-packages.md):** This page
lists the different platforms that provide ready-built software packages for
Garage.
- **[Integration with Systemd](@/documentation/cookbook/systemd.md):** This page explains how to run Garage
as a Systemd service (instead of as a Docker container).
- **[Configuring a gateway node](@/documentation/cookbook/gateways.md):** This page explains how to run a gateway node in a Garage cluster, i.e. a Garage node that doesn't store data but accelerates access to data present on the other nodes.
- **[Hosting a website](@/documentation/cookbook/exposing-websites.md):** This page explains how to use Garage
to host a static website.
- **[Configuring a reverse-proxy](@/documentation/cookbook/reverse-proxy.md):** This page explains how to configure a reverse-proxy to add TLS support to your S3 api endpoint.
- **[Deploying on Kubernetes](@/documentation/cookbook/kubernetes.md):** This page explains how to deploy Garage on Kubernetes using our Helm chart.
- **[Deploying with Ansible](@/documentation/cookbook/ansible.md):** This page lists available Ansible roles developed by the community to deploy Garage.
- **[Monitoring Garage](@/documentation/cookbook/monitoring.md)** This page
explains the Prometheus metrics available for monitoring the Garage
cluster/nodes.

View File

@ -0,0 +1,51 @@
+++
title = "Deploying with Ansible"
weight = 35
+++
While Ansible is not officially supported to deploy Garage, several community members
have published Ansible roles. We list them and compare them below.
## Comparison of Ansible roles
| Feature | [ansible-role-garage](#zorun-ansible-role-garage) | [garage-docker-ansible-deploy](#moan0s-garage-docker-ansible-deploy) |
|------------------------------------|---------------------------------------------|---------------------------------------------------------------|
| **Runtime** | Systemd | Docker |
| **Target OS** | Any Linux | Any Linux |
| **Architecture** | amd64, arm64, i686 | amd64, arm64 |
| **Additional software** | None | Traefik |
| **Automatic node connection** | ❌ | ✅ |
| **Layout management** | ❌ | ✅ |
| **Manage buckets & keys** | ❌ | ✅ (basic) |
| **Allow custom Garage config** | ✅ | ❌ |
| **Facilitate Garage upgrades** | ✅ | ❌ |
| **Multiple instances on one host** | ✅ | ✅ |
## zorun/ansible-role-garage
[Source code](https://github.com/zorun/ansible-role-garage), [Ansible galaxy](https://galaxy.ansible.com/zorun/garage)
This role is voluntarily simple: it relies on the official Garage static
binaries and only requires Systemd. As such, it should work on any
Linux-based OS.
To make things more flexible, the user has to provide a Garage
configuration template. This allows to customize Garage configuration in
any way.
Some more features might be added, such as a way to automatically connect
nodes to each other or to define a layout.
## moan0s/garage-docker-ansible-deploy
[Source code](https://github.com/moan0s/garage-docker-ansible-deploy), [Blog post](https://hyteck.de/post/garage/)
This role is based on the Docker image for Garage, and comes with
"batteries included": it will additionally install Docker and Traefik. In
addition, it is "opinionated" in the sense that it expects a particular
deployment structure (one instance per disk, one gateway per host,
structured DNS names, etc).
As a result, this role makes it easier to start with Garage on Ansible,
but is less flexible.

View File

@ -0,0 +1,41 @@
+++
title = "Binary packages"
weight = 11
+++
Garage is also available in binary packages on:
## Alpine Linux
If you use Alpine Linux, you can simply install the
[garage](https://pkgs.alpinelinux.org/packages?name=garage) package from the
Alpine Linux repositories (available since v3.17):
```bash
apk add garage
```
The default configuration file is installed to `/etc/garage.toml`. You can run
Garage using: `rc-service garage start`. If you don't specify `rpc_secret`, it
will be automatically replaced with a random string on the first start.
Please note that this package is built without Consul discovery, Kubernetes
discovery, OpenTelemetry exporter, and K2V features (K2V will be enabled once
it's stable).
## Arch Linux
Garage is available in the [AUR](https://aur.archlinux.org/packages/garage).
## FreeBSD
```bash
pkg install garage
```
## NixOS
```bash
nix-shell -p garage
```

View File

@ -0,0 +1,116 @@
+++
title = "Encryption"
weight = 50
+++
Encryption is a recurring subject when discussing Garage.
Garage does not handle data encryption by itself, but many things can
already be done with Garage's current feature set and the existing ecosystem.
This page takes a high level approach to security in general and data encryption
in particular.
# Examining your need for encryption
- Why do you want encryption in Garage?
- What is your threat model? What are you fearing?
- A stolen HDD?
- A curious administrator?
- A malicious administrator?
- A remote attacker?
- etc.
- What services do you want to protect with encryption?
- An existing application? Which one? (eg. Nextcloud)
- An application that you are writing
- Any expertise you may have on the subject
This page explains what Garage provides, and how you can improve the situation by yourself
by adding encryption at different levels.
We would be very curious to know your needs and thougs about ideas such as
encryption practices and things like key management, as we want Garage to be a
serious base platform for the developpment of secure, encrypted applications.
Do not hesitate to come talk to us if you have any thoughts or questions on the
subject.
# Capabilities provided by Garage
## Traffic is encrypted between Garage nodes
RPCs between Garage nodes are encrypted. More specifically, contrary to many
distributed software, it is impossible in Garage to have clear-text RPC. We
use the [kuska handshake](https://github.com/Kuska-ssb/handshake) library which
implements a protocol that has been clearly reviewed, Secure ScuttleButt's
Secret Handshake protocol. This is why setting a `rpc_secret` is mandatory,
and that's also why your nodes have super long identifiers.
## HTTP API endpoints provided by Garage are in clear text
Adding TLS support built into Garage is not currently planned.
## Garage stores data in plain text on the filesystem
Garage does not handle data encryption at rest by itself, and instead delegates
to the user to add encryption, either at the storage layer (LUKS, etc) or on
the client side (or both). There are no current plans to add data encryption
directly in Garage.
Implementing data encryption directly in Garage might make things simpler for
end users, but also raises many more questions, especially around key
management: for encryption of data, where could Garage get the encryption keys
from ? If we encrypt data but keep the keys in a plaintext file next to them,
it's useless. We probably don't want to have to manage secrets in garage as it
would be very hard to do in a secure way. Maybe integrate with an external
system such as Hashicorp Vault?
# Adding data encryption using external tools
## Encrypting traffic between a Garage node and your client
You have multiple options to have encryption between your client and a node:
- Setup a reverse proxy with TLS / ACME / Let's encrypt
- Setup a Garage gateway locally, and only contact the garage daemon on `localhost`
- Only contact your Garage daemon over a secure, encrypted overlay network such as Wireguard
## Encrypting data at rest
Protects against the following threats:
- Stolen HDD
Crucially, does not protect againt malicious sysadmins or remote attackers that
might gain access to your servers.
Methods include full-disk encryption with tools such as LUKS.
## Encrypting data on the client side
Protects againt the following threats:
- A honest-but-curious administrator
- A malicious administrator that tries to corrupt your data
- A remote attacker that can read your server's data
Implementations are very specific to the various applications. Examples:
- Matrix: uses the OLM protocol for E2EE of user messages. Media files stored
in Matrix are probably encrypted using symmetric encryption, with a key that is
distributed in the end-to-end encrypted message that contains the link to the object.
- XMPP: clients normally support either OMEMO / OpenPGP for the E2EE of user
messages. Media files are encrypted per
[XEP-0454](https://xmpp.org/extensions/xep-0454.html).
- Aerogramme: use the user's password as a key to decrypt data in the user's bucket
- Cyberduck: comes with support for
[Cryptomator](https://docs.cyberduck.io/cryptomator/) which allows users to
create client-side vaults to encrypt files in before they are uploaded to a
cloud storage endpoint.

View File

@ -0,0 +1,71 @@
+++
title = "Exposing buckets as websites"
weight = 25
+++
## Configuring a bucket for website access
There are three methods to expose buckets as website:
1. using the PutBucketWebsite S3 API call, which is allowed for access keys that have the owner permission bit set
2. from the Garage CLI, by an adminstrator of the cluster
3. using the Garage administration API
The `PutBucketWebsite` API endpoint [is documented](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) in the official AWS docs.
This endpoint can also be called [using `aws s3api`](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-website.html) on the command line.
The website configuration supported by Garage is only a subset of the possibilities on Amazon S3: redirections are not supported, only the index document and error document can be specified.
If you want to expose your bucket as a website from the CLI, use this simple command:
```bash
garage bucket website --allow my-website
```
Now it will be **publicly** exposed on the web endpoint (by default listening on port 3902).
## How exposed websites work
Our website serving logic is as follow:
- Supports only static websites (no support for PHP or other languages)
- Does not support directory listing
- The index file is defined per-bucket and can be specified in the `PutBucketWebsite` call
or on the CLI using the `--index-document` parameter (default: `index.html`)
- A custom error document for 404 errors can be specified in the `PutBucketWebsite` call
or on the CLI using the `--error-document` parameter
Now we need to infer the URL of your website through your bucket name.
Let assume:
- we set `root_domain = ".web.example.com"` in `garage.toml` ([ref](@/documentation/reference-manual/configuration.md#web_root_domain))
- our bucket name is `garagehq.deuxfleurs.fr`.
Our bucket will be served if the Host field matches one of these 2 values (the port is ignored):
- `garagehq.deuxfleurs.fr.web.example.com`: you can dedicate a subdomain to your users (here `web.example.com`).
- `garagehq.deuxfleurs.fr`: your users can bring their own domain name, they just need to point them to your Garage cluster.
You can try this logic locally, without configuring any DNS, thanks to `curl`:
```bash
# prepare your test
echo hello world > /tmp/index.html
mc cp /tmp/index.html garage/garagehq.deuxfleurs.fr
curl -H 'Host: garagehq.deuxfleurs.fr' http://localhost:3902
# should print "hello world"
curl -H 'Host: garagehq.deuxfleurs.fr.web.example.com' http://localhost:3902
# should also print "hello world"
```
Now that you understand how website logic works on Garage, you can:
- make the website endpoint listens on port 80 (instead of 3902)
- use iptables to redirect the port 80 to the port 3902:
`iptables -t nat -A PREROUTING -p tcp -dport 80 -j REDIRECT -to-port 3902`
- or configure a [reverse proxy](@/documentation/cookbook/reverse-proxy.md) in front of Garage to add TLS (HTTPS), CORS support, etc.
You can also take a look at [Website Integration](@/documentation/connect/websites.md) to see how you can add Garage to your workflow.

View File

@ -0,0 +1,96 @@
+++
title = "Compiling Garage from source"
weight = 10
+++
Garage is a standard Rust project. First, you need `rust` and `cargo`. For instance on Debian:
```bash
sudo apt-get update
sudo apt-get install -y rustc cargo
```
You can also use [Rustup](https://rustup.rs/) to setup a Rust toolchain easily.
In addition, you will need a full C toolchain. On Debian-based distributions, it can be installed as follows:
```bash
sudo apt-get update
sudo apt-get install build-essential
```
## Building from source from the Gitea repository
The primary location for Garage's source code is the
[Gitea repository](https://git.deuxfleurs.fr/Deuxfleurs/garage),
which contains all of the released versions as well as the code
for the developpement of the next version.
Clone the repository and enter it as follows:
```bash
git clone https://git.deuxfleurs.fr/Deuxfleurs/garage.git
cd garage
```
If you wish to build a specific version of Garage, check out the corresponding tag. For instance:
```bash
git tag # List available tags
git checkout v0.8.0 # Change v0.8.0 with the version you wish to build
```
Otherwise you will be building a developpement build from the `main` branch
that includes all of the changes to be released in the next version.
Be careful that such a build might be unstable or contain bugs,
and could be incompatible with nodes that run stable versions of Garage.
Finally, build Garage with the following command:
```bash
cargo build --release
```
The binary built this way can now be found in `target/release/garage`.
You may simply copy this binary to somewhere in your `$PATH` in order to
have the `garage` command available in your shell, for instance:
```bash
sudo cp target/release/garage /usr/local/bin/garage
```
If you are planning to develop Garage,
you might be interested in producing debug builds, which compile faster but run slower:
this can be done by removing the `--release` flag, and the resulting build can then
be found in `target/debug/garage`.
## List of available Cargo feature flags
Garage supports a number of compilation options in the form of Cargo feature flags,
which can be used to provide builds adapted to your system and your use case.
To produce a build with a given set of features, invoke the `cargo build` command
as follows:
```bash
# This will build the default feature set plus feature1, feature2 and feature3
cargo build --release --features feature1,feature2,feature3
# This will build ONLY feature1, feature2 and feature3
cargo build --release --no-default-features \
--features feature1,feature2,feature3
```
The following feature flags are available in v0.8.0:
| Feature flag | Enabled | Description |
| ------------ | ------- | ----------- |
| `bundled-libs` | *by default* | Use bundled version of sqlite3, zstd, lmdb and libsodium |
| `system-libs` | optional | Use system version of sqlite3, zstd, lmdb and libsodium<br>if available (exclusive with `bundled-libs`, build using<br>`cargo build --no-default-features --features system-libs`) |
| `k2v` | optional | Enable the experimental K2V API (if used, all nodes on your<br>Garage cluster must have it enabled as well) |
| `kubernetes-discovery` | optional | Enable automatic registration and discovery<br>of cluster nodes through the Kubernetes API |
| `metrics` | *by default* | Enable collection of metrics in Prometheus format on the admin API |
| `telemetry-otlp` | optional | Enable collection of execution traces using OpenTelemetry |
| `syslog` | optional | Enable logging to Syslog |
| `sled` | *by default* | Enable using Sled to store Garage's metadata |
| `lmdb` | *by default* | Enable using LMDB to store Garage's metadata |
| `sqlite` | *by default* | Enable using Sqlite3 to store Garage's metadata |

View File

@ -0,0 +1,39 @@
+++
title = "Configuring a gateway node"
weight = 20
+++
Gateways allow you to expose Garage endpoints (S3 API and websites) without storing data on the node.
## Benefits
You can configure Garage as a gateway on all nodes that will consume your S3 API, it will provide you the following benefits:
- **It removes 1 or 2 network RTT.** Instead of (querying your reverse proxy then) querying a random node of the cluster that will forward your request to the nodes effectively storing the data, your local gateway will directly knows which node to query.
- **It eases server management.** Instead of tracking in your reverse proxy and DNS what are the current Garage nodes, your gateway being part of the cluster keeps this information for you. In your software, you will always specify `http://localhost:3900`.
- **It simplifies security.** Instead of having to maintain and renew a TLS certificate, you leverage the Secret Handshake protocol we use for our cluster. The S3 API protocol will be in plain text but limited to your local machine.
## Spawn a Gateway
The instructions are similar to a regular node, the only option that is different is while configuring the node, you must set the `--gateway` parameter:
```bash
garage layout assign --gateway --tag gw1 -z dc1 <node_id>
garage layout show # review the changes you are making
garage layout apply # once satisfied, apply the changes
```
Then use `http://localhost:3900` when a S3 endpoint is required:
```bash
aws --endpoint-url http://127.0.0.1:3900 s3 ls
```
If a newly added gateway node seems to not be working, do a full table resync to ensure that bucket and key list are correctly propagated:
```bash
garage repair -a --yes tables
```

View File

@ -0,0 +1,88 @@
+++
title = "Deploying on Kubernetes"
weight = 32
+++
Garage can also be deployed on a kubernetes cluster via helm chart.
## Deploying
Firstly clone the repository:
```bash
git clone https://git.deuxfleurs.fr/Deuxfleurs/garage
cd garage/scripts/helm
```
Deploy with default options:
```bash
helm install --create-namespace --namespace garage garage ./garage
```
Or deploy with custom values:
```bash
helm install --create-namespace --namespace garage garage ./garage -f values.override.yaml
```
After deploying, cluster layout must be configured manually as described in [Creating a cluster layout](@/documentation/quick-start/_index.md#creating-a-cluster-layout). Use the following command to access garage CLI:
```bash
kubectl exec --stdin --tty -n garage garage-0 -- ./garage status
```
## Overriding default values
All possible configuration values can be found with:
```bash
helm show values ./garage
```
This is an example `values.overrride.yaml` for deploying in a microk8s cluster with a https s3 api ingress route:
```yaml
garage:
# Use only 2 replicas per object
replicationMode: "2"
# Start 4 instances (StatefulSets) of garage
deployment:
replicaCount: 4
# Override default storage class and size
persistence:
meta:
storageClass: "openebs-hostpath"
size: 100Mi
data:
storageClass: "openebs-hostpath"
size: 1Gi
ingress:
s3:
api:
enabled: true
className: "public"
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: 500m
hosts:
- host: s3-api.my-domain.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: garage-ingress-cert
hosts:
- s3-api.my-domain.com
```
## Removing
```bash
helm delete --namespace garage garage
```
Note that this will leave behind custom CRD `garagenodes.deuxfleurs.fr`, which must be removed manually if desired.

View File

@ -0,0 +1,53 @@
+++
title = "Monitoring Garage"
weight = 40
+++
Garage exposes some internal metrics in the Prometheus data format.
This page explains how to exploit these metrics.
## Setting up monitoring
### Enabling the Admin API endpoint
If you have not already enabled the [administration API endpoint](@/documentation/reference-manual/admin-api.md), do so by adding the following lines to your configuration file:
```toml
[admin]
api_bind_addr = "0.0.0.0:3903"
```
This will allow anyone to scrape Prometheus metrics by fetching
`http://localhost:3903/metrics`. If you want to restrict access
to the exported metrics, set the `metrics_token` configuration value
to a bearer token to be used when fetching the metrics endpoint.
### Setting up Prometheus and Grafana
Add a scrape config to your Prometheus daemon to scrape metrics from
all of your nodes:
```yaml
scrape_configs:
- job_name: 'garage'
static_configs:
- targets:
- 'node1.mycluster:3903'
- 'node2.mycluster:3903'
- 'node3.mycluster:3903'
```
If you have set a metrics token in your Garage configuration file,
add the following lines in your Prometheus scrape config:
```yaml
authorization:
type: Bearer
credentials: 'your metrics token'
```
To visualize the scraped data in Grafana,
you can either import our [Grafana dashboard for Garage](https://git.deuxfleurs.fr/Deuxfleurs/garage/raw/branch/main/script/telemetry/grafana-garage-dashboard-prometheus.json)
or make your own.
The list of exported metrics is available on our [dedicated page](@/documentation/reference-manual/monitoring.md) in the Reference manual section.

View File

@ -0,0 +1,372 @@
+++
title = "Deployment on a cluster"
weight = 5
+++
To run Garage in cluster mode, we recommend having at least 3 nodes.
This will allow you to setup Garage for three-way replication of your data,
the safest and most available mode proposed by Garage.
We recommend first following the [quick start guide](@/documentation/quick-start/_index.md) in order
to get familiar with Garage's command line and usage patterns.
## Preparing your environment
### Prerequisites
To run a real-world deployment, make sure the following conditions are met:
- You have at least three machines with sufficient storage space available.
- Each machine has an IP address which makes it directly reachable by all other machines.
In many cases, nodes will be behind a NAT and will not each have a public
IPv4 addresses. In this case, is recommended that you use IPv6 for this
end-to-end connectivity if it is available. Otherwise, using a mesh VPN such as
[Nebula](https://github.com/slackhq/nebula) or
[Yggdrasil](https://yggdrasil-network.github.io/) are approaches to consider
in addition to building out your own VPN tunneling.
- This guide will assume you are using Docker containers to deploy Garage on each node.
Garage can also be run independently, for instance as a [Systemd service](@/documentation/cookbook/systemd.md).
You can also use an orchestrator such as Nomad or Kubernetes to automatically manage
Docker containers on a fleet of nodes.
Before deploying Garage on your infrastructure, you must inventory your machines.
For our example, we will suppose the following infrastructure with IPv6 connectivity:
| Location | Name | IP Address | Disk Space |
|----------|---------|------------|------------|
| Paris | Mercury | fc00:1::1 | 1 TB |
| Paris | Venus | fc00:1::2 | 2 TB |
| London | Earth | fc00:B::1 | 2 TB |
| Brussels | Mars | fc00:F::1 | 1.5 TB |
Note that Garage will **always** store the three copies of your data on nodes at different
locations. This means that in the case of this small example, the usable capacity
of the cluster is in fact only 1.5 TB, because nodes in Brussels can't store more than that.
This also means that nodes in Paris and London will be under-utilized.
To make better use of the available hardware, you should ensure that the capacity
available in the different locations of your cluster is roughly the same.
For instance, here, the Mercury node could be moved to Brussels; this would allow the cluster
to store 2 TB of data in total.
### Best practices
- If you have reasonably fast networking between all your nodes, and are planing to store
mostly large files, bump the `block_size` configuration parameter to 10 MB
(`block_size = "10M"`).
- Garage stores its files in two locations: it uses a metadata directory to store frequently-accessed
small metadata items, and a data directory to store data blocks of uploaded objects.
Ideally, the metadata directory would be stored on an SSD (smaller but faster),
and the data directory would be stored on an HDD (larger but slower).
- For the data directory, Garage already does checksumming and integrity verification,
so there is no need to use a filesystem such as BTRFS or ZFS that does it.
We recommend using XFS for the data partition, as it has the best performance.
EXT4 is not recommended as it has more strict limitations on the number of inodes,
which might cause issues with Garage when large numbers of objects are stored.
- Servers with multiple HDDs are supported natively by Garage without resorting
to RAID, see [our dedicated documentation page](@/documentation/operations/multi-hdd.md).
- For the metadata storage, Garage does not do checksumming and integrity
verification on its own, so it is better to use a robust filesystem such as
BTRFS or ZFS. Users have reported that when using the LMDB database engine
(the default), database files have a tendency of becoming corrupted after an
unclean shutdown (e.g. a power outage), so you should take regular snapshots
to be able to recover from such a situation. This can be done using Garage's
built-in automatic snapshotting (since v0.9.4), or by using filesystem level
snapshots. If you cannot do so, you might want to switch to Sqlite which is
more robust.
- LMDB is the fastest and most tested database engine, but it has the following
weaknesses: 1/ data files are not architecture-independent, you cannot simply
move a Garage metadata directory between nodes running different architectures,
and 2/ LMDB is not suited for 32-bit platforms. Sqlite is a viable alternative
if any of these are of concern.
- If you only have an HDD and no SSD, it's fine to put your metadata alongside
the data on the same drive, but then consider your filesystem choice wisely
(see above). Having lots of RAM for your kernel to cache the metadata will
help a lot with performance.
## Get a Docker image
Our docker image is currently named `dxflrs/garage` and is stored on the [Docker Hub](https://hub.docker.com/r/dxflrs/garage/tags?page=1&ordering=last_updated).
We encourage you to use a fixed tag (eg. `v0.9.3`) and not the `latest` tag.
For this example, we will use the latest published version at the time of the writing which is `v0.9.3` but it's up to you
to check [the most recent versions on the Docker Hub](https://hub.docker.com/r/dxflrs/garage/tags?page=1&ordering=last_updated).
For example:
```
sudo docker pull dxflrs/garage:v0.9.3
```
## Deploying and configuring Garage
On each machine, we will have a similar setup,
especially you must consider the following folders/files:
- `/etc/garage.toml`: Garage daemon's configuration (see below)
- `/var/lib/garage/meta/`: Folder containing Garage's metadata,
put this folder on a SSD if possible
- `/var/lib/garage/data/`: Folder containing Garage's data,
this folder will be your main data storage and must be on a large storage (e.g. large HDD)
A valid `/etc/garage.toml` for our cluster would look as follows:
```toml
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "lmdb"
metadata_auto_snapshot_interval = "6h"
replication_mode = "3"
compression_level = 2
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "<this node's public IP>:3901"
rpc_secret = "<RPC secret>"
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage"
[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage"
index = "index.html"
```
Check the following for your configuration files:
- Make sure `rpc_public_addr` contains the public IP address of the node you are configuring.
This parameter is optional but recommended: if your nodes have trouble communicating with
one another, consider adding it.
- Make sure `rpc_secret` is the same value on all nodes. It should be a 32-bytes hex-encoded secret key.
You can generate such a key with `openssl rand -hex 32`.
## Starting Garage using Docker
On each machine, you can run the daemon with:
```bash
docker run \
-d \
--name garaged \
--restart always \
--network host \
-v /etc/garage.toml:/etc/garage.toml \
-v /var/lib/garage/meta:/var/lib/garage/meta \
-v /var/lib/garage/data:/var/lib/garage/data \
dxflrs/garage:v0.9.3
```
With this command line, Garage should be started automatically at each boot.
Please note that we use host networking as otherwise the network indirection
added by Docker would prevent Garage nodes from communicating with one another
(especially if using IPv6).
If you want to use `docker-compose`, you may use the following `docker-compose.yml` file as a reference:
```yaml
version: "3"
services:
garage:
image: dxflrs/garage:v0.9.3
network_mode: "host"
restart: unless-stopped
volumes:
- /etc/garage.toml:/etc/garage.toml
- /var/lib/garage/meta:/var/lib/garage/meta
- /var/lib/garage/data:/var/lib/garage/data
```
If you wish to upgrade your cluster, make sure to read the corresponding
[documentation page](@/documentation/operations/upgrading.md) first, as well as
the documentation relevant to your version of Garage in the case of major
upgrades. With the containerized setup proposed here, the upgrade process
will require stopping and removing the existing container, and re-creating it
with the upgraded version.
## Controlling the daemon
The `garage` binary has two purposes:
- it acts as a daemon when launched with `garage server`
- it acts as a control tool for the daemon when launched with any other command
Ensure an appropriate `garage` binary (the same version as your Docker image) is available in your path.
If your configuration file is at `/etc/garage.toml`, the `garage` binary should work with no further change.
You can also use an alias as follows to use the Garage binary inside your docker container:
```bash
alias garage="docker exec -ti <container name> /garage"
```
You can test your `garage` CLI utility by running a simple command such as:
```bash
garage status
```
At this point, nodes are not yet talking to one another.
Your output should therefore look like follows:
```
Mercury$ garage status
==== HEALTHY NODES ====
ID Hostname Address Tag Zone Capacity
563e1ac825ee3323… Mercury [fc00:1::1]:3901 NO ROLE ASSIGNED
```
## Connecting nodes together
When your Garage nodes first start, they will generate a local node identifier
(based on a public/private key pair).
To obtain the node identifier of a node, once it is generated,
run `garage node id`.
This will print keys as follows:
```bash
Mercury$ garage node id
563e1ac825ee3323aa441e72c26d1030d6d4414aeb3dd25287c531e7fc2bc95d@[fc00:1::1]:3901
Venus$ garage node id
86f0f26ae4afbd59aaf9cfb059eefac844951efd5b8caeec0d53f4ed6c85f332@[fc00:1::2]:3901
etc.
```
You can then instruct nodes to connect to one another as follows:
```bash
# Instruct Venus to connect to Mercury (this will establish communication both ways)
Venus$ garage node connect 563e1ac825ee3323aa441e72c26d1030d6d4414aeb3dd25287c531e7fc2bc95d@[fc00:1::1]:3901
```
You don't need to instruct all node to connect to all other nodes:
nodes will discover one another transitively.
Now if your run `garage status` on any node, you should have an output that looks as follows:
```
==== HEALTHY NODES ====
ID Hostname Address Tag Zone Capacity
563e1ac825ee3323… Mercury [fc00:1::1]:3901 NO ROLE ASSIGNED
86f0f26ae4afbd59… Venus [fc00:1::2]:3901 NO ROLE ASSIGNED
68143d720f20c89d… Earth [fc00:B::1]:3901 NO ROLE ASSIGNED
212f7572f0c89da9… Mars [fc00:F::1]:3901 NO ROLE ASSIGNED
```
## Creating a cluster layout
We will now inform Garage of the disk space available on each node of the cluster
as well as the zone (e.g. datacenter) in which each machine is located.
This information is called the **cluster layout** and consists
of a role that is assigned to each active cluster node.
For our example, we will suppose we have the following infrastructure
(Capacity, Identifier and Zone are specific values to Garage described in the following):
| Location | Name | Disk Space | Identifier | Zone (`-z`) | Capacity (`-c`) |
|----------|---------|------------|------------|-------------|-----------------|
| Paris | Mercury | 1 TB | `563e` | `par1` | `1T` |
| Paris | Venus | 2 TB | `86f0` | `par1` | `2T` |
| London | Earth | 2 TB | `6814` | `lon1` | `2T` |
| Brussels | Mars | 1.5 TB | `212f` | `bru1` | `1.5T` |
#### Node identifiers
After its first launch, Garage generates a random and unique identifier for each nodes, such as:
```
563e1ac825ee3323aa441e72c26d1030d6d4414aeb3dd25287c531e7fc2bc95d
```
Often a shorter form can be used, containing only the beginning of the identifier, like `563e`,
which identifies the server "Mercury" located in "Paris" according to our previous table.
The most simple way to match an identifier to a node is to run:
```
garage status
```
It will display the IP address associated with each node;
from the IP address you will be able to recognize the node.
We will now use the `garage layout assign` command to configure the correct parameters for each node.
#### Zones
Zones are simply a user-chosen identifier that identify a group of server that are grouped together logically.
It is up to the system administrator deploying Garage to identify what does "grouped together" means.
In most cases, a zone will correspond to a geographical location (i.e. a datacenter).
Behind the scene, Garage will use zone definition to try to store the same data on different zones,
in order to provide high availability despite failure of a zone.
Zones are passed to Garage using the `-z` flag of `garage layout assign` (see below).
#### Capacity
Garage needs to know the storage capacity (disk space) it can/should use on
each node, to be able to correctly balance data.
Capacity values are expressed in bytes and are passed to Garage using the `-c` flag of `garage layout assign` (see below).
#### Tags
You can add additional tags to nodes using the `-t` flag of `garage layout assign` (see below).
Tags have no specific meaning for Garage and can be used at your convenience.
#### Injecting the topology
Given the information above, we will configure our cluster as follow:
```bash
garage layout assign 563e -z par1 -c 1T -t mercury
garage layout assign 86f0 -z par1 -c 2T -t venus
garage layout assign 6814 -z lon1 -c 2T -t earth
garage layout assign 212f -z bru1 -c 1.5T -t mars
```
At this point, the changes in the cluster layout have not yet been applied.
To show the new layout that will be applied, call:
```bash
garage layout show
```
Make sure to read carefully the output of `garage layout show`.
Once you are satisfied with your new layout, apply it with:
```bash
garage layout apply
```
**WARNING:** if you want to use the layout modification commands in a script,
make sure to read [this page](@/documentation/operations/layout.md) first.
## Using your Garage cluster
Creating buckets and managing keys is done using the `garage` CLI,
and is covered in the [quick start guide](@/documentation/quick-start/_index.md).
Remember also that the CLI is self-documented thanks to the `--help` flag and
the `help` subcommand (e.g. `garage help`, `garage key --help`).
Configuring S3-compatible applications to interact with Garage
is covered in the [Integrations](@/documentation/connect/_index.md) section.

View File

@ -0,0 +1,503 @@
+++
title = "Configuring a reverse proxy"
weight = 30
+++
The main reason to add a reverse proxy in front of Garage is to provide TLS to your users and serve multiple web services on port 443.
In production you will likely need your certificates signed by a certificate authority.
The most automated way is to use a provider supporting the [ACME protocol](https://datatracker.ietf.org/doc/html/rfc8555)
such as [Let's Encrypt](https://letsencrypt.org/), [ZeroSSL](https://zerossl.com/) or [Buypass Go SSL](https://www.buypass.com/ssl/products/acme).
If you are only testing Garage, you can generate a self-signed certificate to follow the documentation:
```bash
openssl req \
-new \
-x509 \
-keyout /tmp/garage.key \
-out /tmp/garage.crt \
-nodes \
-subj "/C=XX/ST=XX/L=XX/O=XX/OU=XX/CN=localhost/emailAddress=X@X.XX" \
-addext "subjectAltName = DNS:localhost, IP:127.0.0.1"
cat /tmp/garage.key /tmp/garage.crt > /tmp/garage.pem
```
Be careful as you will need to allow self signed certificates in your client.
For example, with minio, you must add the `--insecure` flag.
An example:
```bash
mc ls --insecure garage/
```
## socat (only for testing purposes)
If you want to test Garage with a TLS frontend, socat can do it for you in a single command:
```bash
socat \
"openssl-listen:443,\
reuseaddr,\
fork,\
verify=0,\
cert=/tmp/garage.pem" \
tcp4-connect:localhost:3900
```
## Nginx
Nginx is a well-known reverse proxy suitable for production.
We do the configuration in 3 steps: first we define the upstream blocks ("the backends")
then we define the server blocks ("the frontends") for the S3 endpoint and finally for the web endpoint.
The following configuration blocks can be all put in the same `/etc/nginx/sites-available/garage.conf`.
To make your configuration active, run `ln -s /etc/nginx/sites-available/garage.conf /etc/nginx/sites-enabled/`.
If you directly put the instructions in the root `nginx.conf`, keep in mind that these configurations must be enclosed inside a `http { }` block.
And do not forget to reload nginx with `systemctl reload nginx` or `nginx -s reload`.
### Exposing the S3 endpoints
First, we need to tell to nginx how to access our Garage cluster.
Because we have multiple nodes, we want to leverage all of them by spreading the load.
In nginx, we can do that with the `upstream` directive.
Then in a `server` directive, we define the vhosts, the TLS certificates and the proxy rule.
A possible configuration:
```nginx
upstream s3_backend {
# If you have a garage instance locally.
server 127.0.0.1:3900;
# You can also put your other instances.
server 192.168.1.3:3900;
# Domain names also work.
server garage1.example.com:3900;
# A "backup" server is only used if all others have failed.
server garage-remote.example.com:3900 backup;
# You can assign weights if you have some servers
# that can serve more requests than others.
server garage2.example.com:3900 weight=2;
}
server {
listen [::]:443 http2 ssl;
ssl_certificate /tmp/garage.crt;
ssl_certificate_key /tmp/garage.key;
# You need multiple server names here:
# - s3.garage.tld is used for path-based s3 requests
# - *.s3.garage.tld is used for vhost-based s3 requests
server_name s3.garage.tld *.s3.garage.tld;
location / {
proxy_pass http://s3_backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
# Disable buffering to a temporary file.
proxy_max_temp_file_size 0;
}
}
```
### Exposing the web endpoint
To better understand the logic involved, you can refer to the [Exposing buckets as websites](/cookbook/exposing_websites.html) section.
Otherwise, the configuration is very similar to the S3 endpoint.
You must only adapt `upstream` with the web port instead of the s3 port and change the `server_name` and `proxy_pass` entry
A possible configuration:
```nginx
upstream web_backend {
server 127.0.0.1:3902;
server 192.168.1.3:3902;
server garage1.example.com:3902;
server garage2.example.com:3902 weight=2;
}
server {
listen [::]:443 http2 ssl;
ssl_certificate /tmp/garage.crt;
ssl_certificate_key /tmp/garage.key;
# You need multiple server names here:
# - *.web.garage.tld is used for your users wanting a website without reserving a domain name
# - example.com, my-site.tld, etc. are reserved domain name by your users that chose to host their website as a garage's bucket
server_name *.web.garage.tld example.com my-site.tld;
location / {
proxy_pass http://web_backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
```
## Apache httpd
@TODO
## Traefik v2
We will see in this part how to set up a reverse proxy with [Traefik](https://docs.traefik.io/).
Here is [a basic configuration file](https://doc.traefik.io/traefik/https/acme/#configuration-examples):
```toml
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.websecure]
address = ":443"
[certificatesResolvers.myresolver.acme]
email = "your-email@example.com"
storage = "acme.json"
[certificatesResolvers.myresolver.acme.httpChallenge]
# used during the challenge
entryPoint = "web"
```
### Add Garage service
To add Garage on Traefik you should declare two new services using its IP
address (or hostname) and port, these are used for the S3, and web components
of Garage:
```toml
[http.services]
[http.services.garage-s3-service.loadBalancer]
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://xxx.xxx.xxx.xxx"
port = 3900
[http.services.garage-web-service.loadBalancer]
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://xxx.xxx.xxx.xxx"
port = 3902
```
It's possible to declare multiple Garage servers as back-ends:
```toml
[http.services]
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://xxx.xxx.xxx.xxx"
port = 3900
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://yyy.yyy.yyy.yyy"
port = 3900
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://zzz.zzz.zzz.zzz"
port = 3900
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://xxx.xxx.xxx.xxx"
port = 3902
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://yyy.yyy.yyy.yyy"
port = 3902
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://zzz.zzz.zzz.zzz"
port = 3902
```
Traefik can remove unhealthy servers automatically with [a health check configuration](https://doc.traefik.io/traefik/routing/services/#health-check):
```
[http.services]
[http.services.garage-s3-service.loadBalancer]
[http.services.garage-s3-service.loadBalancer.healthCheck]
path = "/health"
port = "3903"
#interval = "15s"
#timeout = "2s"
[http.services.garage-web-service.loadBalancer]
[http.services.garage-web-service.loadBalancer.healthCheck]
path = "/health"
port = "3903"
#interval = "15s"
#timeout = "2s"
```
### Adding a website
To add a new website, add the following declaration to your Traefik configuration file:
```toml
[http.routers]
[http.routers.garage-s3]
rule = "Host(`s3.example.org`)"
service = "garage-s3-service"
entryPoints = ["websecure"]
[http.routers.my_website]
rule = "Host(`yoururl.example.org`)"
service = "garage-web-service"
entryPoints = ["websecure"]
```
Enable HTTPS access to your website with the following configuration section ([documentation](https://doc.traefik.io/traefik/https/overview/)):
```toml
...
entryPoints = ["websecure"]
[http.routers.my_website.tls]
certResolver = "myresolver"
...
```
### Adding compression
Add the following configuration section [to compress response](https://doc.traefik.io/traefik/middlewares/http/compress/) using [gzip](https://developer.mozilla.org/en-US/docs/Glossary/GZip_compression) before sending them to the client:
```toml
[http.routers]
[http.routers.my_website]
...
middlewares = ["compression"]
...
[http.middlewares]
[http.middlewares.compression.compress]
```
### Add caching response
Traefik's caching middleware is only available on [entreprise version](https://doc.traefik.io/traefik-enterprise/middlewares/http-cache/), however the freely-available [Souin plugin](https://github.com/darkweak/souin#tr%C3%A6fik-container) can also do the job. (section to be completed)
### Complete example
```toml
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.websecure]
address = ":443"
[certificatesResolvers.myresolver.acme]
email = "your-email@example.com"
storage = "acme.json"
[certificatesResolvers.myresolver.acme.httpChallenge]
# used during the challenge
entryPoint = "web"
[http.routers]
[http.routers.garage-s3]
rule = "Host(`s3.example.org`)"
service = "garage-s3-service"
entryPoints = ["websecure"]
[http.routers.my_website]
rule = "Host(`yoururl.example.org`)"
service = "garage-web-service"
middlewares = ["compression"]
entryPoints = ["websecure"]
[http.services]
[http.services.garage-s3-service.loadBalancer]
[http.services.garage-s3-service.loadBalancer.healthCheck]
path = "/health"
port = "3903"
#interval = "15s"
#timeout = "2s"
[http.services.garage-web-service.loadBalancer]
[http.services.garage-web-service.loadBalancer.healthCheck]
path = "/health"
port = "3903"
#interval = "15s"
#timeout = "2s"
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://xxx.xxx.xxx.xxx"
port = 3900
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://yyy.yyy.yyy.yyy"
port = 3900
[[http.services.garage-s3-service.loadBalancer.servers]]
url = "http://zzz.zzz.zzz.zzz"
port = 3900
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://xxx.xxx.xxx.xxx"
port = 3902
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://yyy.yyy.yyy.yyy"
port = 3902
[[http.services.garage-web-service.loadBalancer.servers]]
url = "http://zzz.zzz.zzz.zzz"
port = 3902
[http.middlewares]
[http.middlewares.compression.compress]
```
## Caddy
Your Caddy configuration can be as simple as:
```caddy
s3.garage.tld, *.s3.garage.tld {
reverse_proxy localhost:3900 192.168.1.2:3900 example.tld:3900 {
health_uri /health
health_port 3903
#health_interval 15s
#health_timeout 5s
}
}
*.web.garage.tld {
reverse_proxy localhost:3902 192.168.1.2:3902 example.tld:3902 {
health_uri /health
health_port 3903
#health_interval 15s
#health_timeout 5s
}
}
admin.garage.tld {
reverse_proxy localhost:3903 {
health_uri /health
health_port 3903
#health_interval 15s
#health_timeout 5s
}
}
```
But at the same time, the `reverse_proxy` is very flexible.
For a production deployment, you should [read its documentation](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy) as it supports features like DNS discovery of upstreams, load balancing with checks, streaming parameters, etc.
### Caching
Caddy can compiled with a
[cache plugin](https://github.com/caddyserver/cache-handler) which can be used
to provide a hot-cache at the webserver-level for static websites hosted by
Garage.
This can be configured as follows:
```caddy
# Caddy global configuration section
{
# Bare minimum configuration to enable cache.
order cache before rewrite
cache
#cache
# allowed_http_verbs GET
# default_cache_control public
# ttl 8h
#}
}
# Site specific section
https:// {
cache
#cache {
# timeout {
# backend 30s
# }
#}
reverse_proxy ...
}
```
Caching is a complicated subject, and the reader is encouraged to study the
available options provided by the plugin.
### On-demand TLS
Caddy supports a technique called
[on-demand TLS](https://caddyserver.com/docs/automatic-https#on-demand-tls), by
which one can configure the webserver to provision TLS certificates when a
client first connects to it.
In order to prevent an attack vector whereby domains are simply pointed at your
webserver and certificates are requested for them - Caddy can be configured to
ask Garage if a domain is authorized for web hosting, before it then requests
a TLS certificate.
This 'check' endpoint, which is on the admin port (3903 by default), can be
configured in Caddy's global section as follows:
```caddy
{
...
on_demand_tls {
ask http://localhost:3903/check
interval 2m
burst 5
}
...
}
```
The host section can then be configured with (note that this uses the web
endpoint instead):
```caddy
# For a specific set of subdomains
*.web.garage.tld {
tls {
on_demand
}
reverse_proxy localhost:3902 192.168.1.2:3902 example.tld:3902
}
# Accept all domains on HTTPS
# Never configure this without global section above
https:// {
tls {
on_demand
}
reverse_proxy localhost:3902 192.168.1.2:3902 example.tld:3902
}
```
More information on how this endpoint is implemented in Garage is available
in the [Admin API Reference](@/documentation/reference-manual/admin-api.md) page.
### Fileserver browser
Caddy's built-in
[file_server](https://caddyserver.com/docs/caddyfile/directives/file_server)
browser functionality can be extended with the
[caddy-fs-s3](https://github.com/sagikazarmark/caddy-fs-s3) module.
This can be configured to use Garage as a backend with the following
configuration:
```caddy
browse.garage.tld {
file_server {
fs s3 {
bucket test-bucket
region garage
endpoint https://s3.garage.tld
use_path_style
}
browse
}
}
```
Caddy must also be configured with the required `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` environment variables to access the bucket.

View File

@ -1,4 +1,7 @@
# Starting Garage with systemd
+++
title = "Starting Garage with systemd"
weight = 15
+++
We make some assumptions for this systemd deployment.
@ -30,7 +33,20 @@ NoNewPrivileges=true
WantedBy=multi-user.target
```
*A note on hardening: garage will be run as a non privileged user, its user id is dynamically allocated by systemd. It cannot access (read or write) home folders (/home, /root and /run/user), the rest of the filesystem can only be read but not written, only the path seen as /var/lib/garage is writable as seen by the service (mapped to /var/lib/private/garage on your host). Additionnaly, the process can not gain new privileges over time.*
**A note on hardening:** Garage will be run as a non privileged user, its user
id is dynamically allocated by systemd (set with `DynamicUser=true`). It cannot
access (read or write) home folders (`/home`, `/root` and `/run/user`), the
rest of the filesystem can only be read but not written, only the path seen as
`/var/lib/garage` is writable as seen by the service. Additionnaly, the process
can not gain new privileges over time.
For this to work correctly, your `garage.toml` must be set with
`metadata_dir=/var/lib/garage/meta` and `data_dir=/var/lib/garage/data`. This
is mandatory to use the DynamicUser hardening feature of systemd, which
autocreates these directories as virtual mapping. If the directory
`/var/lib/garage` already exists before starting the server for the first time,
the systemd service might not start correctly. Note that in your host
filesystem, Garage data will be held in `/var/lib/private/garage`.
To start the service then automatically enable it at boot:

35
doc/book/design/_index.md Normal file
View File

@ -0,0 +1,35 @@
+++
title = "Design"
weight = 70
sort_by = "weight"
template = "documentation.html"
+++
The design section helps you to see Garage from a "big picture"
perspective. It will allow you to understand if Garage is a good fit for
you, how to better use it, how to contribute to it, what can Garage could
and could not do, etc.
- **[Goals and use cases](@/documentation/design/goals.md):** This page explains why Garage was concieved and what practical use cases it targets.
- **[Related work](@/documentation/design/related-work.md):** This pages presents the theoretical background on which Garage is built, and describes other software storage solutions and why they didn't work for us.
- **[Internals](@/documentation/design/internals.md):** This page enters into more details on how Garage manages data internally.
## Talks
We love to talk and hear about Garage, that's why we keep a log here:
- [(en, 2023-01-18) Presentation of Garage with some details on CRDTs and data partitioning among nodes](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/commit/4cff37397f626ef063dad29e5b5e97ab1206015d/doc/talks/2023-01-18-tocatta/talk.pdf)
- [(fr, 2022-11-19) De l'auto-hébergement à l'entre-hébergement : Garage, pour conserver ses données ensemble](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/commit/4cff37397f626ef063dad29e5b5e97ab1206015d/doc/talks/2022-11-19-Capitole-du-Libre/pr%C3%A9sentation.pdf)
- [(en, 2022-06-23) General presentation of Garage](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/commit/4cff37397f626ef063dad29e5b5e97ab1206015d/doc/talks/2022-06-23-stack/talk.pdf)
- [(fr, 2021-11-13, video) Garage : Mille et une façons de stocker vos données](https://video.tedomum.net/w/moYKcv198dyMrT8hCS5jz9) and [slides (html)](https://rfid.deuxfleurs.fr/presentations/2021-11-13/garage/) - during [RFID#1](https://rfid.deuxfleurs.fr/programme/2021-11-13/) event
- [(en, 2021-04-28) Distributed object storage is centralised](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/commit/b1f60579a13d3c5eba7f74b1775c84639ea9b51a/doc/talks/2021-04-28_spirals-team/talk.pdf)
- [(fr, 2020-12-02) Garage : jouer dans la cour des grands quand on est un hébergeur associatif](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/commit/b1f60579a13d3c5eba7f74b1775c84639ea9b51a/doc/talks/2020-12-02_wide-team/talk.pdf)

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

View File

@ -0,0 +1,84 @@
+++
title = "Benchmarks"
weight = 40
+++
With Garage, we wanted to build a software defined storage service that follow the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle),
that is suitable for geo-distributed deployments and more generally that would work well for community hosting (like a Mastodon instance).
In our benchmarks, we aim to quantify how Garage performs on these goals compared to the other available solutions.
## Geo-distribution
The main challenge in a geo-distributed setup is latency between nodes of the cluster.
The more a user request will require intra-cluster requests to complete, the more its latency will increase.
This is especially true for sequential requests: requests that must wait the result of another request to be sent.
We designed Garage without consensus algorithms (eg. Paxos or Raft) to minimize the number of sequential and parallel requests.
This serie of benchmarks quantifies the impact of this design choice.
### On a simple simulated network
We start with a controlled environment, all the instances are running on the same (powerful enough) machine.
To control the network latency, we simulate the network with [mknet](https://git.deuxfleurs.fr/trinity-1686a/mknet) (a tool we developped, based on `tc` and the linux network stack).
To mesure S3 endpoints latency, we use our own tool [s3lat](https://git.deuxfleurs.fr/quentin/s3lat/) to observe only the intra-cluster latency and not some contention on the nodes (CPU, RAM, disk I/O, network bandwidth, etc.).
Compared to other benchmark tools, S3Lat sends only one (small) request at the same time and measures its latency.
We selected 5 standard endpoints that are often in the critical path: ListBuckets, ListObjects, GetObject, PutObject and RemoveObject.
In this first benchmark, we consider 5 instances that are located in a different place each. To simulate the distance, we configure mknet with a RTT between each node of 100 ms +/- 20 ms of jitter. We get the following graph, where the colored bars represent the mean latency while the error bars the minimum and maximum one:
![Comparison of endpoints latency for minio and garage](./endpoint-latency.png)
Compared to garage, minio latency drastically increases on 3 endpoints: GetObject, PutObject, RemoveObject.
We suppose that these requests on minio make transactions over Raft, involving 4 sequential requests: 1) sending the message to the leader, 2) having the leader dispatch it to the other nodes, 3) waiting for the confirmation of followers and finally 4) commiting it. With our current configuration, one Raft transaction will take around 400 ms. GetObject seems to correlate to 1 transaction while PutObject and RemoveObject seems to correlate to 2 or 3. Reviewing minio code would be required to confirm this hypothesis.
Conversely, garage uses an architecture similar to DynamoDB and never require global cluster coordination to answer a request.
Instead, garage can always contact the right node in charge of the requested data, and can answer in as low as one request in the case of GetObject and PutObject. We also observed that Garage latency, while often lower to minio, is more dispersed: garage is still in beta and has not received any performance optimization yet.
As a conclusion, Garage performs well in such setup while minio will be hard to use, especially for interactive use cases.
### On a complex simulated network
This time we consider a more heterogeneous network with 6 servers spread in 3 datacenter, giving us 2 servers per datacenters.
We consider that intra-DC communications are now very cheap with a latency of 0.5ms and without any jitter.
The inter-DC remains costly with the same value as before (100ms +/- 20ms of jitter).
We plot a similar graph as before:
![Comparison of endpoints latency for minio and garage with 6 nodes in 3 DC](./endpoint-latency-dc.png)
This new graph is very similar to the one before, neither minio or garage seems to benefit from this new topology, but they also do not suffer from it.
Considering garage, this is expected: nodes in the same DC are put in the same zone, and then data are spread on different zones for data resiliency and availaibility.
Then, in the default mode, requesting data requires to query at least 2 zones to be sure that we have the most up to date information.
These requests will involve at least one inter-DC communication.
In other words, we prioritize data availability and synchronization over raw performances.
Minio's case is a bit different as by default a minio cluster is not location aware, so we can't explain its performances through location awareness.
*We know that minio has a multi site mode but it is definitely not a first class citizen: data are asynchronously replicated from one minio cluster to another.*
We suppose that, due to the consensus, for many of its requests minio will wait for a response of the majority of the server, also involving inter-DC communications.
As a conclusion, our new topology did not influence garage or minio performances, confirming that in presence of latency, garage is the best fit.
### On a real world deployment
*TODO*
## Performance stability
A storage cluster will encounter different scenario over its life, many of them will not be predictable.
In this context, we argue that, more than peak performances, we should seek predictable and stable performances to ensure data availability.
### Reference
*TODO*
### On a degraded cluster
*TODO*
### At scale
*TODO*

52
doc/book/design/goals.md Normal file
View File

@ -0,0 +1,52 @@
+++
title = "Goals and use cases"
weight = 10
+++
## Goals and non-goals
Garage is a lightweight geo-distributed data store that implements the
[Amazon S3](https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html)
object storage protocol. It enables applications to store large blobs such
as pictures, video, images, documents, etc., in a redundant multi-node
setting. S3 is versatile enough to also be used to publish a static
website.
Garage is an opinionated object storage solution, we focus on the following **desirable properties**:
- **Internet enabled**: made for multi-sites (eg. datacenters, offices, households, etc.) interconnected through regular Internet connections.
- **Self-contained & lightweight**: works everywhere and integrates well in existing environments to target [hyperconverged infrastructures](https://en.wikipedia.org/wiki/Hyper-converged_infrastructure).
- **Highly resilient**: highly resilient to network failures, network latency, disk failures, sysadmin failures.
- **Simple**: simple to understand, simple to operate, simple to debug.
We also noted that the pursuit of some other goals are detrimental to our initial goals.
The following has been identified as **non-goals** (if these points matter to you, you should not use Garage):
- **Extreme performances**: high performances constrain a lot the design and the infrastructure; we seek performances through minimalism only.
- **Feature extensiveness**: we do not plan to add additional features compared to the ones provided by the S3 API.
- **Storage optimizations**: erasure coding or any other coding technique both increase the difficulty of placing data and synchronizing; we limit ourselves to duplication.
- **POSIX/Filesystem compatibility**: we do not aim at being POSIX compatible or to emulate any kind of filesystem. Indeed, in a distributed environment, such synchronizations are translated in network messages that impose severe constraints on the deployment.
## Use-cases
*Are you also using Garage in your organization? [Open a PR](https://git.deuxfleurs.fr/Deuxfleurs/garage) to add your use case here!*
### Deuxfleurs
[Deuxfleurs](https://deuxfleurs.fr) is an experimental non-profit hosting
organization that develops Garage. Deuxfleurs is focused on building highly
available infrastructure through redundancy in multiple geographical
locations. They use Garage themselves for the following tasks:
- Hosting of [main website](https://deuxfleurs.fr), [this website](https://garagehq.deuxfleurs.fr), as well as the personal website of many of the members of the organization
- As a [Matrix media backend](https://github.com/matrix-org/synapse-s3-storage-provider)
- As a Nix binary cache
- To store personal data and shared documents through [Bagage](https://git.deuxfleurs.fr/Deuxfleurs/bagage), a homegrown WebDav-to-S3 and SFTP-to-S3 proxy
- As a backup target using `rclone` and `restic`
The Deuxfleurs Garage cluster is a multi-site cluster currently composed of
9 nodes in 3 physical locations.

View File

@ -1,18 +1,67 @@
# Internals
+++
title = "Internals"
weight = 20
+++
## Overview
TODO: write this section
- The Dynamo ring
- The Dynamo ring (see [this paper](https://dl.acm.org/doi/abs/10.1145/1323293.1294281) and [that paper](https://www.usenix.org/conference/nsdi16/technical-sessions/presentation/eisenbud))
- CRDTs
- CRDTs (see [this paper](https://link.springer.com/chapter/10.1007/978-3-642-24550-3_29))
- Consistency model of Garage tables
See this presentation (in French) for some first information:
<https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/doc/talks/2020-12-02_wide-team/talk.pdf>
In the meantime, you can find some information at the following links:
- [this presentation (in French)](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/doc/talks/2020-12-02_wide-team/talk.pdf)
- [an old design draft](@/documentation/working-documents/design-draft.md)
## Request routing logic
Data retrieval requests to Garage endpoints (S3 API and websites) are resolved
to an individual object in a bucket. Since objects are replicated to multiple nodes
Garage must ensure consistency before answering the request.
### Using quorum to ensure consistency
Garage ensures consistency by attempting to establish a quorum with the
data nodes responsible for the object. When a majority of the data nodes
have provided metadata on a object Garage can then answer the request.
When a request arrives Garage will, assuming the recommended 3 replicas, perform the following actions:
- Make a request to the two preferred nodes for object metadata
- Try the third node if one of the two initial requests fail
- Check that the metadata from at least 2 nodes match
- Check that the object hasn't been marked deleted
- Answer the request with inline data from metadata if object is small enough
- Or get data blocks from the preferred nodes and answer using the assembled object
Garage dynamically determines which nodes to query based on health, preference, and
which nodes actually host a given data. Garage has no concept of "primary" so any
healthy node with the data can be used as long as a quorum is reached for the metadata.
### Node health
Garage keeps a TCP session open to each node in the cluster and periodically pings them. If a connection
cannot be established, or a node fails to answer a number of pings, the target node is marked as failed.
Failed nodes are not used for quorum or other internal requests.
### Node preference
Garage prioritizes which nodes to query according to a few criteria:
- A node always prefers itself if it can answer the request
- Then the node prioritizes nodes in the same zone
- Finally the nodes with the lowest latency are prioritized
For further reading on the cluster structure look at the [gateway](@/documentation/cookbook/gateways.md)
and [cluster layout management](@/documentation/operations/layout.md) pages.
## Garbage collection

View File

@ -1,4 +1,7 @@
# Related Work
+++
title = "Related work"
weight = 50
+++
## Context
@ -21,7 +24,7 @@ Openstack Cinder proxy previous solution to provide an uniform API.
File storage provides a higher abstraction, they are one filesystem among others, which means they don't necessarily have all the exotic features of every filesystem.
Often, they relax some POSIX constraints while many applications will still be compatible without any modification.
As an example, we are able to run MariaDB (very slowly) over GlusterFS...
We can also mention CephFS (read [RADOS](https://ceph.com/wp-content/uploads/2016/08/weil-rados-pdsw07.pdf) whitepaper), Lustre, LizardFS, MooseFS, etc.
We can also mention CephFS (read [RADOS](https://doi.org/10.1145/1374596.1374606) whitepaper [[pdf](https://ceph.com/assets/pdfs/weil-rados-pdsw07.pdf)]), Lustre, LizardFS, MooseFS, etc.
OpenStack Manila proxy previous solutions to provide an uniform API.
Finally object storages provide the highest level abstraction.
@ -41,16 +44,36 @@ There were many attempts in research too. I am only thinking to [LBFS](https://p
## Existing software
**[Pithos](https://github.com/exoscale/pithos) :**
**[MinIO](https://min.io/):** MinIO shares our *Self-contained & lightweight* goal but selected two of our non-goals: *Storage optimizations* through erasure coding and *POSIX/Filesystem compatibility* through strong consistency.
However, by pursuing these two non-goals, MinIO do not reach our desirable properties.
Firstly, it fails on the *Simple* property: due to the erasure coding, MinIO has severe limitations on how drives can be added or deleted from a cluster.
Secondly, it fails on the *Internet enabled* property: due to its strong consistency, MinIO is latency sensitive.
Furthermore, MinIO has no knowledge of "sites" and thus can not distribute data to minimize the failure of a given site.
**[Openstack Swift](https://docs.openstack.org/swift/latest/):**
OpenStack Swift at least fails on the *Self-contained & lightweight* goal.
Starting it requires around 8GB of RAM, which is too much especially in an hyperconverged infrastructure.
We also do not classify Swift as *Simple*.
**[Ceph](https://ceph.io/ceph-storage/object-storage/):**
This review holds for the whole Ceph stack, including the RADOS paper, Ceph Object Storage module, the RADOS Gateway, etc.
At its core, Ceph has been designed to provide *POSIX/Filesystem compatibility* which requires strong consistency, which in turn
makes Ceph latency-sensitive and fails our *Internet enabled* goal.
Due to its industry oriented design, Ceph is also far from being *Simple* to operate and from being *Self-contained & lightweight* which makes it hard to integrate it in an hyperconverged infrastructure.
In a certain way, Ceph and MinIO are closer together than they are from Garage or OpenStack Swift.
**[Pithos](https://github.com/exoscale/pithos):**
Pithos has been abandonned and should probably not used yet, in the following we explain why we did not pick their design.
Pithos was relying as a S3 proxy in front of Cassandra (and was working with Scylla DB too).
From its designers' mouth, storing data in Cassandra has shown its limitations justifying the project abandonment.
They built a closed-source version 2 that does not store blobs in the database (only metadata) but did not communicate further on it.
We considered there v2's design but concluded that it does not fit both our *Self-contained & lightweight* and *Simple* properties. It makes the development, the deployment and the operations more complicated while reducing the flexibility.
**[IPFS](https://ipfs.io/) :**
**[Riak CS](https://docs.riak.com/riak/cs/2.1.1/index.html):**
*Not written yet*
**[IPFS](https://ipfs.io/):** IPFS has design goals radically different from Garage, we have [a blog post](@/blog/2022-ipfs/index.md) talking about it.
## Specific research papers
*Not yet written*

View File

@ -0,0 +1,19 @@
+++
title = "Development"
weight = 80
sort_by = "weight"
template = "documentation.html"
+++
Now that you are a Garage expert, you want to enhance it, you are in the right place!
We discuss here how to hack on Garage, how we manage its development, etc.
## Rust API (docs.rs)
If you encounter a specific bug in Garage or plan to patch it, you may jump directly to the source code's documentation!
- [garage\_api](https://docs.rs/garage_api/latest/garage_api/) - contains the S3 standard API endpoint
- [garage\_model](https://docs.rs/garage_model/latest/garage_model/) - contains Garage's model built on the table abstraction
- [garage\_rpc](https://docs.rs/garage_rpc/latest/garage_rpc/) - contains Garage's federation protocol
- [garage\_table](https://docs.rs/garage_table/latest/garage_table/) - contains core Garage's CRDT datatypes
- [garage\_util](https://docs.rs/garage_util/latest/garage_util/) - contains garage helpers
- [garage\_web](https://docs.rs/garage_web/latest/garage_web/) - contains the S3 website endpoint

View File

@ -1,4 +1,7 @@
# Setup your development environment
+++
title = "Setup your environment"
weight = 5
+++
Depending on your tastes, you can bootstrap your development environment in a traditional Rust way or through Nix.
@ -22,7 +25,7 @@ git clone https://git.deuxfleurs.fr/Deuxfleurs/garage
cd garage
```
*Optionnaly, you can use our nix.conf file to speed up compilations:*
*Optionally, you can use our nix.conf file to speed up compilations:*
```bash
sudo mkdir -p /etc/nix
@ -36,7 +39,7 @@ Now you can enter our nix-shell, all the required packages will be downloaded bu
nix-shell
```
You can use the traditionnal Rust development workflow:
You can use the traditional Rust development workflow:
```bash
cargo build # compile the project
@ -77,7 +80,7 @@ nix-build \
--git_version $(git rev-parse HEAD)
```
*The result is located in `result/bin`. You can pass arguments to cross compile: check `.drone.yml` for examples.*
*The result is located in `result/bin`. You can pass arguments to cross compile: check `.woodpecker/release.yml` for examples.*
If you modify a `Cargo.toml` or regenerate any `Cargo.lock`, you must run `cargo2nix`:

View File

@ -1,4 +1,7 @@
# Miscellaneous Notes
+++
title = "Miscellaneous notes"
weight = 20
+++
## Quirks about cargo2nix/rust in Nix
@ -13,42 +16,6 @@ We have a simple [PR on cargo2nix](https://github.com/cargo2nix/cargo2nix/pull/2
Nix has no armv7 + musl toolchains but armv7l is backward compatible with armv6l.
Signing keys are generated with:
```
nix-store --generate-binary-cache-key nix.web.deuxfleurs.fr cache-priv-key.pem cache-pub-key.pem
```
We copy the secret key in our nix folder:
```
cp cache-priv-key.pem /etc/nix/signing-key.sec
```
Manually sign
We can sign the whole store with:
```
nix sign-paths --all -k /etc/nix/signing-key.sec
```
Or simply the current package and its dependencies with:
```
nix sign-paths --recursive -k /etc/nix/signing-key.sec
```
Setting a key in `nix.conf` will do the signature at build time automatically without additional commands, edit the `nix.conf` of your builder:
```toml
secret-key-files = /etc/nix/signing-key.sec
max-jobs = auto
cores = 8
```
Now you are ready to build your packages:
```bash
cat > $HOME/.awsrc <<EOF
export AWS_ACCESS_KEY_ID="xxx"
@ -114,12 +81,9 @@ Our cache will be checked.
- http://www.lpenz.org/articles/nixchannel/index.html
## Drone
## Woodpecker
Do not try to set a build as trusted from the interface or the CLI tool,
your request would be ignored. Instead, directly edit the database (table `repos`, column `repo_trusted`).
Drone can do parallelism both at the step and the pipeline level. At the step level, parallelism is restricted to the same runner.
Woodpecker can do parallelism both at the step and the pipeline level. At the step level, parallelism is restricted to the same runner.
## Building Docker containers
@ -132,3 +96,4 @@ We were:
- Unable to use the kaniko container provided by Google as we can't run arbitrary logic: we need to put our secret in .docker/config.json.
Finally we chose to build kaniko through nix and use it in a `nix-shell`.
We then switched to using kaniko from nixpkgs when it was packaged.

View File

@ -1,4 +1,7 @@
# Release process
+++
title = "Release process"
weight = 15
+++
Before releasing a new version of Garage, our code pass through a succession of checks and transformations.
We define them as our release process.
@ -8,7 +11,7 @@ We define them as our release process.
While we run some tests on every commits, we do not make a release for all of them.
A release can be triggered manually by "promoting" a successful build.
Otherwise, every weeks, a release build is triggered on the `main` branch.
Otherwise, every night, a release build is triggered on the `main` branch.
If the build is from a tag following the regex: `v[0-9]+\.[0-9]+\.[0-9]+`, it will be listed as stable.
If it is a tag but with a different format, it will be listed as Extra.
@ -29,16 +32,17 @@ We generate the following binary artifacts for now:
- **os**: linux
- **format**: static binary, docker container
Additionnaly we also build two web pages:
Additionnaly we also build two web pages and one JSON document:
- the documentation (this website)
- [the release page](https://garagehq.deuxfleurs.fr/releases.html)
- [the release page](https://garagehq.deuxfleurs.fr/_releases.html)
- [the release list in JSON format](https://garagehq.deuxfleurs.fr/_releases.json)
We publish the static binaries on our own garage cluster (you can access them through the releases page)
and the docker containers on Docker Hub.
## Automation
We automated our release process with Nix and Drone to make it more reliable.
We automated our release process with Nix and Woodpecker to make it more reliable.
Here we describe how we have done in case you want to debug or improve it.
### Caching build steps
@ -58,52 +62,31 @@ Sending to the cache is done through `nix copy`, for example:
nix copy --to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/etc/nix/signing-key.sec' result
```
*Note that you need the signing key. In our case, it is stored as a secret in Drone.*
*The signing key possessed by the Garage maintainers is required to update the Nix cache.*
The previous command will only send the built packet and not its dependencies.
To send its dependency, a tool named `nix-copy-closure` has been created but it is not compatible with the S3 protocol.
Instead, you can use the following commands to list all the runtime dependencies:
The previous command will only send the built package and not its dependencies.
In the case of our CI pipeline, we want to cache all intermediate build steps
as well. This can be done using this quite involved command (here as an example
for the `pkgs.amd64.relase` package):
```bash
nix copy \
--to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/etc/nix/signing-key.sec' \
$(nix-store -qR result/)
nix copy -j8 \
--to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/etc/nix/nix-signing-key.sec' \
$(nix path-info pkgs.amd64.release --file default.nix --derivation --recursive | sed 's/\.drv$/.drv^*/')
```
*We could also write this expression with xargs but this tool is not available in our container.*
This command will simultaneously build all of the required Nix paths (using at
most 8 parallel Nix builder jobs) and send the resulting objects to the cache.
But in certain cases, we want to cache compile time dependencies also.
For example, the Nix project does not provide binaries for cross compiling to i686 and thus we need to compile gcc on our own.
We do not want to compile gcc each time, so even if it is a compile time dependency, we want to cache it.
This time, the command is a bit more involved:
```bash
nix copy --to \
's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/etc/nix/signing-key.sec' \
$(nix-store -qR --include-outputs \
$(nix-instantiate))
```
This is the command we use in our CI as we expect the final binary to change, so we mainly focus on
caching our development dependencies.
*Currently there is no automatic garbage collection of the cache: we should monitor its growth.
Hopefully, we can erase it totally without breaking any build, the next build will only be slower.*
In practise, we concluded that we do not want to cache all the compilation dependencies.
Instead, we want to cache the toolchain we use to build Garage each time we change it.
So we removed from Drone any automatic update of the cache and instead handle them manually with:
This can be run for all the Garage packages we build using the following command:
```
source ~/.awsrc
nix-shell --run 'refresh_toolchain'
nix-shell --attr cache --run 'refresh_cache'
```
Internally, it will run `nix-build` on `nix/toolchain.nix` and send the output plus its depedencies to the cache.
To erase the cache:
We don't automate this step at each CI build, as *there is currently no automatic garbage collection of the cache.*
This means we should also monitor the cache's size; if it ever becomes too big we can erase it with:
```
mc rm --recursive --force 'garage/nix/'
@ -153,9 +136,9 @@ nix-shell --run refresh_index
If you want to compile for different architectures, you will need to repeat all these commands for each architecture.
**In practise, and except for debugging, you will never directly run these commands. Release is handled by drone**
**In practice, and except for debugging, you will never directly run these commands. Release is handled by Woodpecker.**
### Drone
### Drone (obsolete)
Our instance is available at [https://drone.deuxfleurs.fr](https://drone.deuxfleurs.fr).
You need an account on [https://git.deuxfleurs.fr](https://git.deuxfleurs.fr) to use it.

View File

@ -1,4 +1,7 @@
# Development scripts
+++
title = "Development scripts"
weight = 10
+++
We maintain a `script/` folder that contains some useful script to ease testing on Garage.
@ -31,7 +34,7 @@ You can inspect the detailed configuration, including ports, by inspecting `/tmp
This script also spawns a simple HTTPS reverse proxy through `socat` for the S3 endpoint that listens on port `4443`.
Some libraries might require a TLS endpoint to work, refer to our issue [#64](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/64) for more detailed information on this subject.
This script covers the [Launching the garage server](/quick_start/index.html#launching-the-garage-server) section of our Quick start page.
This script covers the [Launching the garage server](@/documentation/quick-start/_index.md#launching-the-garage-server) section of our Quick start page.
### 2. Make them join the cluster
@ -41,7 +44,7 @@ This script covers the [Launching the garage server](/quick_start/index.html#lau
This script will configure each instance by assigning them a zone (`dc1`) and a weight (`1`).
This script covers the [Configuring your Garage node](/quick_start/index.html#configuring-your-garage-node) section of our Quick start page.
This script covers the [Creating a cluster layout](@/documentation/quick-start/_index.md#creating-a-cluster-layout) section of our Quick start page.
### 3. Create a key and a bucket
@ -52,7 +55,7 @@ This script covers the [Configuring your Garage node](/quick_start/index.html#co
This script will create a bucket named `eprouvette` with a key having read and write rights on this bucket.
The key is stored in a filed named `/tmp/garage.s3` and can be used by the following tools to pre-configure them.
This script covers the [Creating buckets and keys](/quick_start/index.html#creating-buckets-and-keys) section of our Quick start page.
This script covers the [Creating buckets and keys](@/documentation/quick-start/_index.md#creating-buckets-and-keys) section of our Quick start page.
## Handlers for generic tools

View File

@ -0,0 +1,23 @@
+++
title = "Operations & Maintenance"
weight = 50
sort_by = "weight"
template = "documentation.html"
+++
This section contains a number of important information on how to best operate a Garage cluster,
to ensure integrity and availability of your data:
- **[Upgrading Garage](@/documentation/operations/upgrading.md):** General instructions on how to
upgrade your cluster from one version to the next. Instructions specific for each version upgrade
can bef ound in the [working documents](@/documentation/working-documents/_index.md) section.
- **[Layout management](@/documentation/operations/layout.md):** Best practices for using the `garage layout`
commands when adding or removing nodes from your cluster.
- **[Durability and repairs](@/documentation/operations/durability-repairs.md):** How to check for small things
that might be going wrong, and how to recover from such failures.
- **[Recovering from failures](@/documentation/operations/recovering.md):** Garage's first selling point is resilience
to hardware failures. This section explains how to recover from such a failure in the
best possible way.

View File

@ -0,0 +1,144 @@
+++
title = "Durability & Repairs"
weight = 30
+++
To ensure the best durability of your data and to fix any inconsistencies that may
pop up in a distributed system, Garage provides a series of repair operations.
This guide will explain the meaning of each of them and when they should be applied.
# General syntax of repair operations
Repair operations described below are of the form `garage repair <repair_name>`.
These repairs will not launch without the `--yes` flag, which should
be added as follows: `garage repair --yes <repair_name>`.
By default these repair procedures will only run on the Garage node your CLI is
connecting to. To run on all nodes, add the `-a` flag as follows:
`garage repair -a --yes <repair_name>`.
# Data block operations
## Data store scrub {#scrub}
Scrubbing the data store means examining each individual data block to check that
their content is correct, by verifying their hash. Any block found to be corrupted
(e.g. by bitrot or by an accidental manipulation of the datastore) will be
restored from another node that holds a valid copy.
Scrubs are automatically scheduled by Garage to run every 25-35 days (the
actual time is randomized to spread load across nodes). The next scheduled run
can be viewed with `garage worker get`.
A scrub can also be launched manually using `garage repair scrub start`.
To view the status of an ongoing scrub, first find the task ID of the scrub worker
using `garage worker list`. Then, run `garage worker info <scrub_task_id>` to
view detailed runtime statistics of the scrub. To gather cluster-wide information,
this command has to be run on each individual node.
A scrub is a very disk-intensive operation that might slow down your cluster.
You may pause an ongoing scrub using `garage repair scrub pause`, but note that
the scrub will resume automatically 24 hours later as Garage will not let your
cluster run without a regular scrub. If the scrub procedure is too intensive
for your servers and is slowing down your workload, the recommended solution
is to increase the "scrub tranquility" using `garage repair scrub set-tranquility`.
A higher tranquility value will make Garage take longer pauses between two block
verifications. Of course, scrubbing the entire data store will also take longer.
## Block check and resync
In some cases, nodes hold a reference to a block but do not actually have the block
stored on disk. Conversely, they may also have on-disk blocks that are not referenced
any more. To fix both cases, a block repair may be run with `garage repair blocks`.
This will scan the entire block reference counter table to check that the blocks
exist on disk, and will scan the entire disk store to check that stored blocks
are referenced.
It is recommended to run this procedure when changing your cluster layout,
after the metadata tables have finished synchronizing between nodes
(usually a few hours after `garage layout apply`).
## Inspecting lost blocks
In extremely rare situations, data blocks may be unavailable from the entire cluster.
This means that even using `garage repair blocks`, some nodes may be unable
to fetch data blocks for which they hold a reference.
These errors are stored on each node in a list of "block resync errors", i.e.
blocks for which the last resync operation failed.
This list can be inspected using `garage block list-errors`.
These errors usually fall into one of the following categories:
1. a block is still referenced but the object was deleted, this is a case
of metadata reference inconsistency (see below for the fix)
2. a block is referenced by a non-deleted object, but could not be fetched due
to a transient error such as a network failure
3. a block is referenced by a non-deleted object, but could not be fetched due
to a permanent error such as there not being any valid copy of the block on the
entire cluster
To help make the difference between cases 1 and cases 2 and 3, you may use the
`garage block info` command to see which objects hold a reference to each block.
In the second case (transient errors), Garage will try to fetch the block again
after a certain time, so the error should disappear naturally. You can also
request Garage to try to fetch the block immediately using `garage block retry-now`
if you have fixed the transient issue.
If you are confident that you are in the third scenario and that your data block
is definitely lost, then there is no other choice than to declare your S3 objects
as unrecoverable, and to delete them properly from the data store. This can be done
using the `garage block purge` command.
## Rebalancing data directories
In [multi-HDD setups](@/documentation/operations/multi-hdd.md), to ensure that
data blocks are well balanced between storage locations, you may run a
rebalance operation using `garage repair rebalance`. This is useful when
adding storage locations or when capacities of the storage locations have been
changed. Once this is finished, Garage will know for each block of a single
possible location where it can be, which can increase access speed. This
operation will also move out all data from locations marked as read-only.
# Metadata operations
## Metadata snapshotting
It is good practice to setup automatic snapshotting of your metadata database
file, to recover from situations where it becomes corrupted on disk. This can
be done at the filesystem level if you are using ZFS or BTRFS.
Since Garage v0.9.4, Garage is able to take snapshots of the metadata database
itself. This basically amounts to copying the database file, except that it can
be run live while Garage is running without the risk of corruption or
inconsistencies. This can be setup to run automatically on a schedule using
[`metadata_auto_snapshot_interval`](@/documentation/reference-manual/configuration.md#metadata_auto_snapshot_interval).
A snapshot can also be triggered manually using the `garage meta snapshot`
command. Note that taking a snapshot using this method is very intensive as it
requires making a full copy of the database file, so you might prefer using
filesystem-level snapshots if possible. To recover a corrupted node from such a
snapshot, read the instructions
[here](@/documentation/operations/recovering.md#corrupted_meta).
## Metadata table resync
Garage automatically resyncs all entries stored in the metadata tables every hour,
to ensure that all nodes have the most up-to-date version of all the information
they should be holding.
The resync procedure is based on a Merkle tree that allows to efficiently find
differences between nodes.
In some special cases, e.g. before an upgrade, you might want to run a table
resync manually. This can be done using `garage repair tables`.
## Metadata table reference fixes
In some very rare cases where nodes are unavailable, some references between objects
are broken. For instance, if an object is deleted, the underlying versions or data
blocks may still be held by Garage. If you suspect that such corruption has occurred
in your cluster, you can run one of the following repair procedures:
- `garage repair versions`: checks that all versions belong to a non-deleted object, and purges any orphan version
- `garage repair block_refs`: checks that all block references belong to a non-deleted object version, and purges any orphan block reference (this will then allow the blocks to be garbage-collected)

View File

@ -0,0 +1,274 @@
+++
title = "Cluster layout management"
weight = 20
+++
The cluster layout in Garage is a table that assigns to each node a role in
the cluster. The role of a node in Garage can either be a storage node with
a certain capacity, or a gateway node that does not store data and is only
used as an API entry point for faster cluster access.
An introduction to building cluster layouts can be found in the [production deployment](@/documentation/cookbook/real-world.md) page.
In Garage, all of the data that can be stored in a given cluster is divided
into slices which we call *partitions*. Each partition is stored by
one or several nodes in the cluster
(see [`replication_mode`](@/documentation/reference-manual/configuration.md#replication_mode)).
The layout determines the correspondence between these partitions,
which exist on a logical level, and actual storage nodes.
## How cluster layouts work in Garage
A cluster layout is composed of the following components:
- a table of roles assigned to nodes, defined by the user
- an optimal assignation of partitions to nodes, computed by an algorithm that is ran once when calling `garage layout apply` or the ApplyClusterLayout API endpoint
- a version number
Garage nodes will always use the cluster layout with the highest version number.
Garage nodes also maintain and synchronize between them a set of proposed role
changes that haven't yet been applied. These changes will be applied (or
canceled) in the next version of the layout.
All operations on the layout can be realized using the `garage` CLI or using the
[administration API endpoint](@/documentation/reference-manual/admin-api.md).
We give here a description of CLI commands, the admin API semantics are very similar.
The following commands insert modifications to the set of proposed role changes
for the next layout version (but they do not create the new layout immediately):
```bash
garage layout assign [...]
garage layout remove [...]
```
The following command can be used to inspect the layout that is currently set in the cluster
and the changes proposed for the next layout version, if any:
```bash
garage layout show
```
The following commands create a new layout with the specified version number,
that either takes into account the proposed changes or cancels them:
```bash
garage layout apply --version <new_version_number>
garage layout revert --version <new_version_number>
```
The version number of the new layout to create must be 1 + the version number
of the previous layout that existed in the cluster. The `apply` and `revert`
commands will fail otherwise.
## Warnings about Garage cluster layout management
**⚠️ Never make several calls to `garage layout apply` or `garage layout
revert` with the same value of the `--version` flag. Doing so can lead to the
creation of several different layouts with the same version number, in which
case your Garage cluster will become inconsistent until fixed.** If a call to
`garage layout apply` or `garage layout revert` has failed and `garage layout
show` indicates that a new layout with the given version number has not been
set in the cluster, then it is fine to call the command again with the same
version number.
If you are using the `garage` CLI by typing individual commands in your
shell, you shouldn't have much issues as long as you run commands one after
the other and take care of checking the output of `garage layout show`
before applying any changes.
If you are using the `garage` CLI or the admin API to script layout changes,
follow the following recommendations:
- If using the CLI, make all of your `garage` CLI calls to the same RPC host.
If using the admin API, make all of your API calls to the same Garage node. Do
not connect to individual nodes to send them each a piece of the layout changes
you are making, as the changes propagate asynchronously between nodes and might
not all be taken into account at the time when the new layout is applied.
- **Only call `garage layout apply`/ApplyClusterLayout once**, and call it
**strictly after** all of the `layout assign` and `layout remove`
commands/UpdateClusterLayout API calls have returned.
## Understanding unexpected layout calculations
When adding, removing or modifying nodes in a cluster layout, sometimes
unexpected assignations of partitions to node can occur. These assignations
are in fact normal and logical, given the objectives of the algorithm. Indeed,
**the layout algorithm prioritizes moving less data between nodes over
achieving equal distribution of load. It also tries to use all links between
pairs of nodes in equal proportions when moving data.** This section presents
two examples and illustrates how one can control Garage's behavior to obtain
the desired results.
### Example 1
In this example, a cluster is originally composed of 3 nodes in 3 different
zones (data centers). The three nodes are of equal capacity, therefore they
are all fully exploited and all store a copy of all of the data in the cluster.
Then, a fourth node of the same size is added in the datacenter `dc1`.
As illustrated by the following, **Garage will by default not store any data on the new node**:
```
$ garage layout show
==== CURRENT CLUSTER LAYOUT ====
ID Tags Zone Capacity Usable capacity
b10c110e4e854e5a node1 dc1 1000.0 MB 1000.0 MB (100.0%)
a235ac7695e0c54d node2 dc2 1000.0 MB 1000.0 MB (100.0%)
62b218d848e86a64 node3 dc3 1000.0 MB 1000.0 MB (100.0%)
Zone redundancy: maximum
Current cluster layout version: 6
==== STAGED ROLE CHANGES ====
ID Tags Zone Capacity
a11c7cf18af29737 node4 dc1 1000.0 MB
==== NEW CLUSTER LAYOUT AFTER APPLYING CHANGES ====
ID Tags Zone Capacity Usable capacity
b10c110e4e854e5a node1 dc1 1000.0 MB 1000.0 MB (100.0%)
a11c7cf18af29737 node4 dc1 1000.0 MB 0 B (0.0%)
a235ac7695e0c54d node2 dc2 1000.0 MB 1000.0 MB (100.0%)
62b218d848e86a64 node3 dc3 1000.0 MB 1000.0 MB (100.0%)
Zone redundancy: maximum
==== COMPUTATION OF A NEW PARTITION ASSIGNATION ====
Partitions are replicated 3 times on at least 3 distinct zones.
Optimal partition size: 3.9 MB (3.9 MB in previous layout)
Usable capacity / total cluster capacity: 3.0 GB / 4.0 GB (75.0 %)
Effective capacity (replication factor 3): 1000.0 MB
A total of 0 new copies of partitions need to be transferred.
dc1 Tags Partitions Capacity Usable capacity
b10c110e4e854e5a node1 256 (0 new) 1000.0 MB 1000.0 MB (100.0%)
a11c7cf18af29737 node4 0 (0 new) 1000.0 MB 0 B (0.0%)
TOTAL 256 (256 unique) 2.0 GB 1000.0 MB (50.0%)
dc2 Tags Partitions Capacity Usable capacity
a235ac7695e0c54d node2 256 (0 new) 1000.0 MB 1000.0 MB (100.0%)
TOTAL 256 (256 unique) 1000.0 MB 1000.0 MB (100.0%)
dc3 Tags Partitions Capacity Usable capacity
62b218d848e86a64 node3 256 (0 new) 1000.0 MB 1000.0 MB (100.0%)
TOTAL 256 (256 unique) 1000.0 MB 1000.0 MB (100.0%)
```
While unexpected, this is logical because of the following facts:
- storing some data on the new node does not help increase the total quantity
of data that can be stored on the cluster, as the two other zones (`dc2` and
`dc3`) still need to store a full copy of everything, and their capacity is
still the same;
- there is therefore no need to move any data on the new node as this would be pointless;
- moving data to the new node has a cost which the algorithm decides to not pay if not necessary.
This distribution of data can however not be what the administrator wanted: if
they added a new node to `dc1`, it might be because the existing node is too
slow, and they wish to divide its load by half. In that case, what they need to
do to force Garage to distribute the data between the two nodes is to attribute
only half of the capacity to each node in `dc1` (in our example, 500M instead of 1G).
In that case, Garage would determine that to be able to store 1G in total, it
would need to store 500M on the old node and 500M on the added one.
### Example 2
The following example is a slightly different scenario, where `dc1` had two
nodes that were used at 50%, and `dc2` and `dc3` each have one node that is
100% used. All node capacities are the same.
Then, a node from `dc1` is moved into `dc3`. One could expect that the roles of
`dc1` and `dc3` would simply be swapped: the remaining node in `dc1` would be
used at 100%, and the two nodes now in `dc3` would be used at 50%. Instead,
this happens:
```
==== CURRENT CLUSTER LAYOUT ====
ID Tags Zone Capacity Usable capacity
b10c110e4e854e5a node1 dc1 1000.0 MB 500.0 MB (50.0%)
a11c7cf18af29737 node4 dc1 1000.0 MB 500.0 MB (50.0%)
a235ac7695e0c54d node2 dc2 1000.0 MB 1000.0 MB (100.0%)
62b218d848e86a64 node3 dc3 1000.0 MB 1000.0 MB (100.0%)
Zone redundancy: maximum
Current cluster layout version: 8
==== STAGED ROLE CHANGES ====
ID Tags Zone Capacity
a11c7cf18af29737 node4 dc3 1000.0 MB
==== NEW CLUSTER LAYOUT AFTER APPLYING CHANGES ====
ID Tags Zone Capacity Usable capacity
b10c110e4e854e5a node1 dc1 1000.0 MB 1000.0 MB (100.0%)
a235ac7695e0c54d node2 dc2 1000.0 MB 1000.0 MB (100.0%)
62b218d848e86a64 node3 dc3 1000.0 MB 753.9 MB (75.4%)
a11c7cf18af29737 node4 dc3 1000.0 MB 246.1 MB (24.6%)
Zone redundancy: maximum
==== COMPUTATION OF A NEW PARTITION ASSIGNATION ====
Partitions are replicated 3 times on at least 3 distinct zones.
Optimal partition size: 3.9 MB (3.9 MB in previous layout)
Usable capacity / total cluster capacity: 3.0 GB / 4.0 GB (75.0 %)
Effective capacity (replication factor 3): 1000.0 MB
A total of 128 new copies of partitions need to be transferred.
dc1 Tags Partitions Capacity Usable capacity
b10c110e4e854e5a node1 256 (128 new) 1000.0 MB 1000.0 MB (100.0%)
TOTAL 256 (256 unique) 1000.0 MB 1000.0 MB (100.0%)
dc2 Tags Partitions Capacity Usable capacity
a235ac7695e0c54d node2 256 (0 new) 1000.0 MB 1000.0 MB (100.0%)
TOTAL 256 (256 unique) 1000.0 MB 1000.0 MB (100.0%)
dc3 Tags Partitions Capacity Usable capacity
62b218d848e86a64 node3 193 (0 new) 1000.0 MB 753.9 MB (75.4%)
a11c7cf18af29737 node4 63 (0 new) 1000.0 MB 246.1 MB (24.6%)
TOTAL 256 (256 unique) 2.0 GB 1000.0 MB (50.0%)
```
As we can see, the node that was moved to `dc3` (node4) is only used at 25% (approximatively),
whereas the node that was already in `dc3` (node3) is used at 75%.
This can be explained by the following:
- node1 will now be the only node remaining in `dc1`, thus it has to store all
of the data in the cluster. Since it was storing only half of it before, it has
to retrieve the other half from other nodes in the cluster.
- The data which it does not have is entirely stored by the other node that was
in `dc1` and that is now in `dc3` (node4). There is also a copy of it on node2
and node3 since both these nodes have a copy of everything.
- node3 and node4 are the two nodes that will now be in a datacenter that is
under-utilized (`dc3`), this means that those are the two candidates from which
data can be removed to be moved to node1.
- Garage will move data in equal proportions from all possible sources, in this
case it means that it will tranfer 25% of the entire data set from node3 to
node1 and another 25% from node4 to node1.
This explains why node3 ends with 75% utilization (100% from before minus 25%
that is moved to node1), and node4 ends with 25% (50% from before minus 25%
that is moved to node1).
This illustrates the second principle of the layout computation: **if there is
a choice in moving data out of some nodes, then all links between pairs of
nodes are used in equal proportions** (this is approximately true, there is
randomness in the algorithm to achieve this so there might be some small
fluctuations, as we see above).

View File

@ -0,0 +1,101 @@
+++
title = "Multi-HDD support"
weight = 15
+++
Since v0.9, Garage natively supports nodes that have several storage drives
for storing data blocks (not for metadata storage).
## Initial setup
To set up a new Garage storage node with multiple HDDs,
format and mount all your drives in different directories,
and use a Garage configuration as follows:
```toml
data_dir = [
{ path = "/path/to/hdd1", capacity = "2T" },
{ path = "/path/to/hdd2", capacity = "4T" },
]
```
Garage will automatically balance all blocks stored by the node
among the different specified directories, proportionnally to the
specified capacities.
## Updating the list of storage locations
If you add new storage locations to your `data_dir`,
Garage will not rebalance existing data between storage locations.
Newly written blocks will be balanced proportionnally to the specified capacities,
and existing data may be moved between drives to improve balancing,
but only opportunistically when a data block is re-written (e.g. an object
is re-uploaded, or an object with a duplicate block is uploaded).
To understand precisely what is happening, we need to dive in to how Garage
splits data among the different storage locations.
First of all, Garage divides the set of all possible block hashes
in a fixed number of slices (currently 1024), and assigns
to each slice a primary storage location among the specified data directories.
The number of slices having their primary location in each data directory
is proportionnal to the capacity specified in the config file.
When Garage receives a block to write, it will always write it in the primary
directory of the slice that contains its hash.
Now, to be able to not lose existing data blocks when storage locations
are added, Garage also keeps a list of secondary data directories
for all of the hash slices. Secondary data directories for a slice indicates
storage locations that once were primary directories for that slice, i.e. where
Garage knows that data blocks of that slice might be stored.
When Garage is requested to read a certain data block,
it will first look in the primary storage directory of its slice,
and if it doesn't find it there it goes through all of the secondary storage
locations until it finds it. This allows Garage to continue operating
normally when storage locations are added, without having to shuffle
files between drives to place them in the correct location.
This relatively simple strategy works well but does not ensure that data
is correctly balanced among drives according to their capacity.
To rebalance data, two strategies can be used:
- Lazy rebalancing: when a block is re-written (e.g. the object is re-uploaded),
Garage checks whether the existing copy is in the primary directory of the slice
or in a secondary directory. If the current copy is in a secondary directory,
Garage re-writes a copy in the primary directory and deletes the one from the
secondary directory. This might never end up rebalancing everything if there
are data blocks that are only read and never written.
- Active rebalancing: an operator of a Garage node can explicitly launch a repair
procedure that rebalances the data directories, moving all blocks to their
primary location. Once done, all secondary locations for all hash slices are
removed so that they won't be checked anymore when looking for a data block.
## Read-only storage locations
If you would like to move all data blocks from an existing data directory to one
or several new data directories, mark the old directory as read-only:
```toml
data_dir = [
{ path = "/path/to/old_data", read_only = true },
{ path = "/path/to/new_hdd1", capacity = "2T" },
{ path = "/path/to/new_hdd2", capacity = "4T" },
]
```
Garage will be able to read requested blocks from the read-only directory.
Garage will also move data out of the read-only directory either progressively
(lazy rebalancing) or if requested explicitly (active rebalancing).
Once an active rebalancing has finished, your read-only directory should be empty:
it might still contain subdirectories, but no data files. You can check that
it contains no files using:
```bash
find -type f /path/to/old_data # should not print anything
```
at which point it can be removed from the `data_dir` list in your config file.

View File

@ -1,4 +1,7 @@
# Recovering from failures
+++
title = "Recovering from failures"
weight = 40
+++
Garage is meant to work on old, second-hand hardware.
In particular, this makes it likely that some of your drives will fail, and some manual intervention will be needed.
@ -28,8 +31,10 @@ and you should instead use one of the methods detailed in the next sections.
Removing a node is done with the following command:
```
garage node remove --yes <node_id>
```bash
garage layout remove <node_id>
garage layout show # review the changes you are making
garage layout apply # once satisfied, apply the changes
```
(you can get the `node_id` of the failed node by running `garage status`)
@ -50,7 +55,7 @@ We just need to tell Garage to get back all the data blocks and store them on th
First, set up a new HDD to store Garage's data directory on the failed node, and restart Garage using
the existing configuration. Then, run:
```
```bash
garage repair -a --yes blocks
```
@ -58,7 +63,7 @@ This will re-synchronize blocks of data that are missing to the new HDD, reading
You can check on the advancement of this process by doing the following command:
```
```bash
garage stats -a
```
@ -89,15 +94,71 @@ might be faster but most of the pieces will be deleted anyway from the disk and
First, set up a new drive to store the metadata directory for the replacement node (a SSD is recommended),
and for the data directory if necessary. You can then start Garage on the new node.
The restarted node should generate a new node ID, and it should be shown as `NOT CONFIGURED` in `garage status`.
The restarted node should generate a new node ID, and it should be shown with `NO ROLE ASSIGNED` in `garage status`.
The ID of the lost node should be shown in `garage status` in the section for disconnected/unavailable nodes.
Then, replace the broken node by the new one, using:
```
garage node configure --replace <old_node_id> \
-c <capacity> -z <zone> -t <node_tag> <new_node_id>
```bash
garage layout assign <new_node_id> --replace <old_node_id> \
-c <capacity> -z <zone> -t <node_tag>
garage layout show # review the changes you are making
garage layout apply # once satisfied, apply the changes
```
Garage will then start synchronizing all required data on the new node.
This process can be monitored using the `garage stats -a` command.
## Replacement scenario 3: corrupted metadata {#corrupted_meta}
In some cases, your metadata DB file might become corrupted, for instance if
your node suffered a power outage and did not shut down properly. In this case,
you can recover without having to change the node ID and rebuilding a cluster
layout. This means that data blocks will not need to be shuffled around, you
must simply find a way to repair the metadata file. The best way is generally
to discard the corrupted file and recover it from another source.
First of all, start by locating the database file in your metadata directory,
which [depends on your `db_engine`
choice](@/documentation/reference-manual/configuration.md#db_engine). Then,
your recovery options are as follows:
- **Option 1: resyncing from other nodes.** In case your cluster is replicated
with two or three copies, you can simply delete the database file, and Garage
will resync from other nodes. To do so, stop Garage, delete the database file
or directory, and restart Garage. Then, do a full table repair by calling
`garage repair -a --yes tables`. This will take a bit of time to complete as
the new node will need to receive copies of the metadata tables from the
network.
- **Option 2: restoring a snapshot taken by Garage.** Since v0.9.4, Garage can
[automatically take regular
snapshots](@/documentation/reference-manual/configuration.md#metadata_auto_snapshot_interval)
of your metadata DB file. This file or directory should be located under
`<metadata_dir>/snapshots`, and is named according to the UTC time at which it
was taken. Stop Garage, discard the database file/directory and replace it by the
snapshot you want to use. For instance, in the case of LMDB:
```bash
cd $METADATA_DIR
mv db.lmdb db.lmdb.bak
cp -r snapshots/2024-03-15T12:13:52Z db.lmdb
```
And for Sqlite:
```bash
cd $METADATA_DIR
mv db.sqlite db.sqlite.bak
cp snapshots/2024-03-15T12:13:52Z db.sqlite
```
Then, restart Garage and run a full table repair by calling `garage repair -a
--yes tables`. This should run relatively fast as only the changes that
occurred since the snapshot was taken will need to be resynchronized. Of
course, if your cluster is not replicated, you will lose all changes that
occurred since the snapshot was taken.
- **Option 3: restoring a filesystem-level snapshot.** If you are using ZFS or
BTRFS to snapshot your metadata partition, refer to their specific
documentation on rolling back or copying files from an old snapshot.

View File

@ -0,0 +1,97 @@
+++
title = "Upgrading Garage"
weight = 10
+++
Garage is a stateful clustered application, where all nodes are communicating together and share data structures.
It makes upgrade more difficult than stateless applications so you must be more careful when upgrading.
On a new version release, there is 2 possibilities:
- protocols and data structures remained the same ➡️ this is a **minor upgrade**
- protocols or data structures changed ➡️ this is a **major upgrade**
You can quickly know what type of update you will have to operate by looking at the version identifier:
when we require our users to do a major upgrade, we will always bump the first nonzero component of the version identifier
(e.g. from v0.7.2 to v0.8.0).
Conversely, for versions that only require a minor upgrade, the first nonzero component will always stay the same (e.g. from v0.8.0 to v0.8.1).
Major upgrades are designed to be run only between contiguous versions.
Example: migrations from v0.7.1 to v0.8.0 and from v0.7.0 to v0.8.2 are supported but migrations from v0.6.0 to v0.8.0 are not supported.
The `garage_build_info`
[Prometheus metric](@/documentation/reference-manual/monitoring.md) provides
an overview for which Garage versions are currently in use within a cluster.
## Minor upgrades
Minor upgrades do not imply cluster downtime.
Before upgrading, you should still read [the changelog](https://git.deuxfleurs.fr/Deuxfleurs/garage/releases) and ideally test your deployment on a staging cluster before.
When you are ready, start by checking the health of your cluster.
You can force some checks with `garage repair`, we recommend at least running `garage repair --all-nodes --yes tables` which is very quick to run (less than a minute).
You will see that the command correctly terminated in the logs of your daemon, or using `garage worker list` (the repair workers should be in the `Done` state).
Finally, you can simply upgrade nodes one by one.
For each node: stop it, install the new binary, edit the configuration if needed, restart it.
## Major upgrades
Major upgrades can be done with minimal downtime with a bit of preparation, but the simplest way is usually to put the cluster offline for the duration of the migration.
Before upgrading, you must read [the changelog](https://git.deuxfleurs.fr/Deuxfleurs/garage/releases) and you must test your deployment on a staging cluster before.
We write guides for each major upgrade, they are stored under the "Working Documents" section of this documentation.
### Major upgrades with full downtime
From a high level perspective, a major upgrade looks like this:
1. Disable API access (for instance in your reverse proxy, or by commenting the corresponding section in your Garage configuration file and restarting Garage)
2. Check that your cluster is idle
3. Make sure the health of your cluster is good (see `garage repair`)
4. Stop the whole cluster
5. Back up the metadata folder of all your nodes, so that you will be able to restore it if the upgrade fails (data blocks being immutable, they should not be impacted)
6. Install the new binary, update the configuration
7. Start the whole cluster
8. If needed, run the corresponding migration from `garage migrate`
9. Make sure the health of your cluster is good
10. Enable API access (reverse step 1)
11. Monitor your cluster while load comes back, check that all your applications are happy with this new version
### Major upgarades with minimal downtime
There is only one operation that has to be coordinated cluster-wide: the switch of one version of the internal RPC protocol to the next.
This means that an upgrade with very limited downtime can simply be performed from one major version to the next by restarting all nodes
simultaneously in the new version.
The downtime will simply be the time required for all nodes to stop and start again, which should be less than a minute.
If all nodes fail to stop and restart simultaneously, some nodes might be temporarily shut out from the cluster as nodes using different RPC protocol
versions are prevented to talk to one another.
The entire procedure would look something like this:
1. Make sure the health of your cluster is good (see `garage repair`)
2. Take each node offline individually to back up its metadata folder, bring them back online once the backup is done.
You can do all of the nodes in a single zone at once as that won't impact global cluster availability.
Do not try to make a backup of the metadata folder of a running node.
**Since Garage v0.9.4,** you can use the `garage meta snapshot --all` command
to take a simultaneous snapshot of the metadata database files of all your
nodes. This avoids the tedious process of having to take them down one by
one before upgrading. Be careful that if automatic snapshotting is enabled,
Garage only keeps the last two snapshots and deletes older ones, so you might
want to disable automatic snapshotting in your upgraded configuration file
until you have confirmed that the upgrade ran successfully. In addition to
snapshotting the metadata databases of your nodes, you should back-up at
least the `cluster_layout` file of one of your Garage instances (this file
should be the same on all nodes and you can copy it safely while Garage is
running).
3. Prepare your binaries and configuration files for the new Garage version
4. Restart all nodes simultaneously in the new version
5. If any specific migration procedure is required, it is usually in one of the two cases:
- It can be run on online nodes after the new version has started, during regular cluster operation.
- it has to be run offline, in which case you will have to again take all nodes offline one after the other to run the repair
For this last step, please refer to the specific documentation pertaining to the version upgrade you are doing.

View File

@ -0,0 +1,327 @@
+++
title = "Quick Start"
weight = 10
sort_by = "weight"
template = "documentation.html"
+++
Let's start your Garage journey!
In this chapter, we explain how to deploy Garage as a single-node server
and how to interact with it.
## What is Garage?
Before jumping in, you might be interested in reading the following pages:
- [Goals and use cases](@/documentation/design/goals.md)
- [List of features](@/documentation/reference-manual/features.md)
## Scope of this tutorial
Our goal is to introduce you to Garage's workflows.
Following this guide is recommended before moving on to
[configuring a multi-node cluster](@/documentation/cookbook/real-world.md).
Note that this kind of deployment should not be used in production,
as it provides no redundancy for your data!
## Get a binary
Download the latest Garage binary from the release pages on our repository:
<https://garagehq.deuxfleurs.fr/download/>
Place this binary somewhere in your `$PATH` so that you can invoke the `garage`
command directly (for instance you can copy the binary in `/usr/local/bin`
or in `~/.local/bin`).
You may also check whether your distribution already includes a
[binary package for Garage](@/documentation/cookbook/binary-packages.md).
If a binary of the last version is not available for your architecture,
or if you want a build customized for your system,
you can [build Garage from source](@/documentation/cookbook/from-source.md).
## Configuring and starting Garage
### Generating a first configuration file
This first configuration file should allow you to get started easily with the simplest
possible Garage deployment.
We will create it with the following command line
to generate unique and private secrets for security reasons:
```bash
cat > garage.toml <<EOF
metadata_dir = "/tmp/meta"
data_dir = "/tmp/data"
db_engine = "sqlite"
replication_mode = "none"
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "$(openssl rand -hex 32)"
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage.localhost"
[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage.localhost"
index = "index.html"
[k2v_api]
api_bind_addr = "[::]:3904"
[admin]
api_bind_addr = "[::]:3903"
admin_token = "$(openssl rand -base64 32)"
metrics_token = "$(openssl rand -base64 32)"
EOF
```
Now that your configuration file has been created, you may save it to the directory of your choice.
By default, Garage looks for **`/etc/garage.toml`.**
You can also store it somewhere else, but you will have to specify `-c path/to/garage.toml`
at each invocation of the `garage` binary (for example: `garage -c ./garage.toml server`, `garage -c ./garage.toml status`).
As you can see, the `rpc_secret` is a 32 bytes hexadecimal string.
You can regenerate it with `openssl rand -hex 32`.
If you target a cluster deployment with multiple nodes, make sure that
you use the same value for all nodes.
As you can see in the `metadata_dir` and `data_dir` parameters, we are saving Garage's data
in `/tmp` which gets erased when your system reboots. This means that data stored on this
Garage server will not be persistent. Change these to locations on your local disk if you want
your data to be persisted properly.
### Launching the Garage server
Use the following command to launch the Garage server:
```
garage -c path/to/garage.toml server
```
If you have placed the `garage.toml` file in `/etc` (its default location), you can simply run `garage server`.
You can tune Garage's verbosity by setting the `RUST_LOG=` environment variable. \
Available log levels are (from less verbose to more verbose): `error`, `warn`, `info` *(default)*, `debug` and `trace`.
```bash
RUST_LOG=garage=info garage server # default
RUST_LOG=garage=debug garage server
RUST_LOG=garage=trace garage server
```
Log level `info` is the default value and is recommended for most use cases.
Log level `debug` can help you check why your S3 API calls are not working.
### Checking that Garage runs correctly
The `garage` utility is also used as a CLI tool to configure your Garage deployment.
It uses values from the TOML configuration file to find the Garage daemon running on the
local node, therefore if your configuration file is not at `/etc/garage.toml` you will
again have to specify `-c path/to/garage.toml` at each invocation.
If the `garage` CLI is able to correctly detect the parameters of your local Garage node,
the following command should be enough to show the status of your cluster:
```
garage status
```
This should show something like this:
```
==== HEALTHY NODES ====
ID Hostname Address Tag Zone Capacity
563e1ac825ee3323 linuxbox 127.0.0.1:3901 NO ROLE ASSIGNED
```
## Creating a cluster layout
Creating a cluster layout for a Garage deployment means informing Garage
of the disk space available on each node of the cluster
as well as the zone (e.g. datacenter) each machine is located in.
For our test deployment, we are using only one node. The way in which we configure
it does not matter, you can simply write:
```bash
garage layout assign -z dc1 -c 1G <node_id>
```
where `<node_id>` corresponds to the identifier of the node shown by `garage status` (first column).
You can enter simply a prefix of that identifier.
For instance here you could write just `garage layout assign -z dc1 -c 1G 563e`.
The layout then has to be applied to the cluster, using:
```bash
garage layout apply
```
## Creating buckets and keys
In this section, we will suppose that we want to create a bucket named `nextcloud-bucket`
that will be accessed through a key named `nextcloud-app-key`.
Don't forget that `help` command and `--help` subcommands can help you anywhere,
the CLI tool is self-documented! Two examples:
```
garage help
garage bucket allow --help
```
### Create a bucket
Let's take an example where we want to deploy NextCloud using Garage as the
main data storage.
First, create a bucket with the following command:
```
garage bucket create nextcloud-bucket
```
Check that everything went well:
```
garage bucket list
garage bucket info nextcloud-bucket
```
### Create an API key
The `nextcloud-bucket` bucket now exists on the Garage server,
however it cannot be accessed until we add an API key with the proper access rights.
Note that API keys are independent of buckets:
one key can access multiple buckets, multiple keys can access one bucket.
Create an API key using the following command:
```
garage key create nextcloud-app-key
```
The output should look as follows:
```
Key name: nextcloud-app-key
Key ID: GK3515373e4c851ebaad366558
Secret key: 7d37d093435a41f2aab8f13c19ba067d9776c90215f56614adad6ece597dbb34
Authorized buckets:
```
Check that everything works as intended:
```
garage key list
garage key info nextcloud-app-key
```
### Allow a key to access a bucket
Now that we have a bucket and a key, we need to give permissions to the key on the bucket:
```
garage bucket allow \
--read \
--write \
--owner \
nextcloud-bucket \
--key nextcloud-app-key
```
You can check at any time the allowed keys on your bucket with:
```
garage bucket info nextcloud-bucket
```
## Uploading and downloading from Garage
To download and upload files on garage, we can use a third-party tool named `awscli`.
### Install and configure `awscli`
If you have python on your system, you can install it with:
```bash
python -m pip install --user awscli
```
Now that `awscli` is installed, you must configure it to talk to your Garage instance,
with your key. There are multiple ways to do that, the simplest one is to create a file
named `~/.awsrc` with this content:
```bash
export AWS_ACCESS_KEY_ID=xxxx # put your Key ID here
export AWS_SECRET_ACCESS_KEY=xxxx # put your Secret key here
export AWS_DEFAULT_REGION='garage'
export AWS_ENDPOINT_URL='http://localhost:3900'
aws --version
```
Note you need to have at least `awscli` `>=1.29.0` or `>=2.13.0`, otherwise you
need to specify `--endpoint-url` explicitly on each `awscli` invocation.
Now, each time you want to use `awscli` on this target, run:
```bash
source ~/.awsrc
```
*You can create multiple files with different names if you
have multiple Garage clusters or different keys.
Switching from one cluster to another is as simple as
sourcing the right file.*
### Example usage of `awscli`
```bash
# list buckets
aws s3 ls
# list objects of a bucket
aws s3 ls s3://nextcloud-bucket
# copy from your filesystem to garage
aws s3 cp /proc/cpuinfo s3://nextcloud-bucket/cpuinfo.txt
# copy from garage to your filesystem
aws s3 cp s3://nextcloud-bucket/cpuinfo.txt /tmp/cpuinfo.txt
```
Note that you can use `awscli` for more advanced operations like
creating a bucket, pre-signing a request or managing your website.
[Read the full documentation to know more](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/index.html).
Some features are however not implemented like ACL or policy.
Check [our s3 compatibility list](@/documentation/reference-manual/s3-compatibility.md).
### Other tools for interacting with Garage
The following tools can also be used to send and recieve files from/to Garage:
- [minio-client](@/documentation/connect/cli.md#minio-client)
- [s3cmd](@/documentation/connect/cli.md#s3cmd)
- [rclone](@/documentation/connect/cli.md#rclone)
- [Cyberduck](@/documentation/connect/cli.md#cyberduck)
- [WinSCP](@/documentation/connect/cli.md#winscp)
An exhaustive list is maintained in the ["Integrations" > "Browsing tools" section](@/documentation/connect/_index.md).

View File

@ -1,4 +1,9 @@
# Reference Manual
+++
title = "Reference Manual"
weight = 60
sort_by = "weight"
template = "documentation.html"
+++
A reference manual contains some extensive descriptions about the features and the behaviour of the software.
Reading of this chapter is recommended once you have a good knowledge/understanding of Garage.

View File

@ -0,0 +1,148 @@
+++
title = "Administration API"
weight = 40
+++
The Garage administration API is accessible through a dedicated server whose
listen address is specified in the `[admin]` section of the configuration
file (see [configuration file
reference](@/documentation/reference-manual/configuration.md))
**WARNING.** At this point, there is no commitment to the stability of the APIs described in this document.
We will bump the version numbers prefixed to each API endpoint each time the syntax
or semantics change, meaning that code that relies on these endpoint will break
when changes are introduced.
Versions:
- Before Garage 0.7.2 - no admin API
- Garage 0.7.2 - admin APIv0
- Garage 0.9.0 - admin APIv1, deprecate admin APIv0
## Access control
The admin API uses two different tokens for access control, that are specified in the config file's `[admin]` section:
- `metrics_token`: the token for accessing the Metrics endpoint (if this token
is not set in the config file, the Metrics endpoint can be accessed without
access control);
- `admin_token`: the token for accessing all of the other administration
endpoints (if this token is not set in the config file, access to these
endpoints is disabled entirely).
These tokens are used as simple HTTP bearer tokens. In other words, to
authenticate access to an admin API endpoint, add the following HTTP header
to your request:
```
Authorization: Bearer <token>
```
## Administration API endpoints
### Metrics `GET /metrics`
Returns internal Garage metrics in Prometheus format.
The metrics are directly documented when returned by the API.
**Example:**
```
$ curl -i http://localhost:3903/metrics
HTTP/1.1 200 OK
content-type: text/plain; version=0.0.4
content-length: 12145
date: Tue, 08 Aug 2023 07:25:05 GMT
# HELP api_admin_error_counter Number of API calls to the various Admin API endpoints that resulted in errors
# TYPE api_admin_error_counter counter
api_admin_error_counter{api_endpoint="CheckWebsiteEnabled",status_code="400"} 1
api_admin_error_counter{api_endpoint="CheckWebsiteEnabled",status_code="404"} 3
# HELP api_admin_request_counter Number of API calls to the various Admin API endpoints
# TYPE api_admin_request_counter counter
api_admin_request_counter{api_endpoint="CheckWebsiteEnabled"} 7
api_admin_request_counter{api_endpoint="Health"} 3
# HELP api_admin_request_duration Duration of API calls to the various Admin API endpoints
...
```
### Health `GET /health`
Returns `200 OK` if enough nodes are up to have a quorum (ie. serve requests),
otherwise returns `503 Service Unavailable`.
**Example:**
```
$ curl -i http://localhost:3903/health
HTTP/1.1 200 OK
content-type: text/plain
content-length: 102
date: Tue, 08 Aug 2023 07:22:38 GMT
Garage is fully operational
Consult the full health check API endpoint at /v0/health for more details
```
### On-demand TLS `GET /check`
To prevent abuse for on-demand TLS, Caddy developers have specified an endpoint that can be queried by the reverse proxy
to know if a given domain is allowed to get a certificate. Garage implements these endpoints to tell if a given domain is handled by Garage or is garbage.
Garage responds with the following logic:
- If the domain matches the pattern `<bucket-name>.<s3_api.root_domain>`, returns 200 OK
- If the domain matches the pattern `<bucket-name>.<s3_web.root_domain>` and website is configured for `<bucket>`, returns 200 OK
- If the domain matches the pattern `<bucket-name>` and website is configured for `<bucket>`, returns 200 OK
- Otherwise, returns 404 Not Found, 400 Bad Request or 5xx requests.
*Note 1: because in the path-style URL mode, there is only one domain that is not known by Garage, hence it is not supported by this API endpoint.
You must manually declare the domain in your reverse-proxy. Idem for K2V.*
*Note 2: buckets in a user's namespace are not supported yet by this endpoint. This is a limitation of this endpoint currently.*
**Example:** Suppose a Garage instance is configured with `s3_api.root_domain = .s3.garage.localhost` and `s3_web.root_domain = .web.garage.localhost`.
With a private `media` bucket (name in the global namespace, website is disabled), the endpoint will feature the following behavior:
```
$ curl -so /dev/null -w "%{http_code}" http://localhost:3903/check?domain=media.s3.garage.localhost
200
$ curl -so /dev/null -w "%{http_code}" http://localhost:3903/check?domain=media
400
$ curl -so /dev/null -w "%{http_code}" http://localhost:3903/check?domain=media.web.garage.localhost
400
```
With a public `example.com` bucket (name in the global namespace, website is activated), the endpoint will feature the following behavior:
```
$ curl -so /dev/null -w "%{http_code}" http://localhost:3903/check?domain=example.com.s3.garage.localhost
200
$ curl -so /dev/null -w "%{http_code}" http://localhost:3903/check?domain=example.com
200
$ curl -so /dev/null -w "%{http_code}" http://localhost:3903/check?domain=example.com.web.garage.localhost
200
```
**References:**
- [Using On-Demand TLS](https://caddyserver.com/docs/automatic-https#using-on-demand-tls)
- [Add option for a backend check to approve use of on-demand TLS](https://github.com/caddyserver/caddy/pull/1939)
- [Serving tens of thousands of domains over HTTPS with Caddy](https://caddy.community/t/serving-tens-of-thousands-of-domains-over-https-with-caddy/11179)
### Cluster operations
These endpoints have a dedicated OpenAPI spec.
- APIv1 - [HTML spec](https://garagehq.deuxfleurs.fr/api/garage-admin-v1.html) - [OpenAPI YAML](https://garagehq.deuxfleurs.fr/api/garage-admin-v1.yml)
- APIv0 (deprecated) - [HTML spec](https://garagehq.deuxfleurs.fr/api/garage-admin-v0.html) - [OpenAPI YAML](https://garagehq.deuxfleurs.fr/api/garage-admin-v0.yml)
Requesting the API from the command line can be as simple as running:
```bash
curl -H 'Authorization: Bearer s3cr3t' http://localhost:3903/v0/status | jq
```
For more advanced use cases, we recommend using a SDK.
[Go to the "Build your own app" section to know how to use our SDKs](@/documentation/build/_index.md)

View File

@ -1,4 +1,7 @@
# Garage CLI
+++
title = "Garage CLI"
weight = 30
+++
The Garage CLI is mostly self-documented. Make use of the `help` subcommand
and the `--help` flag to discover all available options.

View File

@ -0,0 +1,745 @@
+++
title = "Configuration file format"
weight = 20
+++
## Full example
Here is an example `garage.toml` configuration file that illustrates all of the possible options:
```toml
replication_mode = "3"
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
metadata_fsync = true
data_fsync = false
disable_scrub = false
metadata_auto_snapshot_interval = "6h"
db_engine = "lmdb"
block_size = "1M"
block_ram_buffer_max = "256MiB"
sled_cache_capacity = "128MiB"
sled_flush_every_ms = 2000
lmdb_map_size = "1T"
compression_level = 1
rpc_secret = "4425f5c26c5e11581d3223904324dcb5b5d5dfb14e5e7f35e38c595424f5f1e6"
rpc_bind_addr = "[::]:3901"
rpc_bind_outgoing = false
rpc_public_addr = "[fc00:1::1]:3901"
allow_world_readable_secrets = false
bootstrap_peers = [
"563e1ac825ee3323aa441e72c26d1030d6d4414aeb3dd25287c531e7fc2bc95d@[fc00:1::1]:3901",
"86f0f26ae4afbd59aaf9cfb059eefac844951efd5b8caeec0d53f4ed6c85f332@[fc00:1::2]:3901",
"681456ab91350f92242e80a531a3ec9392cb7c974f72640112f90a600d7921a4@[fc00:B::1]:3901",
"212fd62eeaca72c122b45a7f4fa0f55e012aa5e24ac384a72a3016413fa724ff@[fc00:F::1]:3901",
]
[consul_discovery]
api = "catalog"
consul_http_addr = "http://127.0.0.1:8500"
service_name = "garage-daemon"
ca_cert = "/etc/consul/consul-ca.crt"
client_cert = "/etc/consul/consul-client.crt"
client_key = "/etc/consul/consul-key.crt"
# for `agent` API mode, unset client_cert and client_key, and optionally enable `token`
# token = "abcdef-01234-56789"
tls_skip_verify = false
tags = [ "dns-enabled" ]
meta = { dns-acl = "allow trusted" }
[kubernetes_discovery]
namespace = "garage"
service_name = "garage-daemon"
skip_crd = false
[s3_api]
api_bind_addr = "[::]:3900"
s3_region = "garage"
root_domain = ".s3.garage"
[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage"
[admin]
api_bind_addr = "0.0.0.0:3903"
metrics_token = "BCAdFjoa9G0KJR0WXnHHm7fs1ZAbfpI8iIZ+Z/a2NgI="
admin_token = "UkLeGWEvHnXBqnueR3ISEMWpOnm40jH2tM2HnnL/0F4="
trace_sink = "http://localhost:4317"
```
The following gives details about each available configuration option.
## Available configuration options
### Index
[Environment variables](#env_variables).
Top-level configuration options:
[`allow_world_readable_secrets`](#allow_world_readable_secrets),
[`block_ram_buffer_max`](#block_ram_buffer_max),
[`block_size`](#block_size),
[`bootstrap_peers`](#bootstrap_peers),
[`compression_level`](#compression_level),
[`data_dir`](#data_dir),
[`data_fsync`](#data_fsync),
[`db_engine`](#db_engine),
[`disable_scrub`](#disable_scrub),
[`lmdb_map_size`](#lmdb_map_size),
[`metadata_auto_snapshot_interval`](#metadata_auto_snapshot_interval),
[`metadata_dir`](#metadata_dir),
[`metadata_fsync`](#metadata_fsync),
[`replication_mode`](#replication_mode),
[`rpc_bind_addr`](#rpc_bind_addr),
[`rpc_bind_outgoing`](#rpc_bind_outgoing),
[`rpc_public_addr`](#rpc_public_addr),
[`rpc_secret`/`rpc_secret_file`](#rpc_secret),
[`sled_cache_capacity`](#sled_cache_capacity),
[`sled_flush_every_ms`](#sled_flush_every_ms).
The `[consul_discovery]` section:
[`api`](#consul_api),
[`ca_cert`](#consul_ca_cert),
[`client_cert`](#consul_client_cert_and_key),
[`client_key`](#consul_client_cert_and_key),
[`consul_http_addr`](#consul_http_addr),
[`meta`](#consul_tags_and_meta),
[`service_name`](#consul_service_name),
[`tags`](#consul_tags_and_meta),
[`tls_skip_verify`](#consul_tls_skip_verify),
[`token`](#consul_token).
The `[kubernetes_discovery]` section:
[`namespace`](#kube_namespace),
[`service_name`](#kube_service_name),
[`skip_crd`](#kube_skip_crd).
The `[s3_api]` section:
[`api_bind_addr`](#s3_api_bind_addr),
[`root_domain`](#s3_root_domain),
[`s3_region`](#s3_region).
The `[s3_web]` section:
[`bind_addr`](#web_bind_addr),
[`root_domain`](#web_root_domain).
The `[admin]` section:
[`api_bind_addr`](#admin_api_bind_addr),
[`metrics_token`/`metrics_token_file`](#admin_metrics_token),
[`admin_token`/`admin_token_file`](#admin_token),
[`trace_sink`](#admin_trace_sink),
### Environment variables {#env_variables}
The following configuration parameter must be specified as an environment
variable, it does not exist in the configuration file:
- `GARAGE_LOG_TO_SYSLOG` (since v0.9.4): set this to `1` or `true` to make the
Garage daemon send its logs to `syslog` (using the libc `syslog` function)
instead of printing to stderr.
The following environment variables can be used to override the corresponding
values in the configuration file:
- [`GARAGE_ALLOW_WORLD_READABLE_SECRETS`](#allow_world_readable_secrets)
- [`GARAGE_RPC_SECRET` and `GARAGE_RPC_SECRET_FILE`](#rpc_secret)
- [`GARAGE_ADMIN_TOKEN` and `GARAGE_ADMIN_TOKEN_FILE`](#admin_token)
- [`GARAGE_METRICS_TOKEN` and `GARAGE_METRICS_TOKEN`](#admin_metrics_token)
### Top-level configuration options
#### `replication_mode` {#replication_mode}
Garage supports the following replication modes:
- `none` or `1`: data stored on Garage is stored on a single node. There is no
redundancy, and data will be unavailable as soon as one node fails or its
network is disconnected. Do not use this for anything else than test
deployments.
- `2`: data stored on Garage will be stored on two different nodes, if possible
in different zones. Garage tolerates one node failure, or several nodes
failing but all in a single zone (in a deployment with at least two zones),
before losing data. Data remains available in read-only mode when one node is
down, but write operations will fail.
- `2-dangerous`: a variant of mode `2`, where written objects are written to
the second replica asynchronously. This means that Garage will return `200
OK` to a PutObject request before the second copy is fully written (or even
before it even starts being written). This means that data can more easily
be lost if the node crashes before a second copy can be completed. This
also means that written objects might not be visible immediately in read
operations. In other words, this mode severely breaks the consistency and
durability guarantees of standard Garage cluster operation. Benefits of
this mode: you can still write to your cluster when one node is
unavailable.
- `3`: data stored on Garage will be stored on three different nodes, if
possible each in a different zones. Garage tolerates two node failure, or
several node failures but in no more than two zones (in a deployment with at
least three zones), before losing data. As long as only a single node fails,
or node failures are only in a single zone, reading and writing data to
Garage can continue normally.
- `3-degraded`: a variant of replication mode `3`, that lowers the read
quorum to `1`, to allow you to read data from your cluster when several
nodes (or nodes in several zones) are unavailable. In this mode, Garage
does not provide read-after-write consistency anymore. The write quorum is
still 2, ensuring that data successfully written to Garage is stored on at
least two nodes.
- `3-dangerous`: a variant of replication mode `3` that lowers both the read
and write quorums to `1`, to allow you to both read and write to your
cluster when several nodes (or nodes in several zones) are unavailable. It
is the least consistent mode of operation proposed by Garage, and also one
that should probably never be used.
Note that in modes `2` and `3`,
if at least the same number of zones are available, an arbitrary number of failures in
any given zone is tolerated as copies of data will be spread over several zones.
**Make sure `replication_mode` is the same in the configuration files of all nodes.
Never run a Garage cluster where that is not the case.**
The quorums associated with each replication mode are described below:
| `replication_mode` | Number of replicas | Write quorum | Read quorum | Read-after-write consistency? |
| ------------------ | ------------------ | ------------ | ----------- | ----------------------------- |
| `none` or `1` | 1 | 1 | 1 | yes |
| `2` | 2 | 2 | 1 | yes |
| `2-dangerous` | 2 | 1 | 1 | NO |
| `3` | 3 | 2 | 2 | yes |
| `3-degraded` | 3 | 2 | 1 | NO |
| `3-dangerous` | 3 | 1 | 1 | NO |
Changing the `replication_mode` between modes with the same number of replicas
(e.g. from `3` to `3-degraded`, or from `2-dangerous` to `2`), can be done easily by
just changing the `replication_mode` parameter in your config files and restarting all your
Garage nodes.
It is also technically possible to change the replication mode to a mode with a
different numbers of replicas, although it's a dangerous operation that is not
officially supported. This requires you to delete the existing cluster layout
and create a new layout from scratch, meaning that a full rebalancing of your
cluster's data will be needed. To do it, shut down your cluster entirely,
delete the `custer_layout` files in the meta directories of all your nodes,
update all your configuration files with the new `replication_mode` parameter,
restart your cluster, and then create a new layout with all the nodes you want
to keep. Rebalancing data will take some time, and data might temporarily
appear unavailable to your users. It is recommended to shut down public access
to the cluster while rebalancing is in progress. In theory, no data should be
lost as rebalancing is a routine operation for Garage, although we cannot
guarantee you that everything will go right in such an extreme scenario.
#### `metadata_dir` {#metadata_dir}
The directory in which Garage will store its metadata. This contains the node identifier,
the network configuration and the peer list, the list of buckets and keys as well
as the index of all objects, object version and object blocks.
Store this folder on a fast SSD drive if possible to maximize Garage's performance.
#### `data_dir` {#data_dir}
The directory in which Garage will store the data blocks of objects.
This folder can be placed on an HDD. The space available for `data_dir`
should be counted to determine a node's capacity
when [adding it to the cluster layout](@/documentation/cookbook/real-world.md).
Since `v0.9.0`, Garage supports multiple data directories with the following syntax:
```toml
data_dir = [
{ path = "/path/to/old_data", read_only = true },
{ path = "/path/to/new_hdd1", capacity = "2T" },
{ path = "/path/to/new_hdd2", capacity = "4T" },
]
```
See [the dedicated documentation page](@/documentation/operations/multi-hdd.md)
on how to operate Garage in such a setup.
#### `db_engine` (since `v0.8.0`) {#db_engine}
Since `v0.8.0`, Garage can use alternative storage backends as follows:
| DB engine | `db_engine` value | Database path |
| --------- | ----------------- | ------------- |
| [LMDB](https://www.lmdb.tech) (default since `v0.9.0`) | `"lmdb"` | `<metadata_dir>/db.lmdb/` |
| [Sled](https://sled.rs) (default up to `v0.8.0`) | `"sled"` | `<metadata_dir>/db/` |
| [Sqlite](https://sqlite.org) | `"sqlite"` | `<metadata_dir>/db.sqlite` |
Sled was the only database engine up to Garage v0.7.0. Performance issues and
API limitations of Sled prompted the addition of alternative engines in v0.8.0.
Since v0.9.0, LMDB is the default engine instead of Sled, and Sled is
deprecated. We plan to remove Sled in Garage v1.0.
Performance characteristics of the different DB engines are as follows:
- Sled: tends to produce large data files and also has performance issues,
especially when the metadata folder is on a traditional HDD and not on SSD.
- LMDB: the recommended database engine for high-performance distributed
clusters, much more space-efficient and significantly faster. LMDB works very
well, but is known to have the following limitations:
- The data format of LMDB is not portable between architectures, so for
instance the Garage database of an x86-64 node cannot be moved to an ARM64
node.
- While LMDB can technically be used on 32-bit systems, this will limit your
node to very small database sizes due to how LMDB works; it is therefore
not recommended.
- Several users have reported corrupted LMDB database files after an unclean
shutdown (e.g. a power outage). This situation can generally be recovered
from if your cluster is geo-replicated (by rebuilding your metadata db from
other nodes), or if you have saved regular snapshots at the filesystem
level.
- Sqlite: Garage supports Sqlite as an alternative storage backend for
metadata, which does not have the issues listed above for LMDB.
On versions 0.8.x and earlier, Sqlite should be avoided due to abysmal
performance, which was fixed with the addition of `metadata_fsync`.
Sqlite is still probably slower than LMDB due to the way we use it,
so it is not the best choice for high-performance storage clusters,
but it should work fine in many cases.
It is possible to convert Garage's metadata directory from one format to another
using the `garage convert-db` command, which should be used as follows:
```
garage convert-db -a <input db engine> -i <input db path> \
-b <output db engine> -o <output db path>
```
Make sure to specify the full database path as presented in the table above
(third colummn), and not just the path to the metadata directory.
#### `metadata_fsync` {#metadata_fsync}
Whether to enable synchronous mode for the database engine or not.
This is disabled (`false`) by default.
This reduces the risk of metadata corruption in case of power failures,
at the cost of a significant drop in write performance,
as Garage will have to pause to sync data to disk much more often
(several times for API calls such as PutObject).
Using this option reduces the risk of simultaneous metadata corruption on several
cluster nodes, which could lead to data loss.
If multi-site replication is used, this option is most likely not necessary, as
it is extremely unlikely that two nodes in different locations will have a
power failure at the exact same time.
(Metadata corruption on a single node is not an issue, the corrupted data file
can always be deleted and reconstructed from the other nodes in the cluster.)
Here is how this option impacts the different database engines:
| Database | `metadata_fsync = false` (default) | `metadata_fsync = true` |
|----------|------------------------------------|-------------------------------|
| Sled | default options | *unsupported* |
| Sqlite | `PRAGMA synchronous = OFF` | `PRAGMA synchronous = NORMAL` |
| LMDB | `MDB_NOMETASYNC` + `MDB_NOSYNC` | `MDB_NOMETASYNC` |
Note that the Sqlite database is always ran in `WAL` mode (`PRAGMA journal_mode = WAL`).
#### `data_fsync` {#data_fsync}
Whether to `fsync` data blocks and their containing directory after they are
saved to disk.
This is disabled (`false`) by default.
This might reduce the risk that a data block is lost in rare
situations such as simultaneous node losing power,
at the cost of a moderate drop in write performance.
Similarly to `metatada_fsync`, this is likely not necessary
if geographical replication is used.
#### `metadata_auto_snapshot_interval` (since Garage v0.9.4) {#metadata_auto_snapshot_interval}
If this value is set, Garage will automatically take a snapshot of the metadata
DB file at a regular interval and save it in the metadata directory.
This can allow to recover from situations where the metadata DB file is corrupted,
for instance after an unclean shutdown.
See [this page](@/documentation/operations/recovering.md#corrupted_meta) for details.
Garage keeps only the two most recent snapshots of the metadata DB and deletes
older ones automatically.
Note that taking a metadata snapshot is a relatively intensive operation as the
entire data file is copied. A snapshot being taken might have performance
impacts on the Garage node while it is running. If the cluster is under heavy
write load when a snapshot operation is running, this might also cause the
database file to grow in size significantly as pages cannot be recycled easily.
For this reason, it might be better to use filesystem-level snapshots instead
if possible.
#### `disable_scrub` {#disable_scrub}
By default, Garage runs a scrub of the data directory approximately once per
month, with a random delay to avoid all nodes running at the same time. When
it scrubs the data directory, Garage will read all of the data files stored on
disk to check their integrity, and will rebuild any data files that it finds
corrupted, using the remaining valid copies stored on other nodes.
See [this page](@/documentation/operations/durability-repair.md#scrub) for details.
Set the `disable_scrub` configuration value to `true` if you don't need Garage
to scrub the data directory, for instance if you are already scrubbing at the
filesystem level. Note that in this case, if you find a corrupted data file,
you should delete it from the data directory and then call `garage repair
blocks` on the node to ensure that it re-obtains a copy from another node on
the network.
#### `block_size` {#block_size}
Garage splits stored objects in consecutive chunks of size `block_size`
(except the last one which might be smaller). The default size is 1MiB and
should work in most cases. We recommend increasing it to e.g. 10MiB if
you are using Garage to store large files and have fast network connections
between all nodes (e.g. 1gbps).
If you are interested in tuning this, feel free to do so (and remember to
report your findings to us!). When this value is changed for a running Garage
installation, only files newly uploaded will be affected. Previously uploaded
files will remain available. This however means that chunks from existing files
will not be deduplicated with chunks from newly uploaded files, meaning you
might use more storage space that is optimally possible.
#### `block_ram_buffer_max` (since v0.9.4) {#block_ram_buffer_max}
A limit on the total size of data blocks kept in RAM by S3 API nodes awaiting
to be sent to storage nodes asynchronously.
Explanation: since Garage wants to tolerate node failures, it uses quorum
writes to send data blocks to storage nodes: try to write the block to three
nodes, and return ok as soon as two writes complete. So even if all three nodes
are online, the third write always completes asynchronously. In general, there
are not many writes to a cluster, and the third asynchronous write can
terminate early enough so as to not cause unbounded RAM growth. However, if
the S3 API node is continuously receiving large quantities of data and the
third node is never able to catch up, many data blocks will be kept buffered in
RAM as they are awaiting transfer to the third node.
The `block_ram_buffer_max` sets a limit to the size of buffers that can be kept
in RAM in this process. When the limit is reached, backpressure is applied
back to the S3 client.
Note that this only counts buffers that have arrived to a certain stage of
processing (received from the client + encrypted and/or compressed as
necessary) and are ready to send to the storage nodes. Many other buffers will
not be counted and this is not a hard limit on RAM consumption. In particular,
if many clients send requests simultaneously with large objects, the RAM
consumption will always grow linearly with the number of concurrent requests,
as each request will use a few buffers of size `block_size` for receiving and
intermediate processing before even trying to send the data to the storage
node.
The default value is 256MiB.
#### `sled_cache_capacity` {#sled_cache_capacity}
This parameter can be used to tune the capacity of the cache used by
[sled](https://sled.rs), the database Garage uses internally to store metadata.
Tune this to fit the RAM you wish to make available to your Garage instance.
This value has a conservative default (128MB) so that Garage doesn't use too much
RAM by default, but feel free to increase this for higher performance.
#### `sled_flush_every_ms` {#sled_flush_every_ms}
This parameters can be used to tune the flushing interval of sled.
Increase this if sled is thrashing your SSD, at the risk of losing more data in case
of a power outage (though this should not matter much as data is replicated on other
nodes). The default value, 2000ms, should be appropriate for most use cases.
#### `lmdb_map_size` {#lmdb_map_size}
This parameters can be used to set the map size used by LMDB,
which is the size of the virtual memory region used for mapping the database file.
The value of this parameter is the maximum size the metadata database can take.
This value is not bound by the physical RAM size of the machine running Garage.
If not specified, it defaults to 1GiB on 32-bit machines and 1TiB on 64-bit machines.
#### `compression_level` {#compression_level}
Zstd compression level to use for storing blocks.
Values between `1` (faster compression) and `19` (smaller file) are standard compression
levels for zstd. From `20` to `22`, compression levels are referred as "ultra" and must be
used with extra care as it will use lot of memory. A value of `0` will let zstd choose a
default value (currently `3`). Finally, zstd has also compression designed to be faster
than default compression levels, they range from `-1` (smaller file) to `-99` (faster
compression).
If you do not specify a `compression_level` entry, Garage will set it to `1` for you. With
this parameters, zstd consumes low amount of cpu and should work faster than line speed in
most situations, while saving some space and intra-cluster
bandwidth.
If you want to totally deactivate zstd in Garage, you can pass the special value `'none'`. No
zstd related code will be called, your chunks will be stored on disk without any processing.
Compression is done synchronously, setting a value too high will add latency to write queries.
This value can be different between nodes, compression is done by the node which receive the
API call.
#### `rpc_secret`, `rpc_secret_file` or `GARAGE_RPC_SECRET`, `GARAGE_RPC_SECRET_FILE` (env) {#rpc_secret}
Garage uses a secret key, called an RPC secret, that is shared between all
nodes of the cluster in order to identify these nodes and allow them to
communicate together. The RPC secret is a 32-byte hex-encoded random string,
which can be generated with a command such as `openssl rand -hex 32`.
The RPC secret should be specified in the `rpc_secret` configuration variable.
Since Garage `v0.8.2`, the RPC secret can also be stored in a file whose path is
given in the configuration variable `rpc_secret_file`, or specified as an
environment variable `GARAGE_RPC_SECRET`.
Since Garage `v0.8.5` and `v0.9.1`, you can also specify the path of a file
storing the secret as the `GARAGE_RPC_SECRET_FILE` environment variable.
#### `rpc_bind_addr` {#rpc_bind_addr}
The address and port on which to bind for inter-cluster communcations
(reffered to as RPC for remote procedure calls).
The port specified here should be the same one that other nodes will used to contact
the node, even in the case of a NAT: the NAT should be configured to forward the external
port number to the same internal port nubmer. This means that if you have several nodes running
behind a NAT, they should each use a different RPC port number.
#### `rpc_bind_outgoing`(since v0.9.2) {#rpc_bind_outgoing}
If enabled, pre-bind all sockets for outgoing connections to the same IP address
used for listening (the IP address specified in `rpc_bind_addr`) before
trying to connect to remote nodes.
This can be necessary if a node has multiple IP addresses,
but only one is allowed or able to reach the other nodes,
for instance due to firewall rules or specific routing configuration.
Disabled by default.
#### `rpc_public_addr` {#rpc_public_addr}
The address and port that other nodes need to use to contact this node for
RPC calls. **This parameter is optional but recommended.** In case you have
a NAT that binds the RPC port to a port that is different on your public IP,
this field might help making it work.
#### `bootstrap_peers` {#bootstrap_peers}
A list of peer identifiers on which to contact other Garage peers of this cluster.
These peer identifiers have the following syntax:
```
<node public key>@<node public IP or hostname>:<port>
```
In the case where `rpc_public_addr` is correctly specified in the
configuration file, the full identifier of a node including IP and port can
be obtained by running `garage node id` and then included directly in the
`bootstrap_peers` list of other nodes. Otherwise, only the node's public
key will be returned by `garage node id` and you will have to add the IP
yourself.
### `allow_world_readable_secrets` or `GARAGE_ALLOW_WORLD_READABLE_SECRETS` (env) {#allow_world_readable_secrets}
Garage checks the permissions of your secret files to make sure they're not
world-readable. In some cases, the check might fail and consider your files as
world-readable even if they're not, for instance when using Posix ACLs.
Setting `allow_world_readable_secrets` to `true` bypass this
permission verification.
Alternatively, you can set the `GARAGE_ALLOW_WORLD_READABLE_SECRETS`
environment variable to `true` to bypass the permissions check.
### The `[consul_discovery]` section
Garage supports discovering other nodes of the cluster using Consul. For this
to work correctly, nodes need to know their IP address by which they can be
reached by other nodes of the cluster, which should be set in `rpc_public_addr`.
#### `consul_http_addr` {#consul_http_addr}
The `consul_http_addr` parameter should be set to the full HTTP(S) address of the Consul server.
#### `api` {#consul_api}
Two APIs for service registration are supported: `catalog` and `agent`. `catalog`, the default, will register a service using
the `/v1/catalog` endpoints, enabling mTLS if `client_cert` and `client_key` are provided. The `agent` API uses the
`v1/agent` endpoints instead, where an optional `token` may be provided.
#### `service_name` {#consul_service_name}
`service_name` should be set to the service name under which Garage's
RPC ports are announced.
#### `client_cert`, `client_key` {#consul_client_cert_and_key}
TLS client certificate and client key to use when communicating with Consul over TLS. Both are mandatory when doing so.
Only available when `api = "catalog"`.
#### `ca_cert` {#consul_ca_cert}
TLS CA certificate to use when communicating with Consul over TLS.
#### `tls_skip_verify` {#consul_tls_skip_verify}
Skip server hostname verification in TLS handshake.
`ca_cert` is ignored when this is set.
#### `token` {#consul_token}
Uses the provided token for communication with Consul. Only available when `api = "agent"`.
The policy assigned to this token should at least have these rules:
```hcl
// the `service_name` specified above
service "garage" {
policy = "write"
}
service_prefix "" {
policy = "read"
}
node_prefix "" {
policy = "read"
}
```
#### `tags` and `meta` {#consul_tags_and_meta}
Additional list of tags and map of service meta to add during service registration.
### The `[kubernetes_discovery]` section
Garage supports discovering other nodes of the cluster using kubernetes custom
resources. For this to work, a `[kubernetes_discovery]` section must be present
with at least the `namespace` and `service_name` parameters.
#### `namespace` {#kube_namespace}
`namespace` sets the namespace in which the custom resources are
configured.
#### `service_name` {#kube_service_name}
`service_name` is added as a label to the advertised resources to
filter them, to allow for multiple deployments in a single namespace.
#### `skip_crd` {#kube_skip_crd}
`skip_crd` can be set to true to disable the automatic creation and
patching of the `garagenodes.deuxfleurs.fr` CRD. You will need to create the CRD
manually.
### The `[s3_api]` section
#### `api_bind_addr` {#s3_api_bind_addr}
The IP and port on which to bind for accepting S3 API calls.
This endpoint does not suport TLS: a reverse proxy should be used to provide it.
Alternatively, since `v0.8.5`, a path can be used to create a unix socket with 0222 mode.
#### `s3_region` {#s3_region}
Garage will accept S3 API calls that are targetted to the S3 region defined here.
API calls targetted to other regions will fail with a AuthorizationHeaderMalformed error
message that redirects the client to the correct region.
#### `root_domain` {#s3_root_domain}
The optional suffix to access bucket using vhost-style in addition to path-style request.
Note path-style requests are always enabled, whether or not vhost-style is configured.
Configuring vhost-style S3 required a wildcard DNS entry, and possibly a wildcard TLS certificate,
but might be required by softwares not supporting path-style requests.
If `root_domain` is `s3.garage.eu`, a bucket called `my-bucket` can be interacted with
using the hostname `my-bucket.s3.garage.eu`.
### The `[s3_web]` section
Garage allows to publish content of buckets as websites. This section configures the
behaviour of this module.
#### `bind_addr` {#web_bind_addr}
The IP and port on which to bind for accepting HTTP requests to buckets configured
for website access.
This endpoint does not suport TLS: a reverse proxy should be used to provide it.
Alternatively, since `v0.8.5`, a path can be used to create a unix socket with 0222 mode.
#### `root_domain` {#web_root_domain}
The optional suffix appended to bucket names for the corresponding HTTP Host.
For instance, if `root_domain` is `web.garage.eu`, a bucket called `deuxfleurs.fr`
will be accessible either with hostname `deuxfleurs.fr.web.garage.eu`
or with hostname `deuxfleurs.fr`.
### The `[admin]` section
Garage has a few administration capabilities, in particular to allow remote monitoring. These features are detailed below.
#### `api_bind_addr` {#admin_api_bind_addr}
If specified, Garage will bind an HTTP server to this port and address, on
which it will listen to requests for administration features.
See [administration API reference](@/documentation/reference-manual/admin-api.md) to learn more about these features.
Alternatively, since `v0.8.5`, a path can be used to create a unix socket. Note that for security reasons,
the socket will have 0220 mode. Make sure to set user and group permissions accordingly.
#### `metrics_token`, `metrics_token_file` or `GARAGE_METRICS_TOKEN`, `GARAGE_METRICS_TOKEN_FILE` (env) {#admin_metrics_token}
The token for accessing the Metrics endpoint. If this token is not set, the
Metrics endpoint can be accessed without access control.
You can use any random string for this value. We recommend generating a random token with `openssl rand -base64 32`.
`metrics_token` was introduced in Garage `v0.7.2`.
`metrics_token_file` and the `GARAGE_METRICS_TOKEN` environment variable are supported since Garage `v0.8.2`.
`GARAGE_METRICS_TOKEN_FILE` is supported since `v0.8.5` / `v0.9.1`.
#### `admin_token`, `admin_token_file` or `GARAGE_ADMIN_TOKEN`, `GARAGE_ADMIN_TOKEN_FILE` (env) {#admin_token}
The token for accessing all of the other administration endpoints. If this
token is not set, access to these endpoints is disabled entirely.
You can use any random string for this value. We recommend generating a random token with `openssl rand -base64 32`.
`admin_token` was introduced in Garage `v0.7.2`.
`admin_token_file` and the `GARAGE_ADMIN_TOKEN` environment variable are supported since Garage `v0.8.2`.
`GARAGE_ADMIN_TOKEN_FILE` is supported since `v0.8.5` / `v0.9.1`.
#### `trace_sink` {#admin_trace_sink}
Optionally, the address of an OpenTelemetry collector. If specified,
Garage will send traces in the OpenTelemetry format to this endpoint. These
trace allow to inspect Garage's operation when it handles S3 API requests.

View File

@ -0,0 +1,133 @@
+++
title = "List of Garage features"
weight = 10
+++
### S3 API
The main goal of Garage is to provide an object storage service that is compatible with the
[S3 API](https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html) from Amazon Web Services.
We try to adhere as strictly as possible to the semantics of the API as implemented by Amazon
and other vendors such as Minio or CEPH.
Of course Garage does not implement the full span of API endpoints that AWS S3 does;
the exact list of S3 features implemented by Garage can be found [on our S3 compatibility page](@/documentation/reference-manual/s3-compatibility.md).
### Geo-distribution
Garage allows you to store copies of your data in multiple geographical locations in order to maximize resilience
to adverse events, such as network/power outages or hardware failures.
This allows Garage to run very well even at home, using consumer-grade Internet connectivity
(such as FTTH) and power, as long as cluster nodes can be spawned at several physical locations.
Garage exploits knowledge of the capacity and physical location of each storage node to design
a storage plan that best exploits the available storage capacity while satisfying the geo-distributed replication constraint.
To learn more about geo-distributed Garage clusters,
read our documentation on [setting up a real-world deployment](@/documentation/cookbook/real-world.md).
### Standalone/self-contained
Garage is extremely simple to deploy, and does not depend on any external service to run.
This makes setting up and administering storage clusters, we hope, as easy as it could be.
### Flexible topology
A Garage cluster can very easily evolve over time, as storage nodes are added or removed.
Garage will automatically rebalance data between nodes as needed to ensure the desired number of copies.
Read about cluster layout management [here](@/documentation/operations/layout.md).
### Several replication modes
Garage supports a variety of replication modes, with 1 copy, 2 copies or 3 copies of your data,
and with various levels of consistency, in order to adapt to a variety of usage scenarios.
Read our reference page on [supported replication modes](@/documentation/reference-manual/configuration.md#replication_mode)
to select the replication mode best suited to your use case (hint: in most cases, `replication_mode = "3"` is what you want).
### Compression and deduplication
All data stored in Garage is deduplicated, and optionnally compressed using
Zstd. Objects uploaded to Garage are chunked in blocks of constant sizes (see
[`block_size`](@/documentation/reference-manual/configuration.md#block_size)),
and the hashes of individual blocks are used to dispatch them to storage nodes
and to deduplicate them.
### No RAFT slowing you down
It might seem strange to tout the absence of something as a desirable feature,
but this is in fact a very important point! Garage does not use RAFT or another
consensus algorithm internally to order incoming requests: this means that all requests
directed to a Garage cluster can be handled independently of one another instead
of going through a central bottleneck (the leader node).
As a consequence, requests can be handled much faster, even in cases where latency
between cluster nodes is important (see our [benchmarks](@/documentation/design/benchmarks/index.md) for data on this).
This is particularly usefull when nodes are far from one another and talk to one other through standard Internet connections.
### Web server for static websites
A storage bucket can easily be configured to be served directly by Garage as a static web site.
Domain names for multiple websites directly map to bucket names, making it easy to build
a platform for your users to autonomously build and host their websites over Garage.
Surprisingly, none of the other alternative S3 implementations we surveyed (such as Minio
or CEPH) support publishing static websites from S3 buckets, a feature that is however
directly inherited from S3 on AWS.
Read more on our [dedicated documentation page](@/documentation/cookbook/exposing-websites.md).
### Bucket names as aliases
In Garage, a bucket may have several names, known as aliases.
Aliases can easily be added and removed on demand:
this allows to easily rename buckets if needed
without having to copy all of their content, something that cannot be done on AWS.
For buckets served as static websites, having multiple aliases for a bucket can allow
exposing the same content under different domain names.
Garage also supports bucket aliases which are local to a single user:
this allows different users to have different buckets with the same name, thus avoiding naming collisions.
This can be helpfull for instance if you want to write an application that creates per-user buckets with always the same name.
This feature is totally invisible to S3 clients and does not break compatibility with AWS.
### Cluster administration API
Garage provides a fully-fledged REST API to administer your cluster programatically.
Functionality included in the admin API include: setting up and monitoring
cluster nodes, managing access credentials, and managing storage buckets and bucket aliases.
A full reference of the administration API is available [here](@/documentation/reference-manual/admin-api.md).
### Metrics and traces
Garage makes some internal metrics available in the Prometheus data format,
which allows you to build interactive dashboards to visualize the load and internal state of your storage cluster.
For developpers and performance-savvy administrators,
Garage also supports exporting traces of what it does internally in OpenTelemetry format.
This allows to monitor the time spent at various steps of the processing of requests,
in order to detect potential performance bottlenecks.
### Kubernetes and Nomad integrations
Garage can automatically discover other nodes in the cluster thanks to integration
with orchestrators such as Kubernetes and Nomad (when used with Consul).
This eases the configuration of your cluster as it removes one step where nodes need
to be manually connected to one another.
### Support for changing IP addresses
As long as all of your nodes don't change their IP address at the same time,
Garage should be able to tolerate nodes with changing/dynamic IP addresses,
as nodes will regularly exchange the IP addresses of their peers and try to
reconnect using newer addresses when existing connections are broken.
### K2V API (experimental)
As part of an ongoing research project, Garage can expose an experimental key/value storage API called K2V.
K2V is made for the storage and retrieval of many small key/value pairs that need to be processed in bulk.
This completes the S3 API with an alternative that can be used to easily store and access metadata
related to objects stored in an S3 bucket.
In the context of our research project, [Aérogramme](https://aerogramme.deuxfleurs.fr),
K2V is used to provide metadata and log storage for operations on encrypted e-mail storage.
Learn more on the specification of K2V [here](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/k2v/doc/drafts/k2v-spec.md)
and on how to enable it in Garage [here](@/documentation/reference-manual/k2v.md).

View File

@ -0,0 +1,58 @@
+++
title = "K2V"
weight = 100
+++
Starting with version 0.7.2, Garage introduces an optional feature, K2V,
which is an alternative storage API designed to help efficiently store
many small values in buckets (in opposition to S3 which is more designed
to store large blobs).
K2V is currently disabled at compile time in all builds, as the
specification is still subject to changes. To build a Garage version with
K2V, the Cargo feature flag `k2v` must be activated. Special builds with
the `k2v` feature flag enabled can be obtained from our download page under
"Extra builds": such builds can be identified easily as their tag name ends
with `-k2v` (example: `v0.7.2-k2v`).
The specification of the K2V API can be found
[here](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/doc/drafts/k2v-spec.md).
This document also includes a high-level overview of K2V's design.
The K2V API uses AWSv4 signatures for authentification, same as the S3 API.
The AWS region used for signature calculation is always the same as the one
defined for the S3 API in the config file.
## Enabling and using K2V
To enable K2V, download and run a build that has the `k2v` feature flag
enabled, or produce one yourself. Then, add the following section to your
configuration file:
```toml
[k2v_api]
api_bind_addr = "<ip>:<port>"
```
Please select a port number that is not already in use by another API
endpoint (S3 api, admin API) or by the RPC server.
We provide an early-stage K2V client library for Rust which can be imported by adding the following to your `Cargo.toml` file:
```toml
k2v-client = { git = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git" }
```
There is also a simple CLI utility which can be built from source in the
following way:
```sh
git clone https://git.deuxfleurs.fr/Deuxfleurs/garage.git
cd garage/src/k2v-client
cargo build --features cli --bin k2v-cli
```
The CLI utility is self-documented, run `k2v-cli --help` to learn how to use
it. There is also a short README.md in the `src/k2v-client` folder with some
instructions.

View File

@ -0,0 +1,402 @@
+++
title = "Monitoring"
weight = 60
+++
For information on setting up monitoring, see our [dedicated page](@/documentation/cookbook/monitoring.md) in the Cookbook section.
## List of exported metrics
### Garage system metrics
#### `garage_build_info` (counter)
Exposes the Garage version number running on a node.
```
garage_build_info{version="1.0"} 1
```
#### `garage_replication_factor` (counter)
Exposes the Garage replication factor configured on the node
```
garage_replication_factor 3
```
#### `garage_local_disk_avail` and `garage_local_disk_total` (gauge)
Reports the available and total disk space on each node, for data and metadata separately.
```
garage_local_disk_avail{volume="data"} 540341960704
garage_local_disk_avail{volume="metadata"} 540341960704
garage_local_disk_total{volume="data"} 763063566336
garage_local_disk_total{volume="metadata"} 763063566336
```
### Cluster health status metrics
#### `cluster_healthy` (gauge)
Whether all storage nodes are connected (0 or 1)
```
cluster_healthy 0
```
#### `cluster_available` (gauge)
Whether all requests can be served, even if some storage nodes are disconnected
```
cluster_available 1
```
#### `cluster_connected_nodes` (gauge)
Number of nodes currently connected
```
cluster_connected_nodes 3
```
#### `cluster_known_nodes` (gauge)
Number of nodes already seen once in the cluster
```
cluster_known_nodes 3
```
#### `cluster_layout_node_connected` (gauge)
Connection status for individual nodes of the cluster layout
```
cluster_layout_node_connected{id="62b218d848e86a64",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 1
cluster_layout_node_connected{id="a11c7cf18af29737",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 0
cluster_layout_node_connected{id="a235ac7695e0c54d",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 1
cluster_layout_node_connected{id="b10c110e4e854e5a",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 1
```
#### `cluster_layout_node_disconnected_time` (gauge)
Time (in seconds) since last connection to individual nodes of the cluster layout
```
cluster_layout_node_disconnected_time{id="62b218d848e86a64",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 0
cluster_layout_node_disconnected_time{id="a235ac7695e0c54d",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 0
cluster_layout_node_disconnected_time{id="b10c110e4e854e5a",role_capacity="1000000000",role_gateway="0",role_zone="dc1"} 0
```
#### `cluster_storage_nodes` (gauge)
Number of storage nodes declared in the current layout
```
cluster_storage_nodes 4
```
#### `cluster_storage_nodes_ok` (gauge)
Number of storage nodes currently connected
```
cluster_storage_nodes_ok 3
```
#### `cluster_partitions` (gauge)
Number of partitions in the layout (this is always 256)
```
cluster_partitions 256
```
#### `cluster_partitions_all_ok` (gauge)
Number of partitions for which all storage nodes are connected
```
cluster_partitions_all_ok 64
```
#### `cluster_partitions_quorum` (gauge)
Number of partitions for which we have a quorum of connected nodes and all requests can be served
```
cluster_partitions_quorum 256
```
### Metrics of the API endpoints
#### `api_admin_request_counter` (counter)
Counts the number of requests to a given endpoint of the administration API. Example:
```
api_admin_request_counter{api_endpoint="Metrics"} 127041
```
#### `api_admin_request_duration` (histogram)
Evaluates the duration of API calls to the various administration API endpoint. Example:
```
api_admin_request_duration_bucket{api_endpoint="Metrics",le="0.5"} 127041
api_admin_request_duration_sum{api_endpoint="Metrics"} 605.250344830999
api_admin_request_duration_count{api_endpoint="Metrics"} 127041
```
#### `api_s3_request_counter` (counter)
Counts the number of requests to a given endpoint of the S3 API. Example:
```
api_s3_request_counter{api_endpoint="CreateMultipartUpload"} 1
```
#### `api_s3_error_counter` (counter)
Counts the number of requests to a given endpoint of the S3 API that returned an error. Example:
```
api_s3_error_counter{api_endpoint="GetObject",status_code="404"} 39
```
#### `api_s3_request_duration` (histogram)
Evaluates the duration of API calls to the various S3 API endpoints. Example:
```
api_s3_request_duration_bucket{api_endpoint="CreateMultipartUpload",le="0.5"} 1
api_s3_request_duration_sum{api_endpoint="CreateMultipartUpload"} 0.046340762
api_s3_request_duration_count{api_endpoint="CreateMultipartUpload"} 1
```
#### `api_k2v_request_counter` (counter), `api_k2v_error_counter` (counter), `api_k2v_error_duration` (histogram)
Same as for S3, for the K2V API.
### Metrics of the Web endpoint
#### `web_request_counter` (counter)
Number of requests to the web endpoint
```
web_request_counter{method="GET"} 80
```
#### `web_request_duration` (histogram)
Duration of requests to the web endpoint
```
web_request_duration_bucket{method="GET",le="0.5"} 80
web_request_duration_sum{method="GET"} 1.0528433229999998
web_request_duration_count{method="GET"} 80
```
#### `web_error_counter` (counter)
Number of requests to the web endpoint resulting in errors
```
web_error_counter{method="GET",status_code="404 Not Found"} 64
```
### Metrics of the data block manager
#### `block_bytes_read`, `block_bytes_written` (counter)
Number of bytes read/written to/from disk in the data storage directory.
```
block_bytes_read 120586322022
block_bytes_written 3386618077
```
#### `block_ram_buffer_free_kb` (gauge)
Kibibytes available for buffering blocks that have to be sent to remote nodes.
When clients send too much data to this node and a storage node is not receiving
data fast enough due to slower network conditions, this will decrease down to
zero and backpressure will be applied.
```
block_ram_buffer_free_kb 219829
```
#### `block_compression_level` (counter)
Exposes the block compression level configured for the Garage node.
```
block_compression_level 3
```
#### `block_read_duration`, `block_write_duration` (histograms)
Evaluates the duration of the reading/writing of individual data blocks in the data storage directory.
```
block_read_duration_bucket{le="0.5"} 169229
block_read_duration_sum 2761.6902550310056
block_read_duration_count 169240
block_write_duration_bucket{le="0.5"} 3559
block_write_duration_sum 195.59170078500006
block_write_duration_count 3571
```
#### `block_delete_counter` (counter)
Counts the number of data blocks that have been deleted from storage.
```
block_delete_counter 122
```
#### `block_resync_counter` (counter), `block_resync_duration` (histogram)
Counts the number of resync operations the node has executed, and evaluates their duration.
```
block_resync_counter 308897
block_resync_duration_bucket{le="0.5"} 308892
block_resync_duration_sum 139.64204196100016
block_resync_duration_count 308897
```
#### `block_resync_queue_length` (gauge)
The number of block hashes currently queued for a resync.
This is normal to be nonzero for long periods of time.
```
block_resync_queue_length 0
```
#### `block_resync_errored_blocks` (gauge)
The number of block hashes that we were unable to resync last time we tried.
**THIS SHOULD BE ZERO, OR FALL BACK TO ZERO RAPIDLY, IN A HEALTHY CLUSTER.**
Persistent nonzero values indicate that some data is likely to be lost.
```
block_resync_errored_blocks 0
```
### Metrics related to RPCs (remote procedure calls) between nodes
#### `rpc_netapp_request_counter` (counter)
Number of RPC requests emitted
```
rpc_request_counter{from="<this node>",rpc_endpoint="garage_block/manager.rs/Rpc",to="<remote node>"} 176
```
#### `rpc_netapp_error_counter` (counter)
Number of communication errors (errors in the Netapp library, generally due to disconnected nodes)
```
rpc_netapp_error_counter{from="<this node>",rpc_endpoint="garage_block/manager.rs/Rpc",to="<remote node>"} 354
```
#### `rpc_timeout_counter` (counter)
Number of RPC timeouts, should be close to zero in a healthy cluster.
```
rpc_timeout_counter{from="<this node>",rpc_endpoint="garage_rpc/membership.rs/SystemRpc",to="<remote node>"} 1
```
#### `rpc_duration` (histogram)
The duration of internal RPC calls between Garage nodes.
```
rpc_duration_bucket{from="<this node>",rpc_endpoint="garage_block/manager.rs/Rpc",to="<remote node>",le="0.5"} 166
rpc_duration_sum{from="<this node>",rpc_endpoint="garage_block/manager.rs/Rpc",to="<remote node>"} 35.172253716
rpc_duration_count{from="<this node>",rpc_endpoint="garage_block/manager.rs/Rpc",to="<remote node>"} 174
```
### Metrics of the metadata table manager
#### `table_gc_todo_queue_length` (gauge)
Table garbage collector TODO queue length
```
table_gc_todo_queue_length{table_name="block_ref"} 0
```
#### `table_get_request_counter` (counter), `table_get_request_duration` (histogram)
Number of get/get_range requests internally made on each table, and their duration.
```
table_get_request_counter{table_name="bucket_alias"} 315
table_get_request_duration_bucket{table_name="bucket_alias",le="0.5"} 315
table_get_request_duration_sum{table_name="bucket_alias"} 0.048509778000000024
table_get_request_duration_count{table_name="bucket_alias"} 315
```
#### `table_put_request_counter` (counter), `table_put_request_duration` (histogram)
Number of insert/insert_many requests internally made on this table, and their duration
```
table_put_request_counter{table_name="block_ref"} 677
table_put_request_duration_bucket{table_name="block_ref",le="0.5"} 677
table_put_request_duration_sum{table_name="block_ref"} 61.617528636
table_put_request_duration_count{table_name="block_ref"} 677
```
#### `table_internal_delete_counter` (counter)
Number of value deletions in the tree (due to GC or repartitioning)
```
table_internal_delete_counter{table_name="block_ref"} 2296
```
#### `table_internal_update_counter` (counter)
Number of value updates where the value actually changes (includes creation of new key and update of existing key)
```
table_internal_update_counter{table_name="block_ref"} 5996
```
#### `table_merkle_updater_todo_queue_length` (gauge)
Merkle tree updater TODO queue length (should fall to zero rapidly)
```
table_merkle_updater_todo_queue_length{table_name="block_ref"} 0
```
#### `table_sync_items_received`, `table_sync_items_sent` (counters)
Number of data items sent to/recieved from other nodes during resync procedures
```
table_sync_items_received{from="<remote node>",table_name="bucket_v2"} 3
table_sync_items_sent{table_name="block_ref",to="<remote node>"} 2
```

View File

@ -0,0 +1,236 @@
+++
title = "S3 Compatibility status"
weight = 70
+++
## DISCLAIMER
**The compatibility list for other platforms is given only for informational
purposes and based on available documentation.** They are sometimes completed,
in a best effort approach, with the source code and inputs from maintainers
when documentation is lacking. We are not proactively monitoring new versions
of each software: check the modification history to know when the page has been
updated for the last time. Some entries will be inexact or outdated. For any
serious decision, you must make your own tests.
**The official documentation of each project can be accessed by clicking on the
project name in the column header.**
Feel free to open a PR to suggest fixes this table. Minio is missing because they do not provide a public S3 compatibility list.
## Update history
- 2022-02-07 - First version of this page
- 2022-05-25 - Many Ceph S3 endpoints are not documented but implemented. Following a notification from the Ceph community, we added them.
## High-level features
| Feature | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [signature v2](https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html) (deprecated) | ❌ Missing | ✅ | ✅ | ✅ | ✅ |
| [signature v4](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) | ✅ Implemented | ✅ | ✅ | ❌ | ✅ |
| [URL path-style](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access) (eg. `host.tld/bucket/key`) | ✅ Implemented | ✅ | ✅ | ❓| ✅ |
| [URL vhost-style](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#virtual-hosted-style-access) URL (eg. `bucket.host.tld/key`) | ✅ Implemented | ❌| ✅| ✅ | ✅ |
| [Presigned URLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html) | ✅ Implemented | ❌| ✅ | ✅ | ✅(❓) |
*Note:* OpenIO does not says if it supports presigned URLs. Because it is part
of signature v4 and they claim they support it without additional precisions,
we suppose that OpenIO supports presigned URLs.
## Endpoint implementation
All endpoints that are missing on Garage will return a 501 Not Implemented.
Some `x-amz-` headers are not implemented.
### Core endoints
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [DeleteBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [GetBucketLocation](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLocation.html) | ✅ Implemented | ✅ | ✅ | ❌ | ✅ |
| [HeadBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [ListBuckets](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) | ✅ Implemented | ❌| ✅ | ✅ | ✅ |
| [HeadObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [CopyObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [DeleteObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [DeleteObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [ListObjects](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) | ✅ Implemented (see details below) | ✅ | ✅ | ✅ | ❌|
| [ListObjectsV2](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) | ✅ Implemented | ❌| ✅ | ❌| ✅ |
| [PostObject](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) | ✅ Implemented | ❌| ✅ | ❌| ❌|
| [PutObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
**ListObjects:** Implemented, but there isn't a very good specification of what
`encoding-type=url` covers so there might be some encoding bugs. In our
implementation the url-encoded fields are in the same in ListObjects as they
are in ListObjectsV2.
*Note: Ceph API documentation is incomplete and lacks at least HeadBucket and UploadPartCopy,
but these endpoints are documented in [Red Hat Ceph Storage - Chapter 2. Ceph Object Gateway and the S3 API](https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/4/html/developer_guide/ceph-object-gateway-and-the-s3-api)*
### Multipart Upload endpoints
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [AbortMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [CompleteMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [CreateMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) | ✅ Implemented | ✅| ✅ | ✅ | ✅ |
| [ListMultipartUpload](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUpload.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [ListParts](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
| [UploadPart](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) | ✅ Implemented | ✅ | ✅| ✅ | ✅ |
| [UploadPartCopy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) | ✅ Implemented | ✅ | ✅ | ✅ | ✅ |
### Website endpoints
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [DeleteBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html) | ✅ Implemented | ❌| ❌| ❌| ❌|
| [GetBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) | ✅ Implemented | ❌ | ❌| ❌| ❌|
| [PutBucketWebsite](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) | ⚠ Partially implemented (see below)| ❌| ❌| ❌| ❌|
| [DeleteBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) | ✅ Implemented | ❌| ✅ | ❌| ✅ |
| [GetBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html) | ✅ Implemented | ❌ | ✅ | ❌| ✅ |
| [PutBucketCors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) | ✅ Implemented | ❌| ✅ | ❌| ✅ |
**PutBucketWebsite:** Implemented, but only stores the index document suffix and the error document path. Redirects are not supported.
*Note: Ceph radosgw has some support for static websites but it is different from the Amazon one. It also does not implement its configuration endpoints.*
### ACL, Policies endpoints
Amazon has 2 access control mechanisms in S3: ACL (legacy) and policies (new one).
Garage implements none of them, and has its own system instead, built around a per-access-key-per-bucket logic.
See Garage CLI reference manual to learn how to use Garage's permission system.
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [DeleteBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html) | ❌ Missing | ❌| ✅ | ✅ | ❌|
| [GetBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html) | ❌ Missing | ❌| ✅ | ⚠ | ❌|
| [GetBucketPolicyStatus](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html) | ❌ Missing | ❌| ✅ | ⚠ | ❌|
| [GetBucketAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html) | ❌ Missing | ✅ | ✅ | ✅ | ✅ |
| [PutBucketAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html) | ❌ Missing | ✅ | ✅ | ✅ | ✅ |
| [GetObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) | ❌ Missing | ✅ | ✅ | ✅ | ✅ |
| [PutObjectAcl](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html) | ❌ Missing | ✅ | ✅ | ✅ | ✅ |
*Notes:* Riak CS only supports a subset of the policy configuration.
### Versioning, Lifecycle endpoints
Garage does not (yet) support object versioning.
If you need this feature, please [share your use case in our dedicated issue](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/166).
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [DeleteBucketLifecycle](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) | ✅ Implemented | ❌| ✅| ❌| ✅|
| [GetBucketLifecycleConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) | ✅ Implemented | ❌| ✅ | ❌| ✅|
| [PutBucketLifecycleConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) | ⚠ Partially implemented (see below) | ❌| ✅ | ❌| ✅|
| [GetBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) | ❌ Stub (see below) | ✅| ✅ | ❌| ✅|
| [ListObjectVersions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html) | ❌ Missing | ❌| ✅ | ❌| ✅|
| [PutBucketVersioning](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html) | ❌ Missing | ❌| ✅| ❌| ✅|
**PutBucketLifecycleConfiguration:** The only actions supported are
`AbortIncompleteMultipartUpload` and `Expiration` (without the
`ExpiredObjectDeleteMarker` field). All other operations are dependent on
either bucket versionning or storage classes which Garage currently does not
implement. The deprecated `Prefix` member directly in the the `Rule`
structure/XML tag is not supported, specified prefixes must be inside the
`Filter` structure/XML tag.
**GetBucketVersioning:** Stub implementation which always returns "versionning not enabled", since Garage does not yet support bucket versionning.
### Replication endpoints
Please open an issue if you have a use case for replication.
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [DeleteBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [GetBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutBucketReplication](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) | ❌ Missing | ❌| ⚠ | ❌| ❌|
*Note: Ceph documentation briefly says that Ceph supports
[replication through the S3 API](https://docs.ceph.com/en/latest/radosgw/multisite-sync-policy/#s3-replication-api)
but with some limitations.
Additionaly, replication endpoints are not documented in the S3 compatibility page so I don't know what kind of support we can expect.*
### Locking objects
Amazon defines a concept of [object locking](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html) that can be achieved either through a Retention period or a Legal hold.
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [GetObjectLegalHold](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutObjectLegalHold](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLegalHold.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [GetObjectRetention](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutObjectRetention](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectRetention.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [GetObjectLockConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutObjectLockConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectLockConfiguration.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
### (Server-side) encryption
We think that you can either encrypt your server partition or do client-side encryption, so we did not implement server-side encryption for Garage.
Please open an issue if you have a use case.
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [DeleteBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [GetBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutBucketEncryption](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
### Misc endpoints
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [GetBucketNotificationConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [PutBucketNotificationConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotificationConfiguration.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
| [DeleteBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) | ❌ Missing | ❌| ✅ | ❌| ✅ |
| [GetBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) | ❌ Missing | ❌| ✅ | ❌| ✅ |
| [PutBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) | ❌ Missing | ❌| ✅ | ❌| ✅ |
| [DeleteObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) | ❌ Missing | ❌| ✅ | ❌| ✅ |
| [GetObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) | ❌ Missing | ❌| ✅ | ❌| ✅ |
| [PutObjectTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) | ❌ Missing | ❌| ✅ | ❌| ✅ |
| [GetObjectTorrent](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTorrent.html) | ❌ Missing | ❌| ✅ | ❌| ❌|
### Vendor specific endpoints
<details><summary>Display Amazon specifc endpoints</summary>
| Endpoint | Garage | [Openstack Swift](https://docs.openstack.org/swift/latest/s3_compat.html) | [Ceph Object Gateway](https://docs.ceph.com/en/latest/radosgw/s3/) | [Riak CS](https://docs.riak.com/riak/cs/2.1.1/references/apis/storage/s3/index.html) | [OpenIO](https://docs.openio.io/latest/source/arch-design/s3_compliancy.html) |
|------------------------------|----------------------------------|-----------------|---------------|---------|-----|
| [DeleteBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [DeleteBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [DeleteBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [DeleteBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [DeleteBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketOwnershipControls.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [DeletePublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketAccelerateConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketLogging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketOwnershipControls.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [GetPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [ListBucketAnalyticsConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [ListBucketIntelligentTieringConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [ListBucketInventoryConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [ListBucketMetricsConfigurations](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketAccelerateConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketAnalyticsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketIntelligentTieringConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketInventoryConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketLogging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketMetricsConfiguration](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketOwnershipControls](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketOwnershipControls.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutBucketRequestPayment](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketRequestPayment.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [PutPublicAccessBlock](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [RestoreObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) | ❌ Missing | ❌| ❌| ❌| ❌|
| [SelectObjectContent](https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html) | ❌ Missing | ❌| ❌| ❌| ❌|
</details>

View File

@ -1,41 +0,0 @@
# Summary
[The Garage Data Store](./intro.md)
- [Quick start](./quick_start/index.md)
- [Cookbook](./cookbook/index.md)
- [Building from source](./cookbook/from_source.md)
- [Integration with systemd](./cookbook/systemd.md)
- [Gateways](./cookbook/gateways.md)
- [Exposing buckets as websites](./cookbook/exposing_websites.md)
- [Configuring a reverse proxy](./cookbook/reverse_proxy.md)
- [Production Deployment](./cookbook/real_world.md)
- [Recovering from failures](./cookbook/recovering.md)
- [Integrations](./connect/index.md)
- [Apps (Nextcloud, Peertube...)](./connect/apps.md)
- [Websites (Hugo, Jekyll, Publii...)](./connect/websites.md)
- [Repositories (Docker, Nix...)](./connect/repositories.md)
- [CLI tools (rclone, awscli, mc...)](./connect/cli.md)
- [Your code (PHP, JS, Go...)](./connect/code.md)
- [Reference Manual](./reference_manual/index.md)
- [Garage configuration file](./reference_manual/configuration.md)
- [Garage CLI](./reference_manual/cli.md)
- [S3 compatibility status](./reference_manual/s3_compatibility.md)
- [Design](./design/index.md)
- [Related Work](./design/related_work.md)
- [Internals](./design/internals.md)
- [Design draft](./design/design_draft.md)
- [Development](./development/index.md)
- [Setup your environment](./development/devenv.md)
- [Development scripts](./development/scripts.md)
- [Release process](./development/release_process.md)
- [Working Documents](./working_documents/index.md)
- [Load Balancing Data](./working_documents/load_balancing.md)
- [Migrating from 0.3 to 0.4](./working_documents/migration_04.md)

View File

@ -1,461 +0,0 @@
# Apps (Nextcloud, Peertube...)
In this section, we cover the following software: [Nextcloud](#nextcloud), [Peertube](#peertube), [Mastodon](#mastodon), [Matrix](#matrix)
## Nextcloud
Nextcloud is a popular file synchronisation and backup service.
By default, Nextcloud stores its data on the local filesystem.
If you want to expand your storage to aggregate multiple servers, Garage is the way to go.
A S3 backend can be configured in two ways on Nextcloud, either as Primary Storage or as an External Storage.
Primary storage will store all your data on S3, in an opaque manner, and will provide the best performances.
External storage enable you to select which data will be stored on S3, your file hierarchy will be preserved in S3, but it might be slower.
In the following, we cover both methods but before reading our guide, we suppose you have done some preliminary steps.
First, we expect you have an already installed and configured Nextcloud instance.
Second, we suppose you have created a key and a bucket.
As a reminder, you can create a key for your nextcloud instance as follow:
```bash
garage key new --name nextcloud-key
```
Keep the Key ID and the Secret key in a pad, they will be needed later.
Then you can create a bucket and give read/write rights to your key on this bucket with:
```bash
garage bucket create nextcloud
garage bucket allow nextcloud --read --write --key nextcloud-key
```
### Primary Storage
Now edit your Nextcloud configuration file to enable object storage.
On my installation, the config. file is located at the following path: `/var/www/nextcloud/config/config.php`.
We will add a new root key to the `$CONFIG` dictionnary named `objectstore`:
```php
<?php
$CONFIG = array(
/* your existing configuration */
'objectstore' => [
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => [
'bucket' => 'nextcloud', // Your bucket name, must be created before
'autocreate' => false, // Garage does not support autocreate
'key' => 'xxxxxxxxx', // The Key ID generated previously
'secret' => 'xxxxxxxxx', // The Secret key generated previously
'hostname' => '127.0.0.1', // Can also be a domain name, eg. garage.example.com
'port' => 3900, // Put your reverse proxy port or your S3 API port
'use_ssl' => false, // Set it to true if you have a TLS enabled reverse proxy
'region' => 'garage', // Garage has only one region named "garage"
'use_path_style' => true // Garage supports only path style, must be set to true
],
],
```
That's all, your Nextcloud will store all your data to S3.
To test your new configuration, just reload your Nextcloud webpage and start sending data.
*External link:* [Nextcloud Documentation > Primary Storage](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html)
### External Storage
**From the GUI.** Activate the "External storage support" app from the "Applications" page (click on your account icon on the top right corner of your screen to display the menu). Go to your parameters page (also located below your account icon). Click on external storage (or the corresponding translation in your language).
[![Screenshot of the External Storage form](./cli-nextcloud-gui.png)](./cli-nextcloud-gui.png)
*Click on the picture to zoom*
Add a new external storage. Put what you want in "folder name" (eg. "shared"). Select "Amazon S3". Keep "Access Key" for the Authentication field.
In Configuration, put your bucket name (eg. nextcloud), the host (eg. 127.0.0.1), the port (eg. 3900 or 443), the region (garage). Tick the SSL box if you have put an HTTPS proxy in front of garage. You must tick the "Path access" box and you must leave the "Legacy authentication (v2)" box empty. Put your Key ID (eg. GK...) and your Secret Key in the last two input boxes. Finally click on the tick symbol on the right of your screen.
Now go to your "Files" app and a new "linked folder" has appeared with the name you chose earlier (eg. "shared").
*External link:* [Nextcloud Documentation > External Storage Configuration GUI](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html)
**From the CLI.** First install the external storage application:
```bash
php occ app:install files_external
```
Then add a new mount point with:
```bash
php occ files_external:create \
-c bucket=nextcloud \
-c hostname=127.0.0.1 \
-c port=3900 \
-c region=garage \
-c use_ssl=false \
-c use_path_style=true \
-c legacy_auth=false \
-c key=GKxxxx \
-c secret=xxxx \
shared amazons3 amazons3::accesskey
```
Adapt the `hostname`, `port`, `use_ssl`, `key`, and `secret` entries to your configuration.
Do not change the `use_path_style` and `legacy_auth` entries, other configurations are not supported.
*External link:* [Nextcloud Documentation > occ command > files external](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#files-external-label)
## Peertube
Peertube proposes a clever integration of S3 by directly exposing its endpoint instead of proxifying requests through the application.
In other words, Peertube is only responsible of the "control plane" and offload the "data plane" to Garage.
In return, this system is a bit harder to configure, especially with Garage that supports less feature than other older S3 backends.
We show that it is still possible to configure Garage with Peertube, allowing you to spread the load and the bandiwdth usage on the Garage cluster.
### Enable path-style access by patching Peertube
First, you will need to apply a small patch on Peertube ([#4510](https://github.com/Chocobozzz/PeerTube/pull/4510)):
```diff
From e3b4c641bdf67e07d406a1d49d6aa6b1fbce2ab4 Mon Sep 17 00:00:00 2001
From: Martin Honermeyer <maze@strahlungsfrei.de>
Date: Sun, 31 Oct 2021 12:34:04 +0100
Subject: [PATCH] Allow setting path-style access for object storage
---
config/default.yaml | 4 ++++
config/production.yaml.example | 4 ++++
server/initializers/config.ts | 1 +
server/lib/object-storage/shared/client.ts | 3 ++-
.../production/config/custom-environment-variables.yaml | 2 ++
5 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/config/default.yaml b/config/default.yaml
index cf9d69a6211..4efd56fb804 100644
--- a/config/default.yaml
+++ b/config/default.yaml
@@ -123,6 +123,10 @@ object_storage:
# You can also use AWS_SECRET_ACCESS_KEY env variable
secret_access_key: ''
+ # Reference buckets via path rather than subdomain
+ # (i.e. "my-endpoint.com/bucket" instead of "bucket.my-endpoint.com")
+ force_path_style: false
+
# Maximum amount to upload in one request to object storage
max_upload_part: 2GB
diff --git a/config/production.yaml.example b/config/production.yaml.example
index 70993bf57a3..9ca2de5f4c9 100644
--- a/config/production.yaml.example
+++ b/config/production.yaml.example
@@ -121,6 +121,10 @@ object_storage:
# You can also use AWS_SECRET_ACCESS_KEY env variable
secret_access_key: ''
+ # Reference buckets via path rather than subdomain
+ # (i.e. "my-endpoint.com/bucket" instead of "bucket.my-endpoint.com")
+ force_path_style: false
+
# Maximum amount to upload in one request to object storage
max_upload_part: 2GB
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 8375bf4304c..d726c59a4b6 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -91,6 +91,7 @@ const CONFIG = {
ACCESS_KEY_ID: config.get<string>('object_storage.credentials.access_key_id'),
SECRET_ACCESS_KEY: config.get<string>('object_storage.credentials.secret_access_key')
},
+ FORCE_PATH_STYLE: config.get<boolean>('object_storage.force_path_style'),
VIDEOS: {
BUCKET_NAME: config.get<string>('object_storage.videos.bucket_name'),
PREFIX: config.get<string>('object_storage.videos.prefix'),
diff --git a/server/lib/object-storage/shared/client.ts b/server/lib/object-storage/shared/client.ts
index c9a61459336..eadad02f93f 100644
--- a/server/lib/object-storage/shared/client.ts
+++ b/server/lib/object-storage/shared/client.ts
@@ -26,7 +26,8 @@ function getClient () {
accessKeyId: OBJECT_STORAGE.CREDENTIALS.ACCESS_KEY_ID,
secretAccessKey: OBJECT_STORAGE.CREDENTIALS.SECRET_ACCESS_KEY
}
- : undefined
+ : undefined,
+ forcePathStyle: CONFIG.OBJECT_STORAGE.FORCE_PATH_STYLE
})
logger.info('Initialized S3 client %s with region %s.', getEndpoint(), OBJECT_STORAGE.REGION, lTags())
diff --git a/support/docker/production/config/custom-environment-variables.yaml b/support/docker/production/config/custom-environment-variables.yaml
index c7cd28e6521..a960bab0bc9 100644
--- a/support/docker/production/config/custom-environment-variables.yaml
+++ b/support/docker/production/config/custom-environment-variables.yaml
@@ -54,6 +54,8 @@ object_storage:
region: "PEERTUBE_OBJECT_STORAGE_REGION"
+ force_path_style: "PEERTUBE_OBJECT_STORAGE_FORCE_PATH_STYLE"
+
max_upload_part:
__name: "PEERTUBE_OBJECT_STORAGE_MAX_UPLOAD_PART"
__format: "json"
```
You can then recompile it with:
```
npm run build
```
And it can be started with:
```
NODE_ENV=production NODE_CONFIG_DIR=/srv/peertube/config node dist/server.js
```
### Create resources in Garage
Create a key for Peertube:
```bash
garage key new --name peertube-key
```
Keep the Key ID and the Secret key in a pad, they will be needed later.
We need two buckets, one for normal videos (named peertube-video) and one for webtorrent videos (named peertube-playlist).
```bash
garage bucket create peertube-video
garage bucket create peertube-playlist
```
Now we allow our key to read and write on these buckets:
```
garage bucket allow peertube-playlist --read --write --key peertube-key
garage bucket allow peertube-video --read --write --key peertube-key
```
Finally, we need to expose these buckets publicly to serve their content to users:
```bash
garage bucket website --allow peertube-playlist
garage bucket website --allow peertube-video
```
These buckets are now accessible on the web port (by default 3902) with the following URL: `http://<bucket><root_domain>:<web_port>` where the root domain is defined in your configuration file (by default `.web.garage`). So we have currently the following URLs:
* http://peertube-playlist.web.garage:3902
* http://peertube-video.web.garage:3902
Make sure you (will) have a corresponding DNS entry for them.
### Configure a Reverse Proxy to serve CORS
Now we will configure a reverse proxy in front of Garage.
This is required as we have no other way to serve CORS headers yet.
Check the [Configuring a reverse proxy](/cookbook/reverse_proxy.html) section to know how.
Now make sure that your 2 dns entries are pointing to your reverse proxy.
### Configure Peertube
You must edit the file named `config/production.yaml`, we are only modifying the root key named `object_storage`:
```yaml
object_storage:
enabled: true
# Put localhost only if you have a garage instance running on that node
endpoint: 'http://localhost:3900' # or "garage.example.com" if you have TLS on port 443
# This entry has been added by our patch, must be set to true
force_path_style: true
# Garage supports only one region for now, named garage
region: 'garage'
credentials:
access_key_id: 'GKxxxx'
secret_access_key: 'xxxx'
max_upload_part: 2GB
streaming_playlists:
bucket_name: 'peertube-playlist'
# Keep it empty for our example
prefix: ''
# You must fill this field to make Peertube use our reverse proxy/website logic
base_url: 'http://peertube-playlist.web.garage' # Example: 'https://mirror.example.com'
# Same settings but for webtorrent videos
videos:
bucket_name: 'peertube-video'
prefix: ''
# You must fill this field to make Peertube use our reverse proxy/website logic
base_url: 'http://peertube-video.web.garage'
```
### That's all
Everything must be configured now, simply restart Peertube and try to upload a video.
You must see in your browser console that data are fetched directly from our bucket (through the reverse proxy).
### Miscellaneous
*Known bug:* The playback does not start and some 400 Bad Request Errors appear in your browser console and on Garage.
If the description of the error contains HTTP Invalid Range: InvalidRange, the error is due to a buggy ffmpeg version.
You must avoid the 4.4.0 and use either a newer or older version.
*Associated issues:* [#137](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/137), [#138](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/138), [#140](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/140). These issues are non blocking.
*External link:* [Peertube Documentation > Remote Storage](https://docs.joinpeertube.org/admin-remote-storage)
## Mastodon
https://docs.joinmastodon.org/admin/config/#cdn
## Matrix
Matrix is a chat communication protocol. Its main stable server implementation, [Synapse](https://matrix-org.github.io/synapse/latest/), provides a module to store media on a S3 backend. Additionally, a server independent media store supporting S3 has been developped by the community, it has been made possible thanks to how the matrix API has been designed and will work with implementations like Conduit, Dendrite, etc.
### synapse-s3-storage-provider (synapse only)
Supposing you have a working synapse installation, you can add the module with pip:
```bash
pip3 install --user git+https://github.com/matrix-org/synapse-s3-storage-provider.git
```
Now create a bucket and a key for your matrix instance (note your Key ID and Secret Key somewhere, they will be needed later):
```bash
garage key new --name matrix-key
garage bucket create matrix
garage bucket allow matrix --read --write --key matrix-key
```
Then you must edit your server configuration (eg. `/etc/matrix-synapse/homeserver.yaml`) and add the `media_storage_providers` root key:
```yaml
media_storage_providers:
- module: s3_storage_provider.S3StorageProviderBackend
store_local: True # do we want to store on S3 media created by our users?
store_remote: True # do we want to store on S3 media created
# by users of others servers federated to ours?
store_synchronous: True # do we want to wait that the file has been written before returning?
config:
bucket: matrix # the name of our bucket, we chose matrix earlier
region_name: garage # only "garage" is supported for the region field
endpoint_url: http://localhost:3900 # the path to the S3 endpoint
access_key_id: "GKxxx" # your Key ID
secret_access_key: "xxxx" # your Secret Key
```
Note that uploaded media will also be stored locally and this behavior can not be deactivated, it is even required for
some operations like resizing images.
In fact, your local filesysem is considered as a cache but without any automated way to garbage collect it.
We can build our garbage collector with `s3_media_upload`, a tool provided with the module.
If you installed the module with the command provided before, you should be able to bring it in your path:
```
PATH=$HOME/.local/bin/:$PATH
command -v s3_media_upload
```
Now we can write a simple script (eg `~/.local/bin/matrix-cache-gc`):
```bash
#!/bin/bash
## CONFIGURATION ##
AWS_ACCESS_KEY_ID=GKxxx
AWS_SECRET_ACCESS_KEY=xxxx
S3_ENDPOINT=http://localhost:3900
S3_BUCKET=matrix
MEDIA_STORE=/var/lib/matrix-synapse/media
PG_USER=matrix
PG_PASS=xxxx
PG_DB=synapse
PG_HOST=localhost
PG_PORT=5432
## CODE ##
PATH=$HOME/.local/bin/:$PATH
cat > database.yaml <<EOF
user: $PG_USER
password: $PG_PASS
database: $PG_DB
host: $PG_HOST
port: $PG_PORT
EOF
s3_media_upload update-db 1d
s3_media_upload --no-progress check-deleted $MEDIA_STORE
s3_media_upload --no-progress upload $MEDIA_STORE $S3_BUCKET --delete --endpoint-url $S3_ENDPOINT
```
This script will list all the medias that were not accessed in the 24 hours according to your database.
It will check if, in this list, the file still exists in the local media store.
For files that are still in the cache, it will upload them to S3 if they are not already present (in case of a crash or an initial synchronisation).
Finally, the script will delete these files from the cache.
Make this script executable and check that it works:
```bash
chmod +x $HOME/.local/bin/matrix-cache-gc
matrix-cache-gc
```
Add it to your crontab. Open the editor with:
```bash
crontab -e
```
And add a new line. For example, to run it every 10 minutes:
```cron
*/10 * * * * $HOME/.local/bin/matrix-cache-gc
```
*External link:* [Github > matrix-org/synapse-s3-storage-provider](https://github.com/matrix-org/synapse-s3-storage-provider)
### matrix-media-repo (server independent)
*External link:* [matrix-media-repo Documentation > S3](https://docs.t2bot.io/matrix-media-repo/configuration/s3-datastore.html)
## Pixelfed
https://docs.pixelfed.org/technical-documentation/env.html#filesystem
## Pleroma
https://docs-develop.pleroma.social/backend/configuration/cheatsheet/#pleromauploaderss3
## Lemmy
via pict-rs
https://git.asonix.dog/asonix/pict-rs/commit/f9f4fc63d670f357c93f24147c2ee3e1278e2d97
## Funkwhale
https://docs.funkwhale.audio/admin/configuration.html#s3-storage
## Misskey
https://github.com/misskey-dev/misskey/commit/9d944243a3a59e8880a360cbfe30fd5a3ec8d52d
## Prismo
https://gitlab.com/prismosuite/prismo/-/blob/dev/.env.production.sample#L26-33
## Owncloud Infinite Scale (ocis)
## Unsupported
- Mobilizon: No S3 integration
- WriteFreely: No S3 integration
- Plume: No S3 integration

View File

@ -1,127 +0,0 @@
# CLI tools
CLI tools allow you to query the S3 API without too many abstractions.
These tools are particularly suitable for debug, backups, website deployments or any scripted task that need to handle data.
## Minio client (recommended)
Use the following command to set an "alias", i.e. define a new S3 server to be
used by the Minio client:
```bash
mc alias set \
garage \
<endpoint> \
<access key> \
<secret key> \
--api S3v4
```
Remember that `mc` is sometimes called `mcli` (such as on Arch Linux), to avoid conflicts
with Midnight Commander.
Some commands:
```bash
# list buckets
mc ls garage/
# list objets in a bucket
mc ls garage/my_files
# copy from your filesystem to garage
mc cp /proc/cpuinfo garage/my_files/cpuinfo.txt
# copy from garage to your filesystem
mc cp garage/my_files/cpuinfo.txt /tmp/cpuinfo.txt
# mirror a folder from your filesystem to garage
mc mirror --overwrite ./book garage/garagehq.deuxfleurs.fr
```
## AWS CLI
Create a file named `~/.aws/credentials` and put:
```toml
[default]
aws_access_key_id=xxxx
aws_secret_access_key=xxxx
```
Then a file named `~/.aws/config` and put:
```toml
[default]
region=garage
```
Now, supposing Garage is listening on `http://127.0.0.1:3900`, you can list your buckets with:
```bash
aws --endpoint-url http://127.0.0.1:3900 s3 ls
```
Passing the `--endpoint-url` parameter to each command is annoying but AWS developers do not provide a corresponding configuration entry.
As a workaround, you can redefine the aws command by editing the file `~/.bashrc`:
```
function aws { command aws --endpoint-url http://127.0.0.1:3900 $@ ; }
```
*Do not forget to run `source ~/.bashrc` or to start a new terminal before running the next commands.*
Now you can simply run:
```bash
# list buckets
aws s3 ls
# list objects of a bucket
aws s3 ls s3://my_files
# copy from your filesystem to garage
aws s3 cp /proc/cpuinfo s3://my_files/cpuinfo.txt
# copy from garage to your filesystem
aws s3 cp s3/my_files/cpuinfo.txt /tmp/cpuinfo.txt
```
## `rclone`
`rclone` can be configured using the interactive assistant invoked using `rclone configure`.
You can also configure `rclone` by writing directly its configuration file.
Here is a template `rclone.ini` configuration file:
```ini
[garage]
type = s3
provider = Other
env_auth = false
access_key_id = <access key>
secret_access_key = <secret key>
region = <region>
endpoint = <endpoint>
force_path_style = true
acl = private
bucket_acl = private
```
## Cyberduck
TODO
## `s3cmd`
Here is a template for the `s3cmd.cfg` file to talk with Garage:
```ini
[default]
access_key = <access key>
secret_key = <secret key>
host_base = <endpoint without http(s)://>
host_bucket = <same as host_base>
use_https = False | True
```

View File

@ -1 +0,0 @@
# Your code (PHP, JS, Go...)

View File

@ -1 +0,0 @@
# Repositories (Docker, Nix...)

View File

@ -1,77 +0,0 @@
# Websites (Hugo, Jekyll, Publii...)
Garage is also suitable to host static websites.
While they can be deployed with traditional CLI tools, some static website generators have integrated options to ease your workflow.
## Hugo
Add to your `config.toml` the following section:
```toml
[[deployment.targets]]
URL = "s3://<bucket>?endpoint=<endpoint>&disableSSL=<bool>&s3ForcePathStyle=true&region=garage"
```
For example:
```toml
[[deployment.targets]]
URL = "s3://my-blog?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true&region=garage"
```
Then inform hugo of your credentials:
```bash
export AWS_ACCESS_KEY_ID=GKxxx
export AWS_SECRET_ACCESS_KEY=xxx
```
And finally deploy your website:
```bsh
hugo deploy
```
*External links:*
- [gocloud.dev > aws > Supported URL parameters](https://pkg.go.dev/gocloud.dev/aws?utm_source=godoc#ConfigFromURLParams)
- [Hugo Documentation > hugo deploy](https://gohugo.io/hosting-and-deployment/hugo-deploy/)
## Publii
It would require a patch either on Garage or on Publii to make both systems work.
Currently, the proposed workaround is to deploy your website manually:
- On the left menu, click on Server, choose Manual Deployment (the logo looks like a compressed file)
- Set your website URL, keep Output type as "Non-compressed catalog"
- Click on Save changes
- Click on Sync your website (bottom left of the app)
- On the new page, click again on Sync your website
- Click on Get website files
- You need to synchronize the output folder you see in your file explorer, we will use minio client.
Be sure that you [configured minio client](cli.html#minio-client-recommended).
Then copy this output folder
```bash
mc mirror --overwrite output garage/my-site
```
## Generic (eg. Jekyll)
Some tools do not support sending to a S3 backend but output a compiled folder on your system.
We can then use any CLI tool to upload this content to our S3 target.
First, start by [configuring minio client](cli.html#minio-client-recommended).
Then build your website:
```bash
jekyll build
```
And copy jekyll's output folder on S3:
```bash
mc mirror --overwrite _site garage/my-site
```

View File

@ -1,48 +0,0 @@
# Exposing buckets as websites
You can expose your bucket as a website with this simple command:
```bash
garage bucket website --allow my-website
```
Now it will be **publicly** exposed on the web endpoint (by default listening on port 3902).
Our website serving logic is as follow:
- Supports only static websites (no support for PHP or other languages)
- Does not support directory listing
- The index is defined in your `garage.toml`. ([ref](/reference_manual/configuration.html#index))
Now we need to infer the URL of your website through your bucket name.
Let assume:
- we set `root_domain = ".web.example.com"` in `garage.toml` ([ref](/reference_manual/configuration.html#root_domain))
- our bucket name is `garagehq.deuxfleurs.fr`.
Our bucket will be served if the Host field matches one of these 2 values (the port is ignored):
- `garagehq.deuxfleurs.fr.web.example.com`: you can dedicate a subdomain to your users (here `web.example.com`).
- `garagehq.deuxfleurs.fr`: your users can bring their own domain name, they just need to point them to your Garage cluster.
You can try this logic locally, without configuring any DNS, thanks to `curl`:
```bash
# prepare your test
echo hello world > /tmp/index.html
mc cp /tmp/index.html garage/garagehq.deuxfleurs.fr
curl -H 'Host: garagehq.deuxfleurs.fr' http://localhost:3902
# should print "hello world"
curl -H 'Host: garagehq.deuxfleurs.fr.web.example.com' http://localhost:3902
# should also print "hello world"
```
Now that you understand how website logic works on Garage, you can:
- make the website endpoint listens on port 80 (instead of 3902)
- use iptables to redirect the port 80 to the port 3902:
`iptables -t nat -A PREROUTING -p tcp -dport 80 -j REDIRECT -to-port 3902`
- or configure a [reverse proxy](reverse_proxy.html) in front of Garage to add TLS (HTTPS), CORS support, etc.
You can also take a look at [Website Integration](/connect/websites.html) to see how you can add Garage to your workflow.

View File

@ -1,51 +0,0 @@
# Compiling Garage from source
Garage is a standard Rust project.
First, you need `rust` and `cargo`.
For instance on Debian:
```bash
sudo apt-get update
sudo apt-get install -y rustc cargo
```
You can also use [Rustup](https://rustup.rs/) to setup a Rust toolchain easily.
## Using source from `crates.io`
Garage's source code is published on `crates.io`, Rust's official package repository.
This means you can simply ask `cargo` to download and build this source code for you:
```bash
cargo install garage
```
That's all, `garage` should be in `$HOME/.cargo/bin`.
You can add this folder to your `$PATH` or copy the binary somewhere else on your system.
For instance:
```bash
sudo cp $HOME/.cargo/bin/garage /usr/local/bin/garage
```
## Using source from the Gitea repository
The primary location for Garage's source code is the
[Gitea repository](https://git.deuxfleurs.fr/Deuxfleurs/garage).
Clone the repository and build Garage with the following commands:
```bash
git clone https://git.deuxfleurs.fr/Deuxfleurs/garage.git
cd garage
cargo build
```
Be careful, as this will make a debug build of Garage, which will be extremely slow!
To make a release build, invoke `cargo build --release` (this takes much longer).
The binaries built this way are found in `target/{debug,release}/garage`.

View File

@ -1,31 +0,0 @@
# Gateways
Gateways allow you to expose Garage endpoints (S3 API and websites) without storing data on the node.
## Benefits
You can configure Garage as a gateway on all nodes that will consume your S3 API, it will provide you the following benefits:
- **It removes 1 or 2 network RTT** Instead of (querying your reverse proxy then) querying a random node of the cluster that will forward your request to the nodes effectively storing the data, your local gateway will directly knows which node to query.
- **It ease server management** Instead of tracking in your reverse proxy and DNS what are the current Garage nodes, your gateway being part of the cluster keeps this information for you. In your software, you will always specify `http://localhost:3900`.
- **It simplifies security** Instead of having to maintain and renew a TLS certificate, you leverage the Secret Handshake protocol we use for our cluster. The S3 API protocol will be in plain text but limited to your local machine.
## Limitations
Currently it will not work with minio client. Follow issue [#64](https://git.deuxfleurs.fr/Deuxfleurs/garage/issues/64) for more information.
## Spawn a Gateway
The instructions are similar to a regular node, the only option that is different is while configuring the node, you must set the `--gateway` parameter:
```bash
garage node configure --gateway --tag gw1 xxxx
```
Then use `http://localhost:3900` when a S3 endpoint is required:
```bash
aws --endpoint-url http://127.0.0.1:3900 s3 ls
```

Some files were not shown because too many files have changed in this diff Show More