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

Offline Download (Link Import)

Offline download is the “import from link” capability on the files page: a user submits an HTTP/HTTPS download URL, AsterDrive creates a server-side background task, downloads the file to a temp directory, verifies it, and imports it into a personal or team workspace.

AsterDrive applies basic protections before dispatching a task:

  • Only HTTP/HTTPS URLs are accepted
  • HTTP redirects are not followed; if the source responds with a redirect, use the final real download URL instead
  • Hosts resolving to loopback, private networks, link-local, multicast, documentation-reserved ranges, or cloud metadata addresses are rejected
  • The built-in downloader streams to a temp file and never reads the whole file into memory first
  • SHA-256 verification and workspace import happen only after the download completes

With aria2 enabled, AsterDrive still performs these URL checks itself, but actual DNS resolution and outbound connections are made by the aria2 daemon. In production, isolate aria2 at the network layer and restrict the JSON-RPC endpoint to AsterDrive only.

Offline download engines are controlled by offline_download_engine_registry_json. It is an ordered registry currently supporting:

  • builtin: the AsterDrive built-in downloader
  • aria2: an administrator-maintained aria2 JSON-RPC downloader

The default registry enables builtin and disables aria2. With multiple engines enabled, tasks are tried in registry order; if an earlier engine fails, the next enabled one is attempted. With everything disabled, new link-import tasks are rejected — usable as an explicit off switch during maintenance windows.

Typical configuration:

{
"version": 1,
"engines": [
{
"kind": "aria2",
"enabled": true
},
{
"kind": "builtin",
"enabled": true
}
]
}

Task details show which downloader actually completed the task; the aria2 engine also writes the GID into the internal runtime_json for diagnostics and recovery boundaries.

Adjustable under Admin -> System Settings -> File Processing -> Link Import:

SettingDefaultDescription
Link import engine registrybuiltin enabled, aria2 disabledWhich downloaders are enabled and their fallback order
Link import file size limit1 GiBMaximum source file size the server will download
Link import speed limit5 MB/sMaximum average speed per task; 0 means unlimited
Link import concurrency limit1How many link-import tasks may run at once
Link import request timeout600 secondsHow long a complete download may take
Offline download temp directoryEmpty, uses the service default temp dirOptional absolute path; AsterDrive and the external downloader must both access the same path
aria2 RPC addressEmptyUsed only when the aria2 engine is enabled
aria2 RPC secretEmptySensitive config; redacted on read
aria2 RPC request timeout10 secondsPer JSON-RPC call timeout; does not replace the full download timeout
aria2 split5split passed to aria2 per task
aria2 connections per server5max-connection-per-server passed to aria2 per task
aria2 lowest speed threshold0lowest-speed-limit passed to aria2; 0 disables it

AsterDrive does not pass arbitrary aria2 options through — only the administrator-controlled safe subset above. The link import speed limit maps to aria2’s per-task max-download-limit, not a daemon-wide throttle.

offline_download_temp_dir is the staging root for offline download. Empty means the service default temp directory; when set, it must be an absolute path.

AsterDrive creates tasks/{task_id}/{processing_token}/source under this directory. The built-in downloader writes this file itself; the aria2 engine sends the same directory and filename to aria2 over JSON-RPC. So this path is not a “host path mapping table” — it is one path string both AsterDrive and aria2 must see identically.

When deploying, ensure:

  • The AsterDrive process has read, write, and execute permission on the directory
  • The external downloader (e.g. aria2) can also access and write the same absolute path
  • The directory holds only task temp artifacts and can be excluded from backups

For all-Docker deployments, set it to /data/.tmp/offline-download and mount the same host ./data into both AsterDrive’s and aria2’s /data. For the mixed mode of cargo run on the host plus Compose aria2, set it to a host absolute path like /srv/asterdrive/offline-download-temp and mount the aria2 container at the same in-container absolute path:

volumes:
- ./data/offline-download-temp:/srv/asterdrive/offline-download-temp

In a Docker deployment, start aria2 with the aria2 profile from the repository root:

Terminal window
mkdir -p ./data ./aria2-config
sudo chown -R 10001:10001 ./data ./aria2-config
export ASTERDRIVE_ARIA2_RPC_SECRET="$(openssl rand -hex 24)"
docker compose --profile aria2 up -d

For all-Docker deployments, AsterDrive and aria2 must mount the same host ./data at the same in-container /data path, because AsterDrive passes task temp file paths to aria2. Setting offline_download_temp_dir to /data/.tmp/offline-download is recommended.

Then configure in system settings:

Scenariooffline_download_aria2_rpc_urloffline_download_temp_dir
AsterDrive and aria2 both in the Compose networkhttp://aria2:6800/jsonrpc/data/.tmp/offline-download
AsterDrive via cargo run on the host, aria2 via Compose in a containerhttp://127.0.0.1:6800/jsonrpcThe same host absolute path visible to both sides

Set offline_download_aria2_rpc_secret to the value of ASTERDRIVE_ARIA2_RPC_SECRET. Before saving, click “Test aria2” in the link import engine registry; the server will call aria2.getVersion with the current draft to verify the RPC address, secret, and connectivity.

SymptomCommon causeFix
”Test aria2” passes, but real tasks fail with Permission denied or Failed to make the directory ... in logsRPC works, but aria2 cannot write the task temp directory AsterDrive passedSet offline_download_temp_dir to the same absolute path both sides can access. All-Docker: /data/.tmp/offline-download; host cargo run + Compose aria2: mount the host absolute path into the container at the same path
”Test aria2” authentication failsoffline_download_aria2_rpc_secret and aria2’s RPC_SECRET differRegenerate ASTERDRIVE_ARIA2_RPC_SECRET, restart aria2, and save the same secret in system settings
Sensitive input shows emptySensitive config is redacted on read; the frontend does not refill ***REDACTED***Leave empty to keep unchanged; type the new secret to change it
Cannot connect to http://aria2:6800/jsonrpcThe service name aria2 only resolves when AsterDrive is also in the Compose networkAll-Docker: http://aria2:6800/jsonrpc; AsterDrive on the host: http://127.0.0.1:6800/jsonrpc, and confirm Compose publishes 6800:6800
Task still succeeds after aria2 failsThe registry has builtin as fallback after aria2Expected behavior. Check the task detail name, result, and logs for the engine that actually ran; temporarily disable builtin if you only want to surface aria2 problems
Logs show Active Download not found for GID...Cleanup found aria2 no longer has this GIDUsually not the root cause; focus on the first aria2 failure log above it
Cannot create tasks after disabling all enginesAll-disabled means link import is explicitly offRe-enable at least one engine