Skip to content
colis

Storage provider

colis with Scaleway Object Storage

European regions, S3-compatible, and the region actually means something.

createBucket()
import { createBucket } from '@colis/core'

const store = createBucket({
  bucket: 'transfers',
  region: 'fr-par',
  endpoint: 'https://s3.fr-par.scw.cloud',
  credentials: {
    accessKeyId: process.env.SCW_ACCESS_KEY!,
    secretAccessKey: process.env.SCW_SECRET_KEY!,
  },
})

Why this one

Scaleway Object Storage

Scaleway’s Object Storage is S3-compatible with one difference worth knowing: it uses the region. Pass fr-par, nl-ams or pl-waw explicitly rather than letting the endpoint default it to "auto".

From the command line

A starter configuration, and what is left to do.

init writes the file with ${VAR} references rather than secrets, so it is meant to be committed; the env file it points at is not.

colis.config.json
{
  "bucket": "transfers",
  "region": "fr-par",
  "endpoint": "https://s3.fr-par.scw.cloud",
  "prefix": "transfers",
  "expiresIn": "24h",
  "envFile": ".env",
  "credentials": {
    "accessKeyId": "${SCW_ACCESS_KEY}",
    "secretAccessKey": "${SCW_SECRET_KEY}"
  }
}

Then

  1. 01Put SCW_ACCESS_KEY and SCW_SECRET_KEY in .env.
  2. 02Add a lifecycle rule on the prefix.
  3. 03Run colis verifier. It performs the operations colis needs and reports what happened.

Worth knowing

Notes on Scaleway.

The region is real

The endpoint carries the region and the signature has to agree with it. Write both, in the same region.

Large files

Large files go from the browser straight to the bucket, in parts. The bucket needs a CORS rule that allows PUT from your delivery page and exposes ETag; without it, small files still work.

Expiry cleanup

The expiry stops a parcel being handed over; only a lifecycle rule deletes the object. Give the prefix a rule that expires objects after a day or two, and colis verifier turns green.

Send it. They sign off. You know.

Your storage, a delivery page under your name, a webhook at every step. Nothing hosted by someone else.