-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix(setup,compose): bundle Redis, fix socket reconnect, and harden the setup wizard #5964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
dcd5733
feat(compose,setup): bundle Redis, always configure it, fix lifecycle…
TheodoreSpeaks 47fcf93
fix(setup): don't start managed Postgres with a password the volume w…
TheodoreSpeaks 2243cc5
improvement(setup): default to Docker Compose and sharpen the run-mod…
TheodoreSpeaks 6a093c3
fix(compose): point the browser socket at :3002 so it stops reconnecting
TheodoreSpeaks 6eec210
feat(setup): pass SIM_AGENT_API_URL through, and warn on a half-set m…
TheodoreSpeaks 54aadbf
fix(setup): survive a vanished port owner, and stop flagging our own …
TheodoreSpeaks a28f49f
fix(csp,setup): permit the socket origin the client actually uses; en…
TheodoreSpeaks ccac475
improvement(setup): make k8s mode end somewhere usable, and show inst…
TheodoreSpeaks bb2fd2a
fix(setup): identify Sim compose projects by content, not filename
TheodoreSpeaks 1c5443e
fix(setup): scope the compose port skip to published ports; print bot…
TheodoreSpeaks 02e93d8
fix(setup): one source for the k8s forwards, and surface a dead realt…
TheodoreSpeaks 4550411
fix(setup): pin the compose project on every lifecycle op
TheodoreSpeaks 84d9fe9
fix(setup): warn on both halves of a mothership mismatch
TheodoreSpeaks 910f367
fix(setup): warn about a half-set mothership before minting the key
TheodoreSpeaks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * @vitest-environment node | ||
| * | ||
| * The bundled docker-compose stack runs NODE_ENV=production, serves the app from | ||
| * localhost, and leaves NEXT_PUBLIC_SOCKET_URL unset. getSocketUrl() falls back | ||
| * to localhost:3002 for a localhost page regardless of NODE_ENV, so the CSP has | ||
| * to permit that origin or the browser blocks the handshake and Socket.IO | ||
| * retries forever. Its own file because vi.mock is hoisted per-module and the | ||
| * sibling suite needs NEXT_PUBLIC_SOCKET_URL set. | ||
| */ | ||
| import { createEnvMock } from '@sim/testing' | ||
| import { describe, expect, it, vi } from 'vitest' | ||
|
|
||
| vi.mock('@/lib/core/config/env', () => | ||
| createEnvMock({ | ||
| NEXT_PUBLIC_APP_URL: 'http://localhost:3000', | ||
| NEXT_PUBLIC_SOCKET_URL: undefined, | ||
| }) | ||
| ) | ||
|
|
||
| vi.mock('@/lib/core/config/env-flags', () => ({ | ||
| isDev: false, | ||
| isHosted: false, | ||
| isReactGrabEnabled: false, | ||
| })) | ||
|
|
||
| import { generateRuntimeCSP } from './csp' | ||
|
|
||
| describe('generateRuntimeCSP — socket fallback on a localhost origin', () => { | ||
| it('permits the default socket origin when NEXT_PUBLIC_SOCKET_URL is unset', () => { | ||
| const csp = generateRuntimeCSP() | ||
|
|
||
| expect(csp).toContain('http://localhost:3002') | ||
| expect(csp).toContain('ws://localhost:3002') | ||
| }) | ||
|
|
||
| it('keeps the socket sources inside connect-src', () => { | ||
| const connectSrc = generateRuntimeCSP() | ||
| .split(';') | ||
| .map((directive) => directive.trim()) | ||
| .find((directive) => directive.startsWith('connect-src')) | ||
|
|
||
| expect(connectSrc).toBeDefined() | ||
| expect(connectSrc).toContain('ws://localhost:3002') | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.