Skip to content
FreeCORE

From 15.2, FreeCORE adds an S3 service built on versitygw. It serves datasets as buckets to S3 clients such as the AWS CLI, rclone, restic and s3cmd. A bucket is a whole dataset, so S3 clients and SMB or NFS see the same files.

It is not the MinIO-based S3 service of TrueNAS® CORE 13.0 and does not reuse that service’s configuration. See Deprecated and Removed Features.

  • Create a dataset for each bucket. A bucket cannot be a pool’s root dataset or a dataset FreeCORE uses itself, and buckets cannot nest.
  • The dataset uses NFSv4 ACLs. Saving a bucket adds one ACL entry for the S3 service.
  • Keep Snapshot Directory set to Invisible on the dataset and on every dataset inside it. S3 cannot list a bucket that shows a snapshot directory, so such a dataset cannot be used as a bucket.
  • To serve S3 over HTTPS, create or import a certificate under System › Certificates.

Go to Services, find S3, and click the Configure icon to open S3 Settings.

  1. Leave Bind IP Addresses empty to listen on every address, or select the static addresses to listen on.
  2. Set Port. The default is 9000.
  3. Select a Certificate to enable HTTPS. Without one, the service speaks plain HTTP.
  4. Set Region to the region your clients sign their requests for. The default, us-east-1, suits most clients.
  5. Click Save.
S3 service settings with the access key and bucket lists linked
FIG 1 S3 Settings

Click Access Keys in S3 Settings, then add a key.

Form for adding an S3 access key with the key fields empty
FIG 2 Access Key Form
  1. Leave Access Key and Secret Key empty to generate them, or enter your own. The access key cannot be changed later.
  2. Enter a Description of who or what uses the key.
  3. Click Save. Save the Secret Key shows the secret once.

Important

Store the secret before closing the dialog. It cannot be displayed again.

To replace a secret, edit the key and enter a new Secret Key. Leaving the field empty keeps the old one. A disabled key cannot be used with the service. A key that still owns buckets cannot be deleted.

Access Keys list with one key and its description
FIG 3 Access Keys List

Click Buckets in S3 Settings, then add a bucket.

Form for adding an S3 bucket
FIG 4 Bucket Form
  1. Enter a Name: 3 to 63 lowercase letters, digits, dots and hyphens, beginning and ending with a letter or digit.
  2. Select the Dataset mountpoint to serve.
  3. Select the Owner, the access key that can use the bucket.
  4. Click Save.

Saving gives the S3 service one ACL entry on the dataset, inherited by everything created in it. Files that already exist keep their permissions. Use Grant Access to Existing Files in the bucket list to add the entry to them, including datasets mounted inside the bucket’s dataset. Nothing else in their ACLs changes.

Buckets list with one enabled bucket, its dataset and owner
FIG 5 Buckets List

A bucket is served while it is enabled and its dataset is unlocked. Clients cannot create or delete buckets, and the owner cannot delete a bucket over S3. Deleting a bucket on FreeCORE leaves the dataset and its files as they are.

Go to Services and click the S3 toggle to start the service. Select Start Automatically to start it when the system boots.

Point the client at http://<address>:9000, or https://<address>:9000 when a certificate is set, with the configured Region, the access key and the secret key. Presigned URLs need Signature Version 4. Set it in a client that defaults to version 2. A client still on version 2 sees “AWS authentication requires a valid Date or x-amz-date header”; switch it to version 4.

Clients cannot create buckets; create them on the S3 sharing page. rclone checks for the bucket, and tries to create it, before its first upload, which then fails with AccessDenied. Set no_check_bucket = true in the remote, or pass --s3-no-check-bucket.

  • Uploading a file over S3 replaces it. SMB alternate data streams and DOS attributes on that file are not kept.
  • Files written over SMB or NFS have no S3 checksum.
  • The service keeps a staging directory, .sgwtmp, at the root of each bucket’s dataset. SMB and NFS clients see it. Leave it alone.
  • An SMB client that has a file open or cached can keep reading the old content for up to about a minute after the file is overwritten over S3. Size and attributes update at once; opening the file again later, or remounting, shows the new content. The same applies to any change made outside SMB, such as an NFS or local write.
  • An interrupted multipart upload keeps its parts in .sgwtmp/multipart/ until a client aborts the upload. They are not listed as objects but use space. List them with ListMultipartUploads (for example rclone backend list-multipart-uploads remote:bucket) and remove them with AbortMultipartUpload (rclone backend cleanup remote:bucket -o max-age=0s).

S3 Cannot List a Bucket: Snapshot Directory Is Visible names a served bucket that contains a dataset whose Snapshot Directory is Visible. Set it to Invisible on that dataset. FreeCORE checks every five minutes while the service is enabled.