mirror of
https://github.com/versity/versitygw.git
synced 2026-09-25 09:24:22 +00:00
feat: add configurable file permissions for new objects
Replace the hardcoded 0644 defaultFilePerm with a NewFilePerm option on the posix and scoutfs backends, exposed as the --file-perms flag and VGW_FILE_PERMS env var alongside the existing dir-perms option. The mode passed to open() is masked by the process umask, so the O_TMPFILE path now chmods explicitly to match the CreateTemp fallback path and give new objects the configured mode regardless of umask.
This commit is contained in:
@@ -596,6 +596,13 @@ ROOT_SECRET_ACCESS_KEY=
|
||||
# as any parent directories automatically created with object uploads.
|
||||
#VGW_DIR_PERMS=0755
|
||||
|
||||
# The default permissions mode when creating new object files is 0644. Use
|
||||
# VGW_FILE_PERMS option to set a different mode for any new file that the
|
||||
# gateway creates for an uploaded object. Only permission bits (0000-0777) are
|
||||
# accepted. Unlike VGW_DIR_PERMS, this mode is applied explicitly and is not
|
||||
# reduced by the process umask.
|
||||
#VGW_FILE_PERMS=0644
|
||||
|
||||
# To enable object versions, the VGW_VERSIONING_DIR option must be set to the
|
||||
# directory that will be used to store the object versions. The version
|
||||
# directory must NOT be a subdirectory of the VGW_BACKEND_ARG directory.
|
||||
@@ -722,6 +729,13 @@ ROOT_SECRET_ACCESS_KEY=
|
||||
# as any parent directories automatically created with object uploads.
|
||||
#VGW_DIR_PERMS=0755
|
||||
|
||||
# The default permissions mode when creating new object files is 0644. Use
|
||||
# VGW_FILE_PERMS option to set a different mode for any new file that the
|
||||
# gateway creates for an uploaded object. Only permission bits (0000-0777) are
|
||||
# accepted. Unlike VGW_DIR_PERMS, this mode is applied explicitly and is not
|
||||
# reduced by the process umask.
|
||||
#VGW_FILE_PERMS=0644
|
||||
|
||||
# To enable object versions, the VGW_VERSIONING_DIR option must be set to the
|
||||
# directory that will be used to store the object versions. The version
|
||||
# directory must NOT be a subdirectory of the VGW_BACKEND_ARG directory.
|
||||
|
||||
Reference in New Issue
Block a user