Skip to content
AsterDriveDeveloper
Security update: Docker images from v0.4.0-rc.1 fix the high-severity FFmpeg MagicYUV decoder vulnerability (CVE-2026-8461). Upgrade instances using older images immediately.View CVE advisory
Security update: v0.4.0-beta.3 fixes a WebDAV request issue that can terminate the server process. Upgrade older instances promptly.View advisory

Storage Policies and Policy Groups

Both deployment profiles use the same initialization state machine:

ProfileFirst-start behavior
singleAfter the first administrator is created, the system enters needs_storage; the administrator can set local or another supported policy as default
clusterAlso enters needs_storage after the first administrator; the default policy must be reachable by every Primary — local is not allowed

When the administrator sets the first policy as default, the system atomically creates or coordinates the default policy group and backfills administrators who have no group yet, then enters ready. New users created afterwards automatically bind the current default policy group, which decides their upload target. Single and cluster call the same creation, backfill, and state-migration code; they differ only in which storage capabilities may be selected.

When a system administrator creates a new team without specifying a policy group, the team uses the current default policy group.

TypeDescriptionFull tutorial
localFiles on a local directoryLocal Disk
s3Files on S3 or compatible object storage (MinIO / R2 / B2 / OSS, etc.)S3 / MinIO / R2
azure_blobFiles in an Azure Blob Storage container via the Azure Blob SDK and SAS URLsAzure Blob Storage
tencent_cosFiles on Tencent Cloud COS; basic object I/O reuses S3-compatible logic and additionally exposes Tencent-native capabilities like COS CITencent Cloud COS
one_driveFiles written to OneDrive, SharePoint, or Microsoft 365 group drives reachable via Microsoft GraphOneDrive
sftpFiles streamed by the AsterDrive server to an SSH/SFTP file serverSFTP
remoteFiles written through the internal remote storage protocol to another AsterDrive follower nodeFollower Node Storage Policy
  • To change “which backend files finally land on” — create or edit a storage policy
  • To route different users, teams, or file sizes differently — configure policy groups

Typical console order:

  1. Create and test the storage policy
  2. Create policy group rules
  3. Bind users or teams to the target policy group

Most common patterns:

  • The default policy group has a single rule sending everything to the current default policy; a single instance can use a local policy, while multi-Primary deployments should use a shared policy
  • With both local and S3 in use, split rules by file size
  • Bind different users or teams to different policy groups
  • Mark one policy group as the default for new users

A policy group can be disabled first; a disabled group cannot be assigned to new users or teams. To delete a group still bound by users or teams, first use the page’s “migrate bindings” action to batch-move those bindings to another group, then delete.

When migrating existing data, do not edit the old policy’s path, bucket, endpoint, or bound remote node into the new location. Create the target policy first, use Admin -> Storage Policies -> Migrate Data to create a migration task, and only then adjust policy groups.

ItemPurpose
NameDisplay name in the console
Driver typelocal, s3, azure_blob, tencent_cos, one_drive, sftp, or remote
Connection infoLocal directory / S3 endpoint, bucket, keys / Azure Blob endpoint, container, account keys / COS endpoint, bucket, keys / OneDrive Microsoft Graph target and authorization / SFTP endpoint, SSH credentials, host key fingerprint / bound remote node
Base pathDirectory, prefix, or remote relative path used when writing through this policy
Max single-file sizeLargest allowed upload; 0 = unlimited
Chunk sizeSize of each part for large-file uploads
Default policyPreferred by new default groups or default routing rules
Additional optionsLocal content dedup, S3 / Azure Blob / COS upload and download modes, S3 path-style access, OneDrive drive targeting, SFTP host key fingerprint, remote upload/download modes, storage-native processing switch, etc.

The console’s storage policy form is not hardcoded per vendor on the frontend. AsterDrive reads the fields, capabilities, upload workflows, and management actions supported by the current driver from the backend StorageConnector descriptor, so when storage backends are added or adjusted, the admin UI follows backend capabilities as much as possible.

Storage policies have two kinds of connection tests:

  • Test a saved policy: read-write probe against a policy already saved in the database.
  • Test a draft config: probe with current form values before saving; for static-credential backends like S3, Azure Blob, and Tencent COS, leaving the secret field empty reuses the saved credential.

A successful connection test only means the AsterDrive server can reach the backend and the basic read-write paths — credentials, bucket / container / drive / follower remote storage target — work. It does not mean a browser can reach the object storage or follower directly. Whenever presigned is used, you still need to check browser networking, HTTPS certificates, CORS, and exposed response headers.

When a connection test fails, the console preferentially shows error.diagnostic.message from the standard error response. This diagnostic comes from the backend’s classification of storage errors, keeps as much actionable information as possible, and redacts sensitive material like SAS tokens, account keys, and secret keys. Scripts and third-party clients should read it too:

{
"code": "storage.permission_denied",
"msg": "Storage permission denied",
"error": {
"retryable": false,
"diagnostic": {
"kind": "permission",
"message": "provider denied access to the target prefix"
}
}
}

The code is still the stable error code; diagnostic.message is explanatory text for administrators — do not branch on it programmatically.

Capacity Observation and Migration Pre-checks

Section titled “Capacity Observation and Migration Pre-checks”

The storage policy edit dialog shows current capacity observation:

Policy typeCapacity observation behavior
localReads total, available, and used space of the filesystem holding the policy’s base directory
s3 / tencent_cosReturns “unsupported”; standard S3-compatible APIs have no uniform, reliable bucket free-space interface
azure_blobReturns “unsupported”; the Blob data API offers no uniform storage-account capacity observation
one_driveReads Microsoft Graph drive quota; if Graph returns no quota, shows “unavailable”
sftpReturns “unsupported”; the SFTP protocol has no uniform, reliable remote filesystem capacity interface
remoteAsks the remote storage target bound to the policy via the internal remote storage protocol; a local target usually reports filesystem capacity, an S3 target again shows “unsupported”

During data migration, the pre-check compares the target policy’s available capacity against the “estimated blob bytes to copy”, not simply the source policy’s total size. Content SHA-256 blobs already present on the target count as reusable and are excluded from the estimate.

Capacity check states:

StateMeaningBlocks task creation
SufficientTarget available capacity is greater than or equal to estimated copy bytesNo
InsufficientTarget clearly lacks capacityYes
UnsupportedDriver has no reliable capacity interface, e.g. S3/COS/Azure BlobNo, but prompts you to confirm capacity
UnavailableThis capacity query failed or returned incomplete dataNo, but prompts you to confirm capacity

Migration works per blob and does not re-copy objects for every file record. To avoid incorrect merging, AsterDrive distinguishes two kinds of blob keys:

TypeHow it is recognizedMigration matching rule
Content SHA-25664-character hex stringIf the target policy already has a blob with the same hash and same size, the target object is verified and references are merged
Opaque keyAny other blob keyDoes not participate in cross-policy matching, and never merges just because key and size match

If the content SHA-256 hash matches but the size differs, migration fails and the source blob is left unchanged. This usually indicates abnormal database or object-storage state and needs administrator attention.

If an opaque key already exists on the target policy, migration neither overwrites the target object nor merges the source blob into it. The system generates a new migration-... key for the source blob, copies the object to the new path on the target policy, and records a “Renamed Opaque Keys” count in the task result.

Migrate Data creates a background task that copies existing Blobs from the source policy to the target policy, updating file records and version references along the way.

Before creating the task, the page runs a Check Plan round:

  • Counts objects and total size under the source policy
  • Probes whether the target policy is writable
  • Checks whether the target supports the streaming uploads migration needs
  • Estimates how many reusable objects already exist on the target, and computes the actual bytes left to copy
  • Tries to confirm the target has enough remaining capacity for that data
  • Counts opaque key conflicts

The pre-check blocks task creation only when the target clearly lacks capacity. “Unsupported” or “unavailable” capacity checks do not mean migration is impossible; the driver just cannot reliably read free space. Confirm target capacity yourself before actually creating the task.

After the task is created, watch progress under Admin -> Tasks. Schedule a maintenance window for large migrations, and avoid heavy new writes to the source policy during the run.

  • Keep at least one usable default storage policy
  • Keep at least one enabled default policy group
  • Run a connection test before saving
  • To assign different storage routes to different users/teams, bind policy groups under Admin -> Users or Admin -> Teams
  • When connecting an external backend, start with the matching tutorial under Storage Backends