From c71a42859db33bfd783d5a9e1bc3efe82cd05f0e Mon Sep 17 00:00:00 2001 From: Anastasiya Soyka Date: Sat, 18 Mar 2023 17:32:38 +0000 Subject: [PATCH 1/2] Detect When Running as a Podman Container --- docker/rootfs/startapp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/rootfs/startapp.sh b/docker/rootfs/startapp.sh index 8cafdeb26f..d625ec2438 100644 --- a/docker/rootfs/startapp.sh +++ b/docker/rootfs/startapp.sh @@ -22,7 +22,7 @@ for jar in `ls lib/*.jar`; do CLASSPATH=${CLASSPATH}:${jar} done -if [ -f /.dockerenv ]; then +if [ -f /.dockerenv ] || [ -f /run/.containerenv ]; then echo "[startapp] Running in container" if [ -z "$IP_ADDR" ]; then export IP_ADDR=$(hostname -i) From b3188a26a5891bc248e2ca5eb08af118cce86eee Mon Sep 17 00:00:00 2001 From: obscuratus i2p Date: Sat, 18 Mar 2023 17:33:32 +0000 Subject: [PATCH 2/2] Router: Update and Clarify the Inline Documentation for VMCommSystem --- .../java/src/net/i2p/router/MultiRouter.java | 14 +++++++++----- .../net/i2p/router/dummy/VMCommSystem.java | 19 ++++++++++++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/router/java/src/net/i2p/router/MultiRouter.java b/router/java/src/net/i2p/router/MultiRouter.java index 0dc19fa5d8..18a802dc69 100644 --- a/router/java/src/net/i2p/router/MultiRouter.java +++ b/router/java/src/net/i2p/router/MultiRouter.java @@ -30,12 +30,16 @@ import net.i2p.router.Router; *
  • router.configLocation=rN/router.config
  • * * (where "rN" is an instance number, such as r0 or r9). - * Additionally, two other properties might be useful: - * The first line tells the router to use an in-VM comm system for sending - * messages back and forth between routers (see net.i2p.transport.VMCommSystem). + * + * Optionally, i2p.vmCommSystem=true can be enabled. * + * i2p.vmCommSystem=true tells the router to use an in-VM comm system for sending + * messages back and forth between routers (see net.i2p.transport.VMCommSystem). + * + * However, the default comm system implementation is usually preferred since + * enabling the VMCommSystem will bypass UDP and TCP, and therefore will not + * provide a test bed for many important I2P systems. + * * To make the router console work, either run from a directory containing * lib/, webapps/, docs/, etc., or point i2p.dir.base to a directory containing the * above. diff --git a/router/java/src/net/i2p/router/dummy/VMCommSystem.java b/router/java/src/net/i2p/router/dummy/VMCommSystem.java index 1eb5078dd2..0436730971 100644 --- a/router/java/src/net/i2p/router/dummy/VMCommSystem.java +++ b/router/java/src/net/i2p/router/dummy/VMCommSystem.java @@ -20,10 +20,23 @@ import net.i2p.router.transport.crypto.X25519KeyFactory; import net.i2p.util.Log; /** - * Hacked up in-VM comm system for talking between contexts. It doesn't even - * generate any routerAddresses, but instead tracks the peers through a singleton. + * Hacked up in-VM comm system for talking between contexts within the same Java + * virtual machine. It doesn't generate any routerAddresses, but instead tracks + * the peers through a singleton. It cannot connect to anything outside of its + * own Java VM. It does not implement TCP, UDP, and therefore no NTCP or SSU. * Currently, the comm system doesn't even inject any lag, though it could (later). - * It does honor the standard transport stats though, but not the TCP specific ones. + * It does honor the standard transport stats though, but no TCP or UDP specific + * ones (since UDP and TCP are not implemented). + * + * Typically, VMCommSystem is enabled by developers when it is desirable to + * test the router without enabling a real comm system. For a variety of + * testing purposes, it can be advantageous to start the router in a mode + * where contact with the actual network is disabled. + * + * VMCommSystem can be enabled with the following setting in the + * router.config file: + * + * i2p.vmCommSystem=true * * FOR DEBUGGING AND LOCAL TESTING ONLY. */