fix(ipfs): expose kubo swarm port so nodes are browser-dialable#45
Conversation
Stop overriding kubo's Swarm addresses (was pinning to ephemeral /tcp/0) and forward port 4001 (TCP + UDP) in all compose files. Without this, no fixed reachable swarm port means AutoTLS cannot mint a libp2p.direct cert, and browser pure-p2p clients only get relayed limited connections that libp2p refuses for identify/gossipsub/bitswap. Existing installs are NOT auto-migrated -- operators need to delete or hand-edit <data>/.bitsocial-cli.ipfs/config Swarm entries and restart. Refs #44
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughPort 4001 is added to Docker infrastructure for Kubo Swarm networking across CI, production, and example configurations. Concurrently, IPFS configuration defaults are refactored to remove Swarm settings from the Gateway section, and tests are updated to assert against a defined Kubo default Swarm array. ChangesKubo Swarm Networking Port Exposure and Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/kubo/mergeCliDefaultsIntoIpfsConfig.test.ts`:
- Around line 20-29: The test suite failure is caused by missing test dependency
"decompress" when running npm run test:cli; run npm run test:cli locally, add
the missing package to devDependencies (install "decompress") and re-run the
tests until all tests in mergeCliDefaultsIntoIpfsConfig.test.ts (which defines
kuboDefaultSwarm) pass, then commit the updated package.json/package-lock.json
so CI verification succeeds.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7bbe3323-d4a3-4545-8479-9501d0734002
📒 Files selected for processing (6)
.github/docker-compose.ci.ymlDockerfiledocker-compose.example.ymldocker-compose.ymlsrc/ipfs/startIpfs.tstest/kubo/mergeCliDefaultsIntoIpfsConfig.test.ts
| const kuboDefaultSwarm = [ | ||
| "/ip4/0.0.0.0/tcp/4001", | ||
| "/ip6/::/tcp/4001", | ||
| "/ip4/0.0.0.0/udp/4001/webrtc-direct", | ||
| "/ip4/0.0.0.0/udp/4001/quic-v1", | ||
| "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport", | ||
| "/ip6/::/udp/4001/webrtc-direct", | ||
| "/ip6/::/udp/4001/quic-v1", | ||
| "/ip6/::/udp/4001/quic-v1/webtransport" | ||
| ]; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
npm run test:cliRepository: bitsocialnet/bitsocial-cli
Length of output: 1321
Verify the test suite passes in your local environment before merging.
The npm run test:cli command failed to execute in the verification environment due to missing dependencies (decompress package). Please ensure you have run npm run test:cli in your local environment and that all tests pass before committing.
Per coding guidelines: "**/*.test.ts: MUST run tests with npm run test:cli to verify all tests pass before committing"
Also applies to: lines 32-32, 43-43
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/kubo/mergeCliDefaultsIntoIpfsConfig.test.ts` around lines 20 - 29, The
test suite failure is caused by missing test dependency "decompress" when
running npm run test:cli; run npm run test:cli locally, add the missing package
to devDependencies (install "decompress") and re-run the tests until all tests
in mergeCliDefaultsIntoIpfsConfig.test.ts (which defines kuboDefaultSwarm) pass,
then commit the updated package.json/package-lock.json so CI verification
succeeds.
…'t collide on 4001 Before this branch, mergeCliDefaultsIntoIpfsConfig overrode Swarm to /tcp/0 which (incidentally) gave each test daemon a kernel-assigned port. Now that production preserves kubo's default Swarm (port 4001), parallel test daemons spawned by vitest fileParallelism race for the same port and fail with "IPFS Swarm port 0.0.0.0:4001 already in use". Add a test helper that pre-initializes the kubo repo, applies bitsocial defaults, and rewrites Swarm to ephemeral addresses. The daemon's own `ipfs init` then bails because the config already exists, mergeCliDefaults is skipped, and kubo binds to per-process kernel-assigned ports. Refs #44
Stop overriding kubo's Swarm addresses (was pinning to ephemeral /tcp/0) and forward port 4001 (TCP + UDP) in all compose files. Without this, no fixed reachable swarm port means AutoTLS cannot mint a libp2p.direct cert, and browser pure-p2p clients only get relayed limited connections that libp2p refuses for identify/gossipsub/bitswap.
Existing installs are NOT auto-migrated -- operators need to delete or hand-edit /.bitsocial-cli.ipfs/config Swarm entries and restart.
Refs #44
Summary by CodeRabbit
Infrastructure
Tests