feat(storage): add Google Cloud Storage module - #8061
Open
horusglez wants to merge 1 commit into
Open
Conversation
Adds a push-mode storage target for Google Cloud Storage, following the same interface as the existing disk/s3 modules (created, updated, deleted, renamed, assetUploaded, assetDeleted, assetRenamed, plus an Export All action). Config: bucket name, project ID, service account key (JSON), and an optional toggle to make uploaded files public. Service account needs 2 roles on the bucket: Storage Object Admin (object CRUD) and Storage Legacy Bucket Reader (storage.buckets.get, used by the bucket-existence check on init). Includes unit tests covering init (valid/invalid credentials, missing bucket), file path resolution (including locale namespacing), and all create/update/delete/rename/asset handlers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a push-mode storage target module for Google Cloud Storage. Wiki.js core currently ships storage targets for Azure, S3, Dropbox, Box, Google Drive, OneDrive, DigitalOcean Spaces, SFTP, Git and local disk, but not GCS directly.
Follows the same interface as the existing
disk/s3modules:created,updated,deleted,renamed,assetUploaded,assetDeleted,assetRenamed, plus anexportAllaction (mirrorsdisk'sdump) to bulk-push existing content.Config
The bucket must already exist; the module validates access via
bucket.exists()on init but does not create the bucket.Required service account roles (on the bucket, not project-wide):
Storage Object Admin(object CRUD) +Storage Legacy Bucket Reader(needed forstorage.buckets.get, used by the init check —Storage Object Adminalone does not include this permission).Test plan
server/test/modules/storage/gcs/storage.test.jscoveringinit(valid/invalid JSON key, missing/inaccessible bucket, projectId fallback to the key'sproject_id), file path resolution including locale namespacing, and all create/update/delete/rename/asset handlers, with@google-cloud/storagemocked.Loaded 1 new storage targets: OK), init succeeds against a real bucket with the two roles above, page create/update/delete correctly reflected in the bucket, confirmed visually in the GCS console.🤖 Built with Claude Code