kubo/docs
Marcin Rataj 25ebab9dae
feat(p2p): add --foreground flag to listen and forward commands (#11099)
* feat(p2p): add --foreground flag to listen and forward commands

adds `-f/--foreground` option that keeps the command running until
interrupted (SIGTERM/Ctrl+C) or closed via `ipfs p2p close`. the
listener/forwarder is automatically removed when the command exits.

useful for systemd services and scripts that need cleanup on exit.

* docs: add p2p-tunnels.md with systemd examples

- add dedicated docs/p2p-tunnels.md covering:
  - why p2p tunnels (NAT traversal, no public IP needed)
  - quick start with netcat
  - background and foreground modes
  - systemd integration with path-based activation
  - security considerations and troubleshooting
- document Experimental.Libp2pStreamMounting in docs/config.md
- simplify docs/experimental-features.md, link to new doc
- add "Learn more" links to ipfs p2p listen/forward --help
- update changelog entry with doc link
- add cross-reference in misc/README.md

* chore: reference kubo#5460 for p2p config

Ref. https://github.com/ipfs/kubo/issues/5460

* fix(daemon): write api/gateway files only after HTTP server is ready

fixes race condition where $IPFS_PATH/api and $IPFS_PATH/gateway files
were written before the HTTP servers were ready to accept connections.
this caused issues for tools like systemd path units that immediately
try to connect when these files appear.

changes:
- add corehttp.ServeWithReady() that signals when server is ready
- wait for ready signal before writing address files
- use sync.WaitGroup.Go() (Go 1.25) for cleaner goroutine management
- add TestAddressFileReady to verify both api and gateway files

* fix(daemon): buffer errc channel and wait for all listeners

- buffer error channel with len(listeners) to prevent deadlock when
  multiple servers write errors simultaneously
- wait for ALL listeners to be ready before writing api/gateway file,
  not just the first one

Feedback-from: https://github.com/ipfs/kubo/pull/11099#pullrequestreview-3593885839

* docs(changelog): improve p2p tunnel section clarity

reframe to lead with user benefit and add example output

* docs(p2p): remove obsolete race condition caveat

the "First launch fails but restarts work" troubleshooting section
described a race where the api file was written before the daemon was
ready. this was fixed in 80b703a which ensures api/gateway files are
only written after HTTP servers are ready to accept connections.

---------

Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
2026-01-09 19:22:43 +01:00
..
changelogs feat(p2p): add --foreground flag to listen and forward commands (#11099) 2026-01-09 19:22:43 +01:00
examples fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
logo docs: kubo logo sources (#10964) 2025-09-09 15:01:52 +02:00
production doc: document reverse proxy bug 2020-06-15 17:01:40 -07:00
specifications Docs fix spelling issues (#10493) 2024-08-26 11:32:07 -07:00
add-code-flow.md Minor wording fixes in docs (#10822) 2025-05-30 15:14:37 -07:00
AUTHORS Updated authors doc 2016-08-18 11:54:48 -07:00
cli-http-api-core-diagram.png docs: README refresh, add cli-http-api-core diagram 2018-08-22 16:09:51 -07:00
command-completion.md feat: add zsh completions (#10040) 2023-08-17 16:43:27 +02:00
config.md feat(p2p): add --foreground flag to listen and forward commands (#11099) 2026-01-09 19:22:43 +01:00
content-blocking.md chore: fix typos and comment formatting (#10653) 2025-01-06 18:17:39 -08:00
customizing.md docs(customizing.md): add kubo binary imports description 2023-12-19 19:52:50 -05:00
datastores.md Minor wording fixes in docs (#10822) 2025-05-30 15:14:37 -07:00
debug-guide.md docs:added GOLOG_LOG_LEVEL to debug-guide for logging more info (#10894) 2025-08-05 16:28:09 +02:00
delegated-routing.md feat: opt-in http retrieval client (#10772) 2025-05-06 19:06:40 +02:00
developer-certificate-of-origin Add developer certificate of origin document 2017-06-26 15:36:35 -07:00
developer-guide.md docs: add developer guide for local development workflow (#11128) 2026-01-07 17:09:13 +01:00
EARLY_TESTERS.md docs: update RELEASE_CHECKLIST.md (#10496) 2024-09-11 19:06:54 +02:00
environment-variables.md feat(config): AutoConf with "auto" placeholders (#10883) 2025-08-20 05:59:11 +02:00
experimental-features.md feat(p2p): add --foreground flag to listen and forward commands (#11099) 2026-01-09 19:22:43 +01:00
file-transfer.md chore: fix typos and comment formatting (#10653) 2025-01-13 18:56:53 +01:00
fuse.md Update fuse docs with FreeBSD specifics (#10820) 2025-06-02 10:01:26 -07:00
gateway.md docs: add production deployment guidance for gateway (#11117) 2026-01-09 18:26:32 +01:00
generate-authors.sh added AUTHORS file 2015-02-11 07:42:21 -08:00
http-rpc-clients.md docs: updated links and refs to external resources (#10368) 2024-03-16 00:59:22 +01:00
implement-api-bindings.md Minor wording fixes in docs (#10822) 2025-05-30 15:14:37 -07:00
libp2p-resource-management.md Docs fix spelling issues (#10493) 2024-08-26 11:32:07 -07:00
metrics.md feat: enable DHT Provide Sweep by default (#10955) 2025-11-12 23:55:17 +01:00
p2p-tunnels.md feat(p2p): add --foreground flag to listen and forward commands (#11099) 2026-01-09 19:22:43 +01:00
plugins.md feat: telemetry plugin (#10866) 2025-08-18 20:46:05 +02:00
provide-stats.md docs: note sweep+accelerated DHT client limitation (#11084) 2025-11-28 23:10:56 +01:00
README.md docs: add developer guide for local development workflow (#11128) 2026-01-07 17:09:13 +01:00
RELEASE_CHECKLIST.md docs: update release checklist based on v0.38.0 learnings (#11007) 2025-10-09 03:27:20 +02:00
RELEASE_ISSUE_TEMPLATE.md docs: update RELEASE_CHECKLIST.md (#10496) 2024-09-11 19:06:54 +02:00
releases_thunderdome.md docs: update RELEASE_CHECKLIST.md (#10496) 2024-09-11 19:06:54 +02:00
releases.md Minor wording fixes in docs (#10822) 2025-05-30 15:14:37 -07:00
telemetry.md feat(telemetry): collect high level provide DHT sweep settings (#11056) 2025-11-13 01:28:15 +01:00
transports.md refactor: kubo in ./docs 2022-07-06 23:45:25 +02:00
windows.md docs: updated links and refs to external resources (#10368) 2024-03-16 00:59:22 +01:00

Developer Documentation and Guides

If you are looking for User Documentation & Guides, please visit docs.ipfs.tech or check General Documentation.

If youre experiencing an issue with IPFS, please follow our issue guide when filing an issue!

Otherwise, check out the following guides to using and developing IPFS:

General Documentation

Developing kubo

Guides

Advanced User Guides

Other