dodil data bucket cors
S3 CORS configuration on a bucket — set, get, delete. Mirrors CORS — API Reference. See Core Concepts → CORS for the type signature.
dodil data bucket cors set
dodil data bucket cors set [name] -f FILE
dodil data bucket cors set [name] -f - # read from stdinReads a JSON document (file or stdin) and applies it as the bucket’s CORS configuration via PutBucketCors. The JSON is parsed with protojson and sent over gRPC, so it must match the BucketCorsConfiguration shape exactly — a corsRules array, camelCase fields throughout.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--file | -f | string | - | JSON file path, or - for stdin |
A set replaces the whole configuration. The server requires at least one rule and at most 100, each with a non-empty allowedOrigins; allowedMethods may only contain GET, HEAD, PUT, POST, DELETE, and maxAgeSeconds must be non-negative.
These rules bind
api.data.dodil.ioonly. Theobject.uk-lon-1.dodil.iobyte plane uses one fixed fleet-wide origin allow-list (localhost,dodil.io,dodil.cloudby default) and never readsBucketCorsConfiguration— setting a rule here will not unblock a browser fetch against the object endpoint. See CORS — API Reference.
Example — from a file:
cat > cors.json <<'EOF'
{
"corsRules": [
{
"allowedOrigins": ["https://app.example.com"],
"allowedMethods": ["GET", "PUT"],
"allowedHeaders": ["*"],
"exposeHeaders": ["ETag"],
"maxAgeSeconds": 3600
}
]
}
EOF
dodil data bucket cors set kb-prod -f cors.jsonOr via stdin:
jq '.' cors.json | dodil data bucket cors set kb-prod -f -dodil data bucket cors get
dodil data bucket cors get [name]Returns the current BucketCorsConfiguration. Use -o json for machine-readable output suitable for round-trip editing. A bucket with no configuration errors with NotFound: no CORS configuration set on this bucket — it does not print an empty corsRules array.
Example:
dodil data bucket cors get kb-prod -o jsondodil data bucket cors delete
dodil data bucket cors delete [name]Removes the CORS configuration from the bucket.
Example:
dodil data bucket cors delete kb-prodSee also
- CORS — API Reference —
PutBucketCors/GetBucketCors/DeleteBucketCors - Core Concepts → CORS — type signature
dodil data bucket·dodil data bucket policy·dodil data object·dodil data mount