Skip to content

fix(setup): remove glob deprecation, auto-generate encryption key, fix migration verify#58

Merged
atlanticplatformgroup merged 1 commit into
mainfrom
fix/setup-polish-round-2
May 28, 2026
Merged

fix(setup): remove glob deprecation, auto-generate encryption key, fix migration verify#58
atlanticplatformgroup merged 1 commit into
mainfrom
fix/setup-polish-round-2

Conversation

@atlanticplatformgroup
Copy link
Copy Markdown
Owner

What changed

1. Replaced deprecated glob with fast-glob

  • Removed glob@11.1.0 from packages/api dependencies
  • Updated asset-usage.ts to import from fast-glob (already used elsewhere)
  • Eliminates the npm deprecation warning on install

2. Auto-generate ENCRYPTION_KEY on first setup

  • setup.mjs now generates a valid 64-character hex key via crypto.randomBytes(32) when copying .env files
  • Replaces the placeholder value so the validation warning doesn't confuse new users
  • Same key is written to both root .env and packages/api/.env

3. Fixed migration verification credentials

  • verify-migrations.mjs was hardcoding postgres:postgres which doesn't match Docker Compose credentials (oricms:oricms)
  • Now derives the admin URL from DATABASE_URL env var, using the same host/port/credentials but connecting to the postgres database
  • Fixes the P1000 auth failure on first run

4. Suppressed Prisma update nag

  • Sets PRISMA_HIDE_UPDATE_MESSAGE=1 during db:generate and db:migrate in setup.mjs
  • No more "Update available 5.22.0 -> 7.8.0" banner on first run

5. Better failure message

  • Migration verification failure now says it's usually a credentials issue and can be ignored if migrations applied successfully
  • Instead of the misleading "no PostgreSQL in environment" message

Verification

  • npm install succeeds (no glob deprecation warning)
  • npm run build -w @ori/shared succeeds
  • npm run type-check -w @ori/api succeeds
  • npm run build:check -w @ori/web succeeds

…x migration verify

- Replaces deprecated glob@11.1.0 with fast-glob@3.3.3 in packages/api
  (already used elsewhere in the project). Updates asset-usage.ts import.

- setup.mjs now generates a valid 64-character hex ENCRYPTION_KEY when
  copying .env files for the first time, eliminating the confusing
  validation warning on fresh clones.

- verify-migrations.mjs now derives admin credentials from DATABASE_URL
  instead of hardcoding postgres:postgres, fixing the auth failure
  when Docker Compose uses the oricms:oricms credentials.

- Suppresses Prisma 'Update available' nag during setup by setting
  PRISMA_HIDE_UPDATE_MESSAGE=1 for db:generate and db:migrate.

- Improves the migration verification failure message to explain that
  it's usually a credentials issue and can be ignored if migrations
  applied successfully.
@atlanticplatformgroup atlanticplatformgroup merged commit e813ff5 into main May 28, 2026
1 check failed
@atlanticplatformgroup atlanticplatformgroup deleted the fix/setup-polish-round-2 branch May 28, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant