Download links
Let large downloads go straight from the object store by short-lived signed links, and know what that costs and what your clients' network needs.
On this page
What the switch does
With Deliver large downloads by signed links of the object store on, Quader answers a large download with 307 Temporary Redirect
to a link of the object store, valid for a short time, instead of streaming the bytes. It issues the link only after the sign-in, the
permissions, the malware and signature checks and the download limits passed, as for a streamed download.
A download goes by link only when all of these hold:
| Condition | Why |
|---|---|
| The format's every client checks every byte against a digest it knew before: OCI blobs and Ansible Galaxy archives | npm, NuGet, Debian and generic files always stream; Details lists what the running version reaches |
| The file is at least the Minimum size | Small files gain nothing |
A GET of the whole file: no HEAD, no range, nothing under /files/ |
A conditional request Quader can answer itself (304, 412) gets no link |
| Neither the addressed repository nor the member holding the file opted out | Below |
| The request did not come through a Bastion | |
| A connection of the object store holds the file and can serve links | Below |
A new installation has the switch off.
The settings page
- Who
- holders of
settings:readsee the page;settings:writechanges it and makes test links - Where
- Admin area › Settings › Storage, section Download links
The section shows the state (Off, On with the formats reached, or On, but no link is issued), the connections that Can serve links and Cannot serve links, and the switch. Details, closed:
| Field | Value of a new installation | What it does |
|---|---|---|
| Minimum size in MiB | 1 | Smaller files are always streamed; 0 to 1,048,576 |
| Link valid for, in seconds | 60 | 10 to 3,600; a link can be passed on while it is valid, so keep it short |
| Public address of a connection | the connection's endpoint | The https origin your clients reach the store at, without a path; a Bastion's direct reads use it too |
A change is recorded as storage.download_links.changed and reaches every replica within two seconds. Switching off is in the restore
journal, so a restore keeps links off.
What a link costs
- The bytes no longer pass Quader. It cannot stop a download of an object changed in the bucket; the client's digest check does. That is why only formats whose clients all check are reached.
- A link is a bearer for its life. Whoever holds it fetches the file until it expires; revoking the caller's token does not end it.
- Speed limits do not slow a link. Its size is charged to the caller's hourly and daily budgets when issued (Download limits).
- Quader counts at the issue. The download is recorded when the link is handed out, with the delivery
link; Quader does not learn whether the client fetched it. - The store's own limits apply to the clients' fetches.
- An encrypted connection never serves a client's link; only a Bastion with direct reads gets one, with that file's key.
Clients behind a proxy or a firewall
A client that gets a link must reach the store's public address itself over https. Before you switch on, check that the clients'
network may connect to it, that a proxy allows the host, and that clients trust its certificate. The address must not be a host name of
Quader or below one: container clients would send their Quader credential to the store, so the page refuses it.
Test link under each address makes a link to a small test file, valid 60 seconds, with a curl command. Run it on a machine of your
clients: when their network reaches the store, quader-link-test.txt reads Quader download link test: this link works.
A connection that cannot serve links
Each connection is checked at every start of a replica, when the switch goes on, every hour while it is on, and when a Bastion's direct reads are switched on:
| Reason | What to do |
|---|---|
| The connection is encrypted | Nothing: Quader streams its content |
| The address does not use https | Set an https public address |
| The address lies under a host of Quader | Choose an address outside Quader's host names |
| The store did not answer a test link as expected | Check its signature support and the address, then restart a replica or switch off and on |
A repository's opt-out
The project's Owner, or a holder of repositories:write-config, unticks Downloads of this repository may go by signed links of the
object store in the repository's section Download links and selects Save changes; it is recorded as repository.narrowed.
It can be set while the switch is off. It is disabled on npm, NuGet, Debian and generic repositories. Through the API:
/api/v1/download-links/… and the repository's storage.downloadLinks.