Skip to content

feat: i2p support addition (#35)#499

Merged
cameri merged 11 commits intocameri:mainfrom
archief2910:feature/35-I2P-support-addition
Apr 18, 2026
Merged

feat: i2p support addition (#35)#499
cameri merged 11 commits intocameri:mainfrom
archief2910:feature/35-I2P-support-addition

Conversation

@archief2910
Copy link
Copy Markdown
Contributor

Description

This pull request adds I2P access to Nostream using the same pattern as Tor: an i2pd sidecar that exposes the relay’s WebSocket port over the I2P network. No application-level I2P code is required; routing is handled entirely in Docker.

Changes include:

  • docker-compose.i2p.ymlpurplei2p/i2pd service with persisted data volume and a fixed IPv4 on the compose network for predictable peering with the relay container.
  • i2p/i2pd.conf and i2p/tunnels.conf — minimal router limits and an HTTP server tunnel targeting the Nostream service (aligned with the static address assigned to nostream in the base compose file).
  • Scriptsscripts/start_with_i2p and scripts/print_i2p_hostname, plus updates to scripts/stop so teardown includes the I2P overlay when used.
  • Documentation.env.example, CONFIGURATION.md, and README.md updated with operator-facing instructions.
  • npm scriptsi2p:docker:compose:start, i2p:hostname, i2p:docker:compose:stop (mirroring the Tor scripts).
  • CI / toolingscripts/verify-compose-overlays.mjs (and shell wrapper) to ensure docker-compose.yml merges cleanly with Tor and I2P overlays; workflow job runs this in CI.

Related Issue

Closes #35

Motivation and Context

Nostream already supports Tor via a sidecar. Operators who prefer or require I2P for censorship-resistant access should be able to run the relay behind i2pd without forking or patching application code. This change documents and automates that deployment path and keeps compose overlays merge-safe as the stack evolves.

How Has This Been Tested?

  • npm run build:check — TypeScript compiles.
  • npm run lint — Biome lint passes (warnings only in unrelated upstream files if any).
  • npm run test:unit — full unit suite passes.
  • npm run compose:validate — verifies docker compose config for:
    • base + I2P
    • base + Tor
    • base + Tor + I2P
  • Manual smoke (Docker): i2pd image pulled and run with mounted configs; tunnel nostream appeared in the i2pd web UI with a .b32.i2p destination forwarding to the relay port, confirming the sidecar and tunnel config are active (not dead configuration).

Environment: Windows / Docker Desktop and Linux-compatible compose; scripts follow the same conventions as the existing Tor helpers.

Screenshots (if appropriate)

N/A

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes. (Compose validation + existing test suite; I2P is primarily Docker-side.)
  • All new and existing tests passed.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 18, 2026

Coverage Status

coverage: 68.349% (+2.5%) from 65.886% — archief2910:feature/35-I2P-support-addition into cameri:main

@archief2910 archief2910 force-pushed the feature/35-I2P-support-addition branch from 2057f5d to 5f2dc4c Compare April 18, 2026 17:50
@archief2910 archief2910 changed the title Feature: i2p support addition (#35) Feat: i2p support addition (#35) Apr 18, 2026
@archief2910
Copy link
Copy Markdown
Contributor Author

hey @cameri , i removed the local ci checks for the docker compose i2p and tor testing. you can check once.

@cameri cameri requested a review from Copilot April 18, 2026 18:29
@cameri cameri self-assigned this Apr 18, 2026
@cameri cameri changed the title Feat: i2p support addition (#35) feat: i2p support addition (#35) Apr 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an I2P access path for Nostream via a Docker Compose sidecar (i2pd), mirroring the existing Tor sidecar approach, plus operator scripts and docs to run/inspect the setup.

Changes:

  • Added an i2pd compose overlay and minimal I2P router/tunnel configuration files.
  • Added helper scripts + npm scripts to start with I2P and guide hostname discovery; updated stop script to include the I2P overlay.
  • Updated docs and base compose networking (static IP) to support the tunnel target.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/unit/utils/nip05.spec.ts Enables sinon-chai assertions in the NIP-05 unit tests.
scripts/stop Includes the I2P compose overlay during teardown.
scripts/start_with_i2p New start helper for running the stack with the I2P overlay.
scripts/print_i2p_hostname New helper output for locating the I2P destination/hostname.
package.json Adds npm script aliases for I2P start/stop/hostname (mirrors Tor).
i2p/tunnels.conf Defines an i2pd tunnel that forwards to the relay WebSocket port.
i2p/i2pd.conf Minimal i2pd runtime configuration for the sidecar.
docker-compose.yml Assigns a static IP to nostream to match the I2P tunnel target.
docker-compose.i2p.yml New compose overlay adding the i2pd sidecar with static IP + persisted data/config mounts.
README.md Adds quick-start instructions for I2P; removes a stray separator line.
CONFIGURATION.md Documents I2P sidecar-based operation and where configs/keys live.
.env.example Adds operator notes for enabling I2P via the helper script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/start_with_i2p Outdated
Comment thread scripts/print_i2p_hostname Outdated
Comment thread docker-compose.i2p.yml
Comment thread scripts/stop Outdated
@cameri
Copy link
Copy Markdown
Owner

cameri commented Apr 18, 2026

@archief2910 please address copilot comments

@archief2910
Copy link
Copy Markdown
Contributor Author

hey @cameri , i resolved the comments . you can check once

@cameri cameri merged commit 3543d6c into cameri:main Apr 18, 2026
13 checks passed
@archief2910 archief2910 deleted the feature/35-I2P-support-addition branch April 18, 2026 19:45
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.

[FEATURE] Add I2P Support to Nostream

4 participants