gcloud, Docker, gh, jq, OpenSSL, cmp, and curl — it does not require a source checkout or Cloud Build. This page covers downloading and verifying the release bundle, understanding the resources the installer creates, running the eight-stage installation flow, selecting a Cloud SQL profile, and upgrading to a new release.
Download and Verify the Bundle
ReplaceX.Y.Z with the target release version:
README.md before running ./setup.sh. The extracted README contains release-specific notes that take precedence over this general guide.
Resources the Installer Creates
With the defaultRESOURCE_NAME=safe-online-exam, a new installation provisions the following Google Cloud resources:
RESOURCE_NAME=safe-online-exam-staging) when running multiple installations in the same Google Cloud project. Do not rename a service after Canvas has registered its run.app URL — that constitutes a Canvas-facing integration change requiring re-registration.
Installation
Review and configure the environment
cloudrun.env. At minimum, configure:PROJECT_ID— your Google Cloud project.REGION— the Cloud Run region (e.g.,us-central1).TOOL_URL— the stable public HTTPS origin (Cloud Run URL or custom domain mapping).CANVAS_DOMAIN— the Canvas base origin (e.g.,https://canvas.example.edu).
cloudrun.env, bootstrap state, client identity, and .state files outside source control. Restrict their permissions to 0600 or stricter.List available Cloud SQL profiles
production-zonal. See Cloud SQL Profile Selection below for details on each option.Run the installer (interactive)
Stage 1–2: Preflight and bootstrap
.p12, private key, and passphrase stay in the protected client identity directory; they must never be uploaded to Secret Manager or included in a Cloud Run revision.Stage 3–4: Cloud SQL and stable URL
Stage 5: Create Canvas API Developer Key (pause)
TOOL_URL. At this point, open Canvas Admin and create the API OAuth Developer Key as described in the Canvas Setup guide. Record the client ID and secret, then return to the installer.Stage 6: Deploy migrations, cleanup, and candidate service
Stage 7: Create Canvas LTI Developer Key (pause)
${TOOL_URL}/lti/config), then install the external app and record the deployment ID. Return to the installer with both values.Stage 8: Finalize and cut traffic
Cloud SQL Profile Selection
The defaultproduction-zonal profile is a cost-conscious dedicated, single-zone PostgreSQL 17 instance with:
- Automated daily backups and point-in-time recovery.
- Deletion protection.
- Encrypted, connector-only access (no public IP).
- Storage auto-growth.
- A configured maintenance window.
existing-reviewed when the institution supplies an existing PostgreSQL 17 Cloud SQL instance in the same region. In that mode, the institution owns the HA, backup, retention, networking, sizing, and deletion-protection configuration.
IAM and Public Access
Use separate runtime, scheduler, and deployer service accounts:- The runtime service account needs Cloud SQL Client access limited to the configured project and secret access scoped to only the exact secrets it consumes. Do not grant project-wide Secret Manager access.
- The deployer must be able to read each exact pinned secret version to compare it with the protected bootstrap value before deciding whether to create a new version.
- The scheduler service account invokes the cleanup job on schedule.
TOOL_URL to its stable origin. Migration and cleanup jobs must remain non-public.
Custom Domain Mapping
TOOL_URL is a Cloud Run domain mapping rather than the generated run.app URL, run the bundle’s explicit domain mapping command after prepare.sh:DISABLE_DEFAULT_URL_AFTER_FINALIZE=true after the custom origin has passed health, readiness, JWKS, and LTI checks. Later upgrades temporarily restore the generated URL for candidate verification and then disable it again after the custom origin passes.Upgrade Procedure
Download and verify the new bundle
Preserve the existing environment and invoke the new upgrade.sh
cloudrun.env, bootstrap state, client identity, and .state files in their durable installation directory. Merge any new template keys into cloudrun.env rather than overwriting it. Then invoke the new bundle’s upgrade helper with the path to the existing environment file:The upgrade.sh flow
- Validates the complete current environment and bootstrap contract; creates any newly required numbered Secret Manager versions; and grants the existing runtime identity access.
- Creates an on-demand Cloud SQL backup and requires a
SUCCESSFULstatus before proceeding. - Runs the new migration job.
- Updates the cleanup job and applies the current environment and secret bindings to both jobs.
- Deploys a no-traffic candidate revision with those same current bindings.
- Temporarily enables the previously disabled generated URL so the tagged candidate can be verified.
- Verifies candidate readiness and JWKS.
- Cuts traffic to the new revision.
- Verifies the custom origin and restores the prior generated-URL policy.
Verify the upgrade
OAuth Token Encryption Upgrade (Existing Installations)
For an existing installation that may contain plaintext OAuth tokens, use the staged transition. Merge the new template keys intocloudrun.env, then run the upgrade with OAUTH_TOKEN_ENCRYPTION_MODE=compat:
OAUTH_TOKEN_ENCRYPTION_MODE=enforce, deploy the same image again, verify the service, then run the one-shot token rewrite job:
0 updates before removing any retired key. A pre-encryption revision is not a valid rollback target after encrypted writes begin.