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
45 changes: 0 additions & 45 deletions .env.docker.dev.example

This file was deleted.

26 changes: 0 additions & 26 deletions .env.docker.prod.example

This file was deleted.

4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
# ── Backend API URL (Kong API gateway behind Traefik) ─────────────────────
VITE_API_URL=http://api-dev.velobits.dev

# ── Keycloak OIDC (auth provider — Velobits-Dev realm) ────────────────────
# ── Keycloak OIDC (auth provider — Velobits realm) ────────────────────
VITE_KEYCLOAK_URL=http://auth-dev.velobits.dev
VITE_KEYCLOAK_REALM=Velobits-Dev
VITE_KEYCLOAK_REALM=Velobits
VITE_KEYCLOAK_CLIENT_ID=develop-fixmytext

# ── Sentry (error tracking) ───────────────────────────────────────────────
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
VITE_API_URL: ${{ vars.VITE_API_URL }}
VITE_KEYCLOAK_URL: ${{ vars.VITE_KEYCLOAK_URL }}
# Realm must be passed explicitly — app-core silently falls back to the
# DEV realm (Velobits-Dev) when unset (keycloakConfig.ts).
# DEV realm (Velobits) when unset (keycloakConfig.ts).
VITE_KEYCLOAK_REALM: ${{ vars.VITE_KEYCLOAK_REALM }}
VITE_KEYCLOAK_CLIENT_ID: ${{ vars.VITE_KEYCLOAK_CLIENT_ID }}
VITE_KEYCLOAK_ENABLED_PROVIDERS: ${{ vars.VITE_KEYCLOAK_ENABLED_PROVIDERS }}
Expand Down
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ dist/
build/

# ── Environment files (never commit secrets) ──────────────────────────────────
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.docker.dev
.env.docker.prod
.env*
!.env.example

# ── Logs ───────────────────────────────────────────────────────────
npm-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ at `http://develop-fixmytext.velobits.dev` with path-based routing.
| ------------------------- | -------- | ------------------------------ | ------------------------------------------------ |
| `VITE_API_URL` | Yes | `http://api-dev.velobits.dev` | Backend API base URL (Kong gateway) |
| `VITE_KEYCLOAK_URL` | Yes | `http://auth-dev.velobits.dev` | Keycloak server base URL (realm path is derived) |
| `VITE_KEYCLOAK_REALM` | Yes | `Velobits-Dev` | Keycloak realm name |
| `VITE_KEYCLOAK_REALM` | Yes | `Velobits` | Keycloak realm name |
| `VITE_KEYCLOAK_CLIENT_ID` | Yes | `develop-fixmytext` | Keycloak client ID |

### `apps/content` (Next.js)
Expand Down
21 changes: 12 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ services:
volumes:
- .:/app
- /app/node_modules
env_file: .env.docker.dev
env_file: .env
restart: unless-stopped

# ── Shell — prod ───────────────────────────────────────────────────────────────
Expand All @@ -76,7 +76,7 @@ services:
VITE_EDITOR_REMOTE_ENTRY: ${VITE_EDITOR_REMOTE_ENTRY:-http://localhost:3000/remotes/editor/remoteEntry.js}
VITE_ANALYTICS_REMOTE_ENTRY: ${VITE_ANALYTICS_REMOTE_ENTRY:-http://localhost:3000/remotes/analytics/remoteEntry.js}
container_name: fixmytext-shell-prod
env_file: .env.docker.prod
env_file: .env.prod
restart: unless-stopped
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://localhost:8080']
Expand All @@ -98,7 +98,7 @@ services:
volumes:
- .:/app
- /app/node_modules
env_file: .env.docker.dev
env_file: .env
restart: unless-stopped

# ── Editor Remote — prod ───────────────────────────────────────────────────────
Expand All @@ -111,7 +111,7 @@ services:
APP_WORKSPACE: '@velobits/editor-remote'
APP_PATH: 'apps/editor-remote'
container_name: fixmytext-editor-prod
env_file: .env.docker.prod
env_file: .env.prod
restart: unless-stopped

# ── Analytics Remote — dev ─────────────────────────────────────────────────────
Expand All @@ -128,7 +128,7 @@ services:
volumes:
- .:/app
- /app/node_modules
env_file: .env.docker.dev
env_file: .env
restart: unless-stopped

# ── Analytics Remote — prod ────────────────────────────────────────────────────
Expand All @@ -141,7 +141,7 @@ services:
APP_WORKSPACE: '@velobits/analytics-remote'
APP_PATH: 'apps/analytics-remote'
container_name: fixmytext-analytics-prod
env_file: .env.docker.prod
env_file: .env.prod
restart: unless-stopped

# ── Content — dev ──────────────────────────────────────────────────────────────
Expand All @@ -156,7 +156,7 @@ services:
volumes:
- .:/app
- /app/node_modules
env_file: .env.docker.dev
env_file: .env
environment:
# Server-side fetches (apps/content/lib/api.ts) run inside this container,
# where Kong's host-published 127.0.0.1:8000 is unreachable — talk to Kong
Expand All @@ -175,7 +175,7 @@ services:
context: .
dockerfile: docker/Dockerfile.content.prod
container_name: fixmytext-content-prod
env_file: .env.docker.prod
env_file: .env.prod
restart: unless-stopped
healthcheck:
# The app 307-redirects / to /app (owned by the shell via the router), so a
Expand All @@ -198,5 +198,8 @@ services:
# joins it so server-side rendering can reach Kong at http://kong:8000.
networks:
backend:
name: backend_fixmytext-net
name: fixmytext-backend_fixmytext-net
external: true
infrastructure:
name: velobits-net
external: true
2 changes: 1 addition & 1 deletion docs/cloudflare-pages-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ created automatically by its first deploy — nothing to pre-create for develop.
VITE_EDITOR_REMOTE_ENTRY = https://<that-env's-router-host>/remotes/editor/remoteEntry.js
VITE_ANALYTICS_REMOTE_ENTRY = https://<that-env's-router-host>/remotes/analytics/remoteEntry.js
VITE_API_URL / VITE_KEYCLOAK_URL (per-env backend)
VITE_KEYCLOAK_REALM # ⚠ falls back to Velobits-Dev if unset — always set on production
VITE_KEYCLOAK_REALM # ⚠ falls back to Velobits if unset — always set on production
VITE_KEYCLOAK_CLIENT_ID / VITE_KEYCLOAK_ENABLED_PROVIDERS / VITE_SSO_DOMAIN_MAP
SENTRY_ORG
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Both profiles use the **same service names** (`editor-remote`, `analytics-remote
```
VITE_API_URL=http://api-dev.velobits.dev
VITE_KEYCLOAK_URL=http://auth-dev.velobits.dev
VITE_KEYCLOAK_REALM=Velobits-Dev
VITE_KEYCLOAK_REALM=Velobits
VITE_KEYCLOAK_CLIENT_ID=develop-fixmytext
VITE_USE_REMOTES=true
VITE_EDITOR_REMOTE_ENTRY=http://localhost:3000/remotes/editor/remoteEntry.js
Expand Down
6 changes: 3 additions & 3 deletions packages/app-core/src/auth/keycloakConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
// Both the oidc-client-ts UserManager (userManager.ts) and the raw Keycloak
// URL builders (the shell's ForgotPasswordPage) read from here. Keeping one
// copy avoids the class of bug where userManager pointed at
// Velobits-Dev/develop-fixmytext while another URL builder defaulted to a
// Velobits/develop-fixmytext while another URL builder defaulted to a
// stale localhost:8080/fixmytext realm — silently breaking password reset
// (and any other direct Keycloak link) whenever a VITE_KEYCLOAK_* var was
// unset.
//
// Defaults target the Velobits-Dev realm at auth-dev.velobits.dev (resolved via
// Defaults target the Velobits realm at auth-dev.velobits.dev (resolved via
// /etc/hosts in local dev). Production overrides via:
// VITE_KEYCLOAK_URL = https://auth.velobits.dev
// VITE_KEYCLOAK_REALM = Velobits-Prod
// VITE_KEYCLOAK_CLIENT_ID = fixmytext
export const KEYCLOAK_URL = import.meta.env.VITE_KEYCLOAK_URL ?? 'http://auth-dev.velobits.dev';
export const KEYCLOAK_REALM = import.meta.env.VITE_KEYCLOAK_REALM ?? 'Velobits-Dev';
export const KEYCLOAK_REALM = import.meta.env.VITE_KEYCLOAK_REALM ?? 'Velobits';
export const KEYCLOAK_CLIENT_ID = import.meta.env.VITE_KEYCLOAK_CLIENT_ID ?? 'develop-fixmytext';
Loading