MyNixOS website logo
option

services.athens.downloadMode

Defines how Athens behaves when a module@version is not found in storage. There are 7 options:

  1. "sync": download the module synchronously and return the results to the client.
  2. "async": return 404, but asynchronously store the module in the storage backend.
  3. "redirect": return a 301 redirect status to the client with the base URL as the DownloadRedirectURL from below.
  4. "async_redirect": same as option number 3 but it will asynchronously store the module to the backend.
  5. "none": return 404 if a module is not found and do nothing.
  6. "file:<path>": will point to an HCL file that specifies any of the 5 options above based on different import paths.
  7. "custom:<base64-encoded-hcl>" is the same as option 6 but the file is fully encoded in the option. This is useful for using an environment variable in serverless deployments.
Declarations
Type
one of "sync", "async", "redirect", "async_redirect", "none" or string matching the pattern ^file:.*$|^custom:.*$
Default
"async_redirect"