{"id":20313907,"url":"https://github.com/craftcms/cloud","last_synced_at":"2026-06-27T01:09:02.976Z","repository":{"id":221779894,"uuid":"754449862","full_name":"craftcms/cloud","owner":"craftcms","description":"craftcms/cloud Composer package","archived":false,"fork":false,"pushed_at":"2026-04-17T20:06:24.000Z","size":2082,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":7,"default_branch":"3.x","last_synced_at":"2026-04-17T22:19:18.648Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://craftcms.com/cloud","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/craftcms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-08T04:25:36.000Z","updated_at":"2026-04-17T20:06:29.000Z","dependencies_parsed_at":"2024-04-16T21:30:26.155Z","dependency_job_id":"1139dcf1-078b-41ce-b4bb-729deaeabf69","html_url":"https://github.com/craftcms/cloud","commit_stats":null,"previous_names":["craftcms/cloud"],"tags_count":263,"template":false,"template_full_name":null,"purl":"pkg:github/craftcms/cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftcms%2Fcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftcms%2Fcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftcms%2Fcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftcms%2Fcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/craftcms","download_url":"https://codeload.github.com/craftcms/cloud/tar.gz/refs/heads/3.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftcms%2Fcloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32203362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T20:19:26.138Z","status":"ssl_error","status_checked_at":"2026-04-23T20:19:23.520Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:13:27.448Z","updated_at":"2026-06-27T01:09:02.967Z","avatar_url":"https://github.com/craftcms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://craftcms.com/cloud\" rel=\"noopener\" target=\"_blank\" title=\"Craft Cloud\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/craftcms/.github/v3/profile/product-icons/craft-cloud.svg\" alt=\"Craft Cloud icon\" width=\"65\"\u003e\u003c/a\u003e\n\n# Craft Cloud Extension\n\nWelcome to [**Craft Cloud**](https://craftcms.com/cloud)!\n\nThis repository contains source code for the `craftcms/cloud` Composer package, which is required to run a Craft project on our first-party hosting platform, Craft Cloud.\n\nWhen installed, the extension automatically [bootstraps](https://www.yiiframework.com/doc/guide/2.0/en/runtime-bootstrapping) itself and makes necessary [application configuration](https://craftcms.com/docs/5.x/reference/config/app.html) changes for the detected environment:\n\n- :cloud_with_lightning: **Cloud:** There’s no infrastructure settings to worry about—database, queue, cache, and session configuration is handled for you.\n- :computer: **Local development:** Craft runs normally, in your favorite [development environment](https://craftcms.com/docs/5.x/install.html).\n\n:sparkles: To learn more about Cloud, check out [our website](https://craftcms.com/cloud)—or dive right in with [Craft Console](https://console.craftcms.com/cloud). Interested in everything the extension does to get your app ready for Cloud? Read our [Cloud extension deep-dive](https://craftcms.com/knowledge-base/cloud-extension), in the knowledge base.\n\n## Installation\n\nThe Cloud extension can be installed in any existing Craft 4.6+ project by running `php craft setup/cloud`. Craft will add the `craftcms/cloud` package and run the extension’s own setup wizard.\n\n\u003e [!TIP]\n\u003e This process includes the creation of a [`craft-cloud.yaml` configuration file](https://craftcms.com/knowledge-base/cloud-config) which helps Cloud understand your project’s structure and determines which versions of PHP and Node your project will use during builds and at runtime.\n\nWhen you [deploy](https://craftcms.com/knowledge-base/cloud-deployment) a project to Cloud, the `cloud/up` command will run, wrapping Craft’s built-in [`up` command](https://craftcms.com/docs/5.x/reference/cli.html#up) and adding the cache and session tables (if they’re not already present).\n\n## Filesystem\n\nWhen setting up your project’s assets, use the provided **Craft Cloud** filesystem type. Read more about [managing assets in Cloud projects](https://craftcms.com/knowledge-base/cloud-assets).\n\n## Testing\n\nThe Codeception `unit` suite on `3.x` boots Craft and expects a local test database.\n\n```bash\ncomposer test:init\ncomposer test:up\ncomposer test\ncomposer test:down\n```\n\n`composer test:init` will create `tests/.env` from `tests/.env.example` if it does not already exist. `composer test:up` uses that file when starting the MySQL service defined in `tests/docker-compose.yaml`.\n\nFor local compatibility work on `3.x`, it can be helpful to keep your main checkout on the default/latest Craft 5 dependency set and use a separate Git worktree for Craft 4 so each checkout can keep its own `vendor/`, `composer.lock`, and `tests/.env` state.\n\n```bash\ngit worktree add ../cloud-3x-craft4 3.x\n\n# In the Craft 4 worktree:\ncomposer update \"craftcms/cms:^4.6\" \"craftcms/flysystem:^1.0\" --with-all-dependencies --no-audit\n\n# In your main checkout:\ncomposer update \"craftcms/cms:^5\" \"craftcms/flysystem:^2.0\" --with-all-dependencies\n```\n\n## Developer Features\n\n### Signed HTTP Requests\n\nUse the module’s request signer to sign a PSR-7 request with Cloud’s signing key before sending it to any destination that can verify HTTP message signatures.\n\n```php\nuse craft\\cloud\\Module;\nuse GuzzleHttp\\Psr7\\Request;\n\n$signer = Module::getInstance()-\u003egetRequestSigner();\n\n$signedRequest = $signer-\u003esign(new Request('POST', 'https://example.test/webhook'));\n```\n\nExternal systems can create compatible signatures without this PHP package. See\n[httpsig.org](https://httpsig.org/) for more information about HTTP message signatures. For example,\ninstall [`http-message-sig`](https://www.npmjs.com/package/http-message-sig) in a Node-based build\nenvironment:\n\n```bash\nnpm install http-message-sig\n```\n\nThen a build script, e.g. on Vercel, can sign a Craft GraphQL request:\n\n```js\nimport crypto from 'node:crypto';\nimport { signatureHeadersSync } from 'http-message-sig';\n\nconst method = 'POST';\nconst url = process.env.CRAFT_GRAPHQL_URL;\n\nconst body = JSON.stringify({\n    query: `\n        {\n            entries(section: \"blog\") {\n                title\n                url\n            }\n        }\n    `,\n});\n\nconst headers = {\n    'Content-Type': 'application/json',\n    Authorization: `Bearer ${process.env.CRAFT_GRAPHQL_TOKEN}`,\n};\n\nconst signer = {\n    keyid: 'hmac',\n    alg: 'hmac-sha256',\n    signSync(data) {\n        return crypto\n            .createHmac('sha256', process.env.CRAFT_CLOUD_SIGNING_KEY)\n            .update(data)\n            .digest();\n    },\n};\n\nconst created = new Date();\nconst signatureHeaders = signatureHeadersSync(\n    { method, url, headers, body },\n    {\n        key: 'sig',\n        signer,\n        components: ['@method', '@target-uri'],\n        created,\n        expires: new Date(created.getTime() + 300_000),\n    },\n);\n\nconst response = await fetch(url, {\n    method,\n    headers: {\n        ...headers,\n        ...signatureHeaders,\n    },\n    body,\n});\n\nconst responseBody = await response.json();\n```\n\nThe `@target-uri` value must be the exact URL being requested, including any query string.\n\n### Signed URLs\n\nUse the module’s URL signer when you need a signed URL instead of a signed HTTP request.\n\n```php\nuse craft\\cloud\\Module;\n\n$signer = Module::getInstance()-\u003egetUrlSigner();\n\n$signedUrl = $signer-\u003esign('https://example.test/downloads/report.pdf?version=latest');\n$isValid = $signer-\u003everify($signedUrl);\n```\n\nURL signatures cover the URL’s path and query string, so changing either invalidates the\nsignature.\n\n### Template Helpers\n\n#### `cloud.artifactUrl()`\n\nGenerates a URL to a resource that was uploaded to the CDN during the build and deployment process.\n\n```twig\n{# Output a script tag with a build-specific URL: #}\n\u003cscript src=\"{{ cloud.artifactUrl('dist/js/app.js') }}\"\u003e\u003c/script\u003e\n\n{# You can also use the extension-provided alias: #}\n{% js '@artifactBaseUrl/dist/js/app.js' %}\n```\n\nRead more about [how to use artifact URLs](https://craftcms.com/knowledge-base/cloud-builds#artifact-uRLs).\n\n#### `cloud.isCraftCloud`\n\n`true` when the app detects it is running on Cloud infrastructure, `false` otherwise.\n\n```twig\n{% if cloud.isCraftCloud %}\n  Welcome to Cloud!\n{% endif %}\n```\n\n### Aliases\n\nThe following aliases are available, in addition to [those provided by Craft](https://craftcms.com/docs/5.x/configure.html#aliases).\n\n#### `@web`\n\nOn Cloud, the `@web` alias is guaranteed to be the correct environment URL for each HTTP context, whether that be a [preview domain](https://craftcms.com/knowledge-base/cloud-domains#preview-domains) or [custom domain](https://craftcms.com/knowledge-base/cloud-domains#adding-a-domain).\n\n#### `@artifactBaseUrl`\n\nEquivalent to [`cloud.artifactUrl()`](#artifactUrl), this allows [Project Config](https://craftcms.com/docs/5.x/system/project-config.html) settings to take advantage of dynamic, build-specific CDN URLs.\n\n## Configuration\n\nMost configuration (to Craft and the extension itself) is handled directly by Cloud infrastructure, through [environment overrides](https://craftcms.com/docs/5.x/configure.html#environment-overrides). These options are provided strictly for reference, and have limited utility outside the platform.\n\n| Option                | Type           | Description                                                                                                                     |\n|-----------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `artifactBaseUrl`     | `string\\|null` | Directly set a fully-qualified URL to build artifacts.                                                                          |\n| `s3ClientOptions`     | `array`        | Additional settings to pass to the `Aws\\S3\\S3Client` instance when accessing storage APIs.                                      |\n| `cdnBaseUrl`          | `string`       | Used when building URLs to [assets](#filesystem) and other build [artifacts](#artifacturl).                                     |\n| `gatewayBaseUrl`      | `string`       | Used when making gateway API requests.                                                                                          |\n| `sqsUrl`              | `string`       | Determines how Craft communicates with the underlying queue provider.                                                           |\n| `projectId`           | `string`       | UUID of the current project.                                                                                                    |\n| `environmentId`       | `string`       | UUID of the current [environment](https://craftcms.com/knowledge-base/cloud-environments).                                      |\n| `buildId`             | `string`       | UUID of the current [build](https://craftcms.com/knowledge-base/cloud-builds).                                                  |\n| `accessKey`           | `string`       | AWS access key, used for communicating with storage APIs.                                                                       |\n| `accessSecret`        | `string`       | AWS access secret, used in conjunction with the `accessKey`.                                                                    |\n| `accessToken`         | `string`       | AWS access token.                                                                                                               |\n| `redisUrl`            | `string`       | Connection string for the environment’s Redis instance.                                                                         |\n| `signingKey`          | `string`       | A secret value used to protect transform URLs and sign HTTP requests. |\n| `useAssetBundleCdn`   | `boolean`      | Whether or not to enable the CDN for asset bundles.                                                                             |\n| `previewDomain`       | `string\\|null` | Set when accessing an environment from its [preview domain](https://craftcms.com/knowledge-base/cloud-domains#preview-domains). |\n| `useQueue`            | `boolean`      | Whether or not to use Cloud’s SQS-backed queue driver.                                                                          |\n| `region`              | `string`       | The app region, chosen when creating the project.                                                                               |\n| `useAssetCdn`         | `boolean`      | Whether or not to enable the CDN for uploaded assets.                                                                           |\n| `useArtifactCdn`      | `boolean`      | Whether or not to enable the CDN for build artifacts and asset bundles.                                                         |\n| `staticCacheDuration` | `int`          | The default duration, in seconds, to statically cache requests.                                                                 |\n\u003e [!TIP]\n\u003e These options can also be set via environment overrides beginning with `CRAFT_CLOUD_`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraftcms%2Fcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcraftcms%2Fcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraftcms%2Fcloud/lists"}