Google Cloud Storage adapter for Ghost CMS.
cd /var/www/ghost
npm install @dyanet/ghost-storage-gcs
mkdir -p content/adapters/storage/gcs
echo "module.exports = require('@dyanet/ghost-storage-gcs');" > content/adapters/storage/gcs/index.jsAdd a storage block to your config.production.json:
{
"storage": {
"active": "gcs",
"gcs": {
"bucket": "your-bucket-name",
"key": "path/to/service-account.json"
}
}
}| Option | Required | Description |
|---|---|---|
bucket |
Yes | Google Cloud Storage bucket name |
key |
No | Path to service account JSON key file |
projectId |
No | Google Cloud project ID |
assetDomain |
No | Custom domain for serving files |
insecure |
No | Use HTTP instead of HTTPS (default: false) |
maxAge |
No | Cache-Control max-age in seconds (default: 2678400) |
uniformBucketLevelAccess |
No | Set to true if bucket has uniform bucket-level access enabled (default: false) |
This error occurs when your GCS bucket has uniform bucket-level access enabled (the default for new buckets). The plugin tries to set per-object ACLs which is not allowed with uniform access.
Solution: Add "uniformBucketLevelAccess": true to your configuration:
{
"storage": {
"active": "gcs",
"gcs": {
"bucket": "your-bucket-name",
"key": "path/to/service-account.json",
"uniformBucketLevelAccess": true
}
}
}Note: With uniform bucket-level access, file visibility is controlled by bucket-level IAM policies rather than per-object ACLs.
On Windows, file paths use backslashes (\) which can cause issues with GCS object names. Version 2.0.0+ automatically normalizes all paths to use forward slashes (/) for GCS compatibility.
If you're using an older version, upgrade to 2.0.0 or later.
MIT