HfogDocsv1.0.0

Storage buckets

Install the server's S3-compatible storage, give packages buckets, and how customers' buckets are kept apart, counted and backed up.

Storage buckets give customers S3-compatible object storage on the hosting server, for the media and files of their apps and websites. One storage server runs for the whole server; each customer makes their own buckets and access keys on the Storage buckets screen of the Control Panel.

Where: Server Admin › Settings › Software › Software versions tab (install), and Packages (limits)

Install it

  1. Open Software versions and find the Storage buckets (S3) card. It says Not installed.
  2. Click Install on the Versity S3 Gateway row and confirm. The install opens in a progress window.

The install downloads the pinned release of the Versity S3 Gateway (Apache 2.0 licence) from its GitHub releases and checks its SHA-256, starts it as the hostfog-s3 service, and serves it at s3.your domain (for example s3.example.com for a panel at panel.example.com) through Nginx. Point that name's DNS at the server: the name joins the panel's Let's Encrypt certificate by itself once it points here, like the separate panels' names.

When HostFog moves to a newer release of the gateway, the card offers it: click Update.

Note: the storage server listens on 127.0.0.1 only; customers reach it at https://s3.<domain> with path-style addresses and the region us-east-1. Its admin interface is a socket only root can open.

Give packages buckets

Packages have no buckets until you give them some. Open Packages, edit a package and set:

Field What it is
Storage buckets None, or Allowed and how many buckets each account may make (up to 1,000).
Bucket storage (MB) Disk quota only (the account's disk quota is the only limit), or Own limit and what all of an account's buckets may hold together.

Customers whose package has buckets see Storage buckets under Files in their menu.

How it works

  • Counted in the disk space. A bucket is a folder under /var/lib/hostfog/buckets that only root can open; the files in it belong to the customer's account. They count in the account's disk quota (a full quota stops uploads), in its disk usage, and on its Disk usage screen, one line per bucket. The accounts list shows the total as usual.
  • Kept apart. Each access key belongs to one account and reaches that account's buckets only; any other request gets AccessDenied. Keys can't make buckets, change who may read them, or delete them: the panel does that.
  • Public buckets. Anyone may read a public bucket's files by their address; nobody but the account's keys may list, upload or delete.
  • Over the bucket storage limit. Checked every night: while an account's buckets hold more than its package's Bucket storage, its keys may only read and delete.
  • Suspended accounts. Their keys stop working and their public files are not served until the account is unsuspended.
  • Deleted accounts. Their buckets, files and keys are deleted with them.

Staff see each account's bucket usage on the account's disk usage, and through the API (GET /v1/accounts/{username}/buckets).

Backups and moves

  • Backups. An account's backups and snapshots include its buckets' files with their details (content type, checksums). A bucket is restored from the restore picker's Storage buckets list (or, from a backup, with Everything), into the bucket of that name the account still has; a bucket deleted since is not made again. The customer's export (.zip) has them under Buckets/, one folder per bucket.
  • Moves. A move carries the account's buckets with their files, settings and access keys: the keys keep working with the same secrets. Customers then use the new server's S3 name (s3.its domain) unless the old one is pointed at it. The new server must have storage buckets installed and running, and no bucket of the same name: otherwise the move stops before anything is set up. If the buckets can't be set up, the move is stopped and the account stays where it was.