feat: add configurable default ETag for files without metadata

When versitygw serves files that were placed on the filesystem outside
of the gateway, those files have no stored etag attribute and are
served with an empty ETag. This causes problems for S3 clients that
rely on ETags being non empty.

The new --default-etag flag (VGW_DEFAULT_ETAG) lets operators specify
a fallback ETag value returned for any object that lacks a stored etag
attribute, making pre-existing filesystem data behave more predictably
under S3 workloads without requiring a metadata migration.
This commit is contained in:
Ben McClelland
2026-07-02 18:09:27 -07:00
parent 6b2380853f
commit 9db2c9c702
6 changed files with 62 additions and 10 deletions
+20
View File
@@ -572,6 +572,16 @@ ROOT_SECRET_ACCESS_KEY=
# than O_TMPFILE when the data needs to be copied into the final location.
#VGW_DISABLE_OTMP=false
# The VGW_DEFAULT_ETAG option sets the ETag value returned for objects that do
# not have a stored etag attribute. This applies to files that were placed on
# the filesystem outside of versitygw and therefore lack S3 metadata. Some S3
# clients assume a plain ETag is an MD5 checksum unless it contains a "-", as
# multipart upload ETags use the format <hash>-<parts>. To avoid clients
# incorrectly treating this default value as an MD5 checksum, prefer a value
# that includes a "-" and is not just 32 hex characters, for example:
# unknown-1. When not set, such objects are served with an empty ETag.
#VGW_DEFAULT_ETAG=
###########
# scoutfs #
###########
@@ -633,6 +643,16 @@ ROOT_SECRET_ACCESS_KEY=
# VGW_DISABLE_NOARCHIVE option can be set to true to disable this behavior.
#VGW_DISABLE_NOARCHIVE=false
# The VGW_DEFAULT_ETAG option sets the ETag value returned for objects that do
# not have a stored etag attribute. This applies to files that were placed on
# the filesystem outside of versitygw and therefore lack S3 metadata. Some S3
# clients assume a plain ETag is an MD5 checksum unless it contains a "-", as
# multipart upload ETags use the format <hash>-<parts>. To avoid clients
# incorrectly treating this default value as an MD5 checksum, prefer a value
# that includes a "-" and is not just 32 hex characters, for example:
# unknown-1. When not set, such objects are served with an empty ETag.
#VGW_DEFAULT_ETAG=
######
# s3 #
######