Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deploy/tts-audio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ dev-synth: ## Build the image and speak TEXT=... in LOCALE=en|es|br to OUT (defa

# ── GCP bootstrap ─────────────────────────────────────────────────────────────

GCP_PROJECT ?= sredevops-audio
GCS_BUCKET ?= sredevops-audio
GCP_PROJECT ?= sredevopsorg
GCS_BUCKET ?= tts-sredevopsorg
GCP_LOCATION ?= us-central1
GSA_NAME ?= tts-audio-runner
SITE_ORIGINS ?= https://www.sredevops.org,https://sredevops.org,http://localhost:2368
Expand Down
27 changes: 27 additions & 0 deletions deploy/tts-audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,37 @@ for the reader-facing behaviour.

## 1. Google Cloud

The defaults in the Makefile (and `base/configmap.yaml`) are
`GCP_PROJECT=sredevopsorg`, `GCS_BUCKET=tts-sredevopsorg`; override them for another
project. The service account is `tts-audio-runner@<project>.iam.gserviceaccount.com` and
needs object access to that bucket only.

```bash
make gcp-bootstrap GCP_PROJECT=<project> GCS_BUCKET=<bucket> GCP_LOCATION=<region>
```

`gcp-bootstrap` needs a principal that can **administer** the bucket (IAM + CORS). The
runner service account deliberately cannot: it is scoped to objects, so it can write audio
but not widen its own permissions. If you are using the runner key by mistake you will see
`storage.buckets.get` / `storage.buckets.update` denied.

Three failures are worth naming, because each one leaves a pipeline that looks deployed
but produces nothing a reader can hear:

| Symptom | Cause |
|---|---|
| `The specified bucket does not exist` | `GCS_BUCKET` names a bucket that was never created, or the wrong project |
| Anonymous `GET` on an object returns **403** | `allUsers` → `roles/storage.objectViewer` is missing; the player cannot read it |
| `OPTIONS` preflight has no `access-control-allow-origin` | CORS was never applied; a ranged seek fails in the browser |

Verify all three after the bootstrap:

```bash
curl -s -o /dev/null -w 'anonymous: %{http_code}\n' "https://storage.googleapis.com/$GCS_BUCKET/<any-object>"
curl -sI -X OPTIONS -H 'Origin: https://www.sredevops.org' -H 'Access-Control-Request-Method: GET' \
"https://storage.googleapis.com/$GCS_BUCKET/<any-object>" | grep -i access-control
```

That command is idempotent and does four things:

1. Creates the bucket with **uniform bucket-level access** and public-access prevention, so
Expand Down
2 changes: 1 addition & 1 deletion deploy/tts-audio/base/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
data:
GHOST_API_URL: "https://www.sredevops.org"
SITE_URL: "https://www.sredevops.org"
GCS_BUCKET: "sredevops-audio"
GCS_BUCKET: "tts-sredevopsorg"
AUDIO_BASE_URL: "https://audio.sredevops.org"

# Kokoro-82M v1.0 voices. Same female timbre across locales, replacing Chirp 3: HD
Expand Down
2 changes: 1 addition & 1 deletion deploy/tts-audio/scripts/cors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
set -euo pipefail

HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUCKET="${GCS_BUCKET:-sredevops-audio}"
BUCKET="${GCS_BUCKET:-tts-sredevopsorg}"

command -v gcloud >/dev/null || { echo "cors: gcloud is required" >&2; exit 2; }

Expand Down