Commit Graph
3 Commits
Author SHA1 Message Date
CatoandClaude Opus 5 3e6c202c59 refactor(config): the deploy target is configuration, not a literal (#1061)
Three hardcoded things in a public repo, each of which is someone else's
value baked into the source.

The box address had a literal fallback in five places: the CD workflow and
four operational shell scripts. A fallback literal guarantees the variable
is never exercised — if the variable were missing or wrong, every run would
still succeed against the baked-in address and nobody would find out until
the address changed. So:

  - cd.yml takes the address from vars.OC_BOX, or root@ the HETZNER_IP
    variable, and a new guard step fails the run with ::error:: when the
    result is empty. The ssh-keyscan and ssh-config host now derive from
    the host half of OC_BOX instead of repeating the literal, so the two
    cannot drift apart silently.
  - apply-migrations.sh, db/dump-live-schema.sh, db/gen-types.sh and
    deploy-selfhost.sh use ${OC_BOX:?...}: they stop with one clear line
    instead of reaching for a default. The two of them invoked by the
    deploy script are already passed OC_BOX explicitly, and the workflow
    sets it in the job env, so the configured path is unchanged.

An audit log was committed under logs/ in 2025-10 with 14 absolute paths
from a developer's machine. Nothing in the repo reads it (the only mentions
of the filename are inside the file itself). The `logs/` ignore rule was
added five days after the file, so it never applied to it — removed, and
the rule now says why, because ignoring a directory does not untrack what
is already inside it.

scripts/db/setup-db.ts signed in as a personal email address written into
the source. It now reads USER_EMAIL, matching the USER_PASSWORD it already
read, and exits with a clear message when unset.

Verified: bash -n on all four scripts and each one run with OC_BOX unset
(exit 1, clear message); the workflow parses and the guard step is in
place; pnpm run type-check:scripts green; prettier clean; the two unit
tests that read deploy-selfhost.sh pass.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:07:48 -07:00
GandMao Nakamoto 8bc3cc5ba6 fix(messages,privacy): stop the People Picker from republishing email-derived handles (#854)
Visitor feedback on /messages: the New Message picker's default
suggestion list showed accounts like "georgy.butaev+ocauth1
@georgy.butaev+ocauth1" — real email local-parts published as public
handles, visible to any logged-in user. This is the leak fixed at the
two known signup paths in 20260826130000_stop_deriving_usernames_from_email.sql
and ProfileServerService.ensureProfile() — but not every account is
through the (deliberately manual, not-automatic) backfill script yet,
and two more write paths still minted the same leak independently:

- scripts/db/setup-db.ts hardcodes a sign-in as butaeff@gmail.com and
  upserts username: email.split('@')[0] on every run — almost
  certainly the actual source of the "+ocauth1"/"+ocauth2" test
  accounts in the report (butaeff is one of them).
- scripts/db/reset-user-password.js upserts username: email verbatim
  (the full address, not just the local part) for its fixture account.

Both now use the same neutral-username shape as the fixed paths
(neutralUsernameFor in the .ts script; the equivalent inlined in the
plain .js one, which can't import it).

For accounts already leaked and not yet backfilled: added
isEmailDerivedHandle() (src/config/public-directory.ts, same predicate
and .invalid exception as the SQL side's count_email_derived_usernames())
and wired it into GET /api/profiles to hide a still-leaking handle from
the *default* (no search term) suggestion list — the surface this was
reported from. An explicit search still finds the person; this isn't a
substitute for renaming their handle, which needs
scripts/rename-email-derived-usernames.sql run against production by
someone with DB access (noted in the session handoff, not in scope for
this dispatch — no live Supabase credentials in this sandbox).

Also: NewConversationModal's picker row showed name and @username
duplicated whenever a profile has no display name (title already falls
back to the handle) — pure noise, worse on narrow screens where both
lines truncate. Now the @handle line only renders when it adds
information beyond the title.

Co-authored-by: Mao Nakamoto <maonakamoto@users.noreply.github.com>
2026-08-30 01:16:20 +00:00
Your NameandClaude 2872828779 chore: version 0.1.1 deployment - fix configuration and dependencies
- Bump version to 0.1.1 for tracking
- Add webpack-bundle-optimizer script for Next.js config
- Simplify ESLint configuration to resolve missing dependencies
- Prepare for production deployment with proper version control

This deployment includes:
- Profile update fixes with banner_url support
- LN address validation
- Auth cookie fixes for profile updates
- Various documentation and testing improvements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 09:30:45 +02:00