feat/google-oauth-and-dev-naming #8
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/google-oauth-and-dev-naming"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Drop the redundant `mokosh-` segment from the compose service key (the project name `dev-mokosh` already carries the app name; the final container name remains `dev-mokosh-server-${USER}`). Add an explicit `container_name:` to every service so the user postfix lands consistently when multiple developers share a host, and append matching `-${USER}` suffixes to every volume and to the private network. The justfile `dev` recipe now captures `whoami` and writes `USER=...` into .env so subsequent compose commands (down/clean) see the same value. This is the rename half of the feat/google-oauth-and-dev-naming branch; OAuth changes follow in a separate commit on top. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>The OAuth verification was blocked by a cascade rooted in the host-postgres dependency: dev-mokosh-server-${USER} would panic on startup with "Failed to connect to database: Network is unreachable" because it was trying to reach a host PostgreSQL via host.docker.internal, which either was not running or not bound to the docker bridge. Because the server container exited, the compose network had no `server` DNS entry, and the Dioxus dev-server proxy (`/api/*` -> `http://server:4301/`) failed with "Name or service not known", surfacing as the OAuth popup error. Move the app DB into compose as a new top-level `postgres` service named `dev-mokosh-postgres-${USER}`, published to the host on `${MOKOSH_HOST_BIND_IP}:${MOKOSH_PG_HOST_PORT:-5433}` so `sqlx-cli` (host-side) still works. The server reaches it via in-network DNS at `postgres:5432`. `DATABASE_URL_IN_CONTAINER` and the `host.docker.internal` `extra_hosts` entry are removed; the container-side DSN is composed inline in compose.dev.yml from MOKOSH_PG_*. .env.dev / .env.example / README.md updated. Also folds in the Dockerfile + crates volume fixes for the new `google-oauth-flow` workspace member: cache layer now copies `crates/google-oauth-flow/Cargo.toml` and stubs an empty `lib.rs` so cargo can resolve the workspace before sources are mounted, and compose mounts `./crates` at runtime. Cargo.lock updated for the OAuth dep tree (oauth2, cookie, thiserror). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Three small follow-ups discovered during OAuth end-to-end verification: - Convert all `:param` route segments to `{param}`. Adding `oauth2` re-resolved Cargo.lock and bumped axum to 0.8.9, which (unlike 0.8.3 used previously) panics on the legacy 0.7-style colon-prefixed capture syntax. Affected: src/api/router.rs, src/modules/auth/routes.rs, src/modules/contacts/routes.rs, src/modules/tenants/routes.rs, src/modules/tickets/routes.rs. - Switch `axum::serve(listener, router)` to `axum::serve(listener, router.into_make_service_with_connect_info::<SocketAddr>())` so the existing `ConnectInfo<SocketAddr>` extractors in `login` and the new `google_callback` actually resolve. Without this the OAuth callback returns 500 with "Missing request extension: Extension of type ConnectInfo... was not found". - Strip the dependency-cache pre-build step from the dev Dockerfile. The stub-source pre-build was leaving `target/` fingerprints that confused cargo into a no-op rebuild on first container start (silent exit 0 with no output). Container start now does a single ~45s full compile against bind-mounted source; the persisted target volume caches it for subsequent restarts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>