Verify real R2/Google credentials; document the placeholder-password catch

configure-secrets.sh run for real against the user's actual R2 bucket
and Google OAuth client, confirmed via /api/settings, /api/collections/
users, and /api/collections/users/auth-methods (the exact endpoint the
frontend SDK calls). Round-tripped an actual file through R2 end to
end - created a document with a real multipart upload, fetched it back
via PocketBase's own file URL, confirmed the exact bytes.

Caught before any of this ran: the superuser email/password in .env
were still .env.example's literal placeholders even after R2/Google
values were filled in - flagged and confirmed with the user before
upserting a well-known default credential on an account with full
admin access to every user's data.
This commit is contained in:
JasonFraser 2026-10-13 01:22:25 -04:00
parent 35b378751f
commit c1df28fb78
1 changed files with 25 additions and 11 deletions

View File

@ -569,9 +569,10 @@ localStorage restore across a real reload) still needs the user's own browser to
same honest limitation as every other frontend change this session, Claude-in-Chrome has
not connected.
**PocketBase: accounts, R2-backed files, project sidebar - Stage B.1 in progress,
2026-10-13.** The client-project sidebar was originally planned as a localStorage-only
feature (consistent with this app's "no DB" architecture). The user asked to reconsider
**PocketBase: accounts, R2-backed files, project sidebar - Stage B.1 done and fully
verified, 2026-10-13 (B.2/B.3 not started - see below).** The client-project sidebar was
originally planned as a localStorage-only feature (consistent with this app's "no DB"
architecture). The user asked to reconsider
and introduce PocketBase instead - explicitly flagged as a real scope jump from "single
local user" territory, confirmed deliberately via `AskUserQuestion` rather than assumed.
Grew further during plan review into two more specific asks, each changing the design:
@ -642,14 +643,27 @@ built and tested; B.2 document-persistence migration and B.3 sidebar UI not star
re-login restores it. `npm run build` passes with the new auth layer
(`pocketbaseRepository.js`/`authService.js`/`authStore.js`/`LoginView.vue`/`App.vue`'s
gate) wired in.
- **Not yet verified - needs real R2/Google credentials, which this session doesn't have:**
`configure-secrets.sh` itself hasn't been run against real values (no live account to
test against); the Google OAuth2 popup flow needs a real browser + a real Google Cloud
OAuth client, confirmed in README.md as a prerequisite the user sets up outside this
repo's control - curl can confirm the collection is CONFIGURED correctly, not that a
live Google consent screen round-trips. Follow-up once credentials exist: re-run
`configure-secrets.sh` for real and confirm a file actually round-trips through R2 (not
just that the PATCH to enable S3 storage succeeds).
- **Real R2/Google credentials added 2026-10-13, `configure-secrets.sh` run for real and
fully verified**, not just assumed from the script exiting cleanly: `/api/settings`
confirms `s3.enabled`/`bucket`/`endpoint` match the real R2 bucket; `/api/collections/
users` confirms `oauth2.enabled` + the `google` provider; `/api/collections/users/
auth-methods` (the exact endpoint the frontend SDK itself calls to build the OAuth2 flow)
returns a real, well-formed Google authorization URL with the actual client_id embedded.
Most importantly, an actual file was round-tripped through R2 end-to-end: created a
`documents` record with a real multipart `sourceFile` upload, then fetched it back via
PocketBase's own `/api/files/...` URL and confirmed the exact byte content came back -
proves R2 storage genuinely works, not just that the PATCH to enable it succeeded. The
one thing still unconfirmed is the live Google consent-screen round trip itself (needs a
real browser clicking through Google's own UI, not curl) - everything on this repo's own
side of that handshake is now verified correct.
- **One real catch before any of the above ran:** the user had copied `.env.example` to
`.env` and filled in real R2/Google values, but left `POCKETBASE_SUPERUSER_EMAIL`/
`_PASSWORD` as the literal placeholders (`admin@example.com`/`change-me-min-10-chars`) -
caught by checking the password's actual value against the known placeholder string
before running the superuser upsert, not assumed safe just because the field was
"filled in." That account has full admin access to every user's data and the instance's
own settings, so this was flagged and confirmed with the user before proceeding rather
than silently upserting a well-known default credential.
**Governing rule: never silently correct or exclude data.** This shows up in several
concrete places, not just as an abstract principle: