-
Notifications
You must be signed in to change notification settings - Fork 231
feat: i2p support addition (#35) #499
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
cameri
merged 11 commits into
cameri:main
from
archief2910:feature/35-I2P-support-addition
Apr 18, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7983098
test(nip05): register sinon-chai for NIP-05 unit tests (#35)
archief2910 1970171
ci: validate Docker Compose overlay merges
archief2910 de828e8
feat(i2p): add i2pd sidecar and tunnel configuration(#35)
archief2910 065638c
feat(docker): pin nostream IPv4 for Tor/I2P sidecars (#35)
archief2910 67d1eb2
feat(i2p): add start/stop helpers and npm scripts (#35)
archief2910 4af3eac
docs: document I2P deployment and compose validation (#35)
archief2910 5f2dc4c
Merge branch 'main' into feature/35-I2P-support-addition
archief2910 d3b54ed
Merge branch 'main' into feature/35-I2P-support-addition
cameri 7d1e372
chore: required review changes (#35)
archief2910 3c35746
Merge branch 'feature/35-I2P-support-addition' of https://github.com/…
archief2910 80664cf
chore: required review changes by copilot (#35)
archief2910 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| services: | ||
| i2pd: | ||
| image: purplei2p/i2pd:release-2.59.0 | ||
| container_name: i2pd | ||
| depends_on: | ||
| - nostream | ||
| volumes: | ||
| - ${PWD}/.nostr/i2p/data:/home/i2pd/data | ||
| - ${PWD}/i2p/i2pd.conf:/home/i2pd/data/i2pd.conf:ro | ||
| - ${PWD}/i2p/tunnels.conf:/home/i2pd/data/tunnels.conf:ro | ||
| ports: | ||
| # i2pd web console — bound to 127.0.0.1 on the host so operators can | ||
| # look up the .b32.i2p destination without exposing router state | ||
| # to the LAN. Remove this mapping to disable host-side access. | ||
| - 127.0.0.1:7070:7070 | ||
| restart: on-failure | ||
| networks: | ||
| default: | ||
| ipv4_address: 10.10.10.252 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Minimal i2pd configuration for nostream. | ||
| # Data and keys are persisted via the Docker volume mount at /home/i2pd/data. | ||
|
|
||
| [http] | ||
| # Bind the web console on all container interfaces so Docker port forwarding | ||
| # (127.0.0.1:7070 on the host) can reach it. Host binding is restricted in | ||
| # docker-compose.i2p.yml. | ||
| address = 0.0.0.0 | ||
| port = 7070 | ||
| # Accept requests whose Host header is 127.0.0.1 (port-forwarded) or the | ||
| # container's IP. Without this, i2pd returns a "host mismatch" error. | ||
| strictheaders = false | ||
|
|
||
| [limits] | ||
| transittunnels = 256 | ||
|
|
||
| [precomputation] | ||
| elgamal = true |
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,5 @@ | ||
| [nostream] | ||
| type = http | ||
| host = 10.10.10.2 | ||
| port = 8008 | ||
| keys = nostream.dat |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| PROJECT_ROOT="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." | ||
| KEYS_FILE="${PROJECT_ROOT}/.nostr/i2p/data/nostream.dat" | ||
|
|
||
| if [ ! -f "${KEYS_FILE}" ]; then | ||
| echo "I2P destination keys not found. Is the i2pd container running?" | ||
| echo "Expected: ${KEYS_FILE}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # The .b32.i2p address is derived from a SHA-256 hash of the Destination | ||
| # inside nostream.dat, so we cannot compute it portably from the host. | ||
| # Query the running i2pd container instead. | ||
| echo "I2P destination keys exist at: ${KEYS_FILE}" | ||
| echo "" | ||
| echo "To find your nostream .b32.i2p address, use one of these methods:" | ||
| echo " 1. Open the i2pd web console: http://127.0.0.1:7070/?page=i2p_tunnels" | ||
| echo " (published by docker-compose.i2p.yml, bound to 127.0.0.1 only)" | ||
| echo " 2. Query the console from inside the container:" | ||
| echo " docker exec i2pd wget -qO- 'http://127.0.0.1:7070/?page=i2p_tunnels' \\" | ||
| echo " | grep -oE '[a-z2-7]{52}\\.b32\\.i2p' | sort -u" |
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,40 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| PROJECT_ROOT="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." | ||
| DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml" | ||
| DOCKER_COMPOSE_I2P_FILE="${PROJECT_ROOT}/docker-compose.i2p.yml" | ||
| I2P_DATA_DIR="${PROJECT_ROOT}/.nostr/i2p/data" | ||
| NOSTR_CONFIG_DIR="${PROJECT_ROOT}/.nostr" | ||
| SETTINGS_FILE="${NOSTR_CONFIG_DIR}/settings.yaml" | ||
| DEFAULT_SETTINGS_FILE="${PROJECT_ROOT}/resources/default-settings.yaml" | ||
| CURRENT_DIR="$(pwd)" | ||
|
|
||
| if [[ ${CURRENT_DIR} =~ /scripts$ ]]; then | ||
| echo "Please run this script from the Nostream root folder, not the scripts directory." | ||
| echo "To do this, change up one directory, and then run the following command:" | ||
| echo "./scripts/start_with_i2p" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ "$EUID" -eq 0 ]; then | ||
| echo "Error: Nostream should not be run as root." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -d "${NOSTR_CONFIG_DIR}" ]]; then | ||
| echo "Creating folder ${NOSTR_CONFIG_DIR}" | ||
| mkdir -p "${NOSTR_CONFIG_DIR}" | ||
| fi | ||
|
|
||
| if [[ ! -f "${SETTINGS_FILE}" ]]; then | ||
| echo "Copying ${DEFAULT_SETTINGS_FILE} to ${SETTINGS_FILE}" | ||
| cp "${DEFAULT_SETTINGS_FILE}" "${SETTINGS_FILE}" | ||
| fi | ||
|
|
||
| mkdir -p "${I2P_DATA_DIR}" | ||
|
|
||
| docker compose \ | ||
| -f "${DOCKER_COMPOSE_FILE}" \ | ||
| -f "${DOCKER_COMPOSE_I2P_FILE}" \ | ||
| up --build --remove-orphans "$@" |
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 |
|---|---|---|
| @@ -1,11 +1,15 @@ | ||
| #!/bin/bash | ||
| PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.." | ||
| set -euo pipefail | ||
|
|
||
| PROJECT_ROOT="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.." | ||
| DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml" | ||
| DOCKER_COMPOSE_TOR_FILE="${PROJECT_ROOT}/docker-compose.tor.yml" | ||
| DOCKER_COMPOSE_I2P_FILE="${PROJECT_ROOT}/docker-compose.i2p.yml" | ||
| DOCKER_COMPOSE_LOCAL_FILE="${PROJECT_ROOT}/docker-compose.local.yml" | ||
|
|
||
| docker compose \ | ||
| -f $DOCKER_COMPOSE_FILE \ | ||
| -f $DOCKER_COMPOSE_TOR_FILE \ | ||
| -f $DOCKER_COMPOSE_LOCAL_FILE \ | ||
| down $@ | ||
| -f "${DOCKER_COMPOSE_FILE}" \ | ||
| -f "${DOCKER_COMPOSE_TOR_FILE}" \ | ||
| -f "${DOCKER_COMPOSE_I2P_FILE}" \ | ||
| -f "${DOCKER_COMPOSE_LOCAL_FILE}" \ | ||
| down "$@" |
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.
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.