i2p / i2p.i2p

I2P is an anonymizing network, offering a simple layer that identity-sensitive applications can use to securely communicate. All data is wrapped with several layers of encryption, and the network is both distributed and dynamic, with no trusted parties.
https://geti2p.net
Other
1.93k stars 303 forks source link

Docker instructions out of date #41

Closed Aarkon closed 11 months ago

Aarkon commented 1 year ago

Greetings and thank you for your great work!

I have to report that I ran into issues with Docker and docker-compose lately, and I hope I‘m in the right spot here to address what I found.

So when updating today after some weeks of operation, my whole setup basically died. As I found out, the reason is that I‘m told e.g. here to mount my config to /i2p/.i2p, but now everything sits directly in /i2p inside the container. So I ended up with an ignored folder where my config etc. sits and stuff like router.config is duplicated in i2p but only contains very brief defaults, so nothing works.

Pinning the image in my docker-compose.yaml like so does the trick for now: image: geti2p/i2p:i2p-i2p-2.1.0 This way though, I‘m cut off from updates etc., so I‘d rather know how I‘m supposed to mount my config etc. into the container - over time, my .i2p folder accumulated some stuff and mounting every file manually into the container doesn‘t seem feasible to me.

Again, thanks for the effort of maintaining this for already two decades, and regards!

Aarkon commented 1 year ago

The general idea was that you would store your config directories on a docker mount and just update the entire image.

Thanks for tuning in! Updating the entire image is just what I did. My compose file is pretty much identical to the one from the docs, but for the sake of completeness (just adapted the paths I mount into the container slightly for public display), let me clarify:

version: "3.5"
services:
  i2p:
    container_name: i2p
    restart: unless-stopped
    image: geti2p/i2p:i2p-i2p-2.1.0
    volumes:
      - "config/i2p:/i2p/.i2p"
      - "torrents:/i2psnark"
    ports:
      - 54321:12345
      - 54321:12345/udp
      - 4444:4444
      - 4445:4445
      - 7657:7657

With that Image, the onlyrouter.config lives in /i2p/.i2p like it used to be. When unpinning the version by changing the image tag to just image: geti2p/i2p and updating with docker-compose pull, I get the above issue where the service in the container expects to find the router.config directly under /i2p and gives me a file with merely three lines of content, listing only a few default port configurations.

TheGreatestJannet commented 1 year ago

Can we reopen this? It looks like that commit didn't solve the issue. If I use anything newer that geti2p/i2p:i2p-i2p-2.1.0 the webui is not available on 7657. Rolling back to 2.1.0 without changing anything in the config fixes the issue.

version: "3.5"
services:
    i2p:
        image: geti2p/i2p:i2p-i2p-2.1.0
        ports:
            - 4444:4444
            - 7657:7657
            - 4445:4445
            - 6668:6668
            - 54321:12345
            - 54321:12345/udp
        volumes:
            - ./i2pconfig:/i2p/.i2p
            - ./i2ptorrents:/i2psnark
        environment:
            - IP_ADDR=0.0.0.0
        restart: unless-stopped
eyedeekay commented 1 year ago

Reopening because people are still reporting it, not sure what's going on yet as it is working for me at the moment.

eyedeekay commented 1 year ago

Please test using the latest checkin:

git clone https://github.com/i2p/i2p.i2p
cd i2p.i2p
docker build -t geti2p/i2p .

and run with:

version: "3.5"
services:
    i2p:
        image: geti2p/i2p
        ports:
            - 4444:4444
            - 7657:7657
            - 4445:4445
            - 6668:6668
            - 54321:12345
            - 54321:12345/udp
        volumes:
            - ./i2pconfig:/i2p/.i2p
            - ./i2ptorrents:/i2psnark
        environment:
            - IP_ADDR=0.0.0.0
        restart: unless-stopped
bedaro commented 1 year ago

I think the problem is in startapp.sh. Near the bottom, the variable JAVAOPTS is defined but then JAVA_OPTS is referenced. This causes the jar to be started without a i2p.dir.config set, and a bunch of configuration gets created at /root/.i2p instead of at /i2p/.i2p. A router.config gets created there instead, while other stuff still gets referenced in /i2p/.i2p.

When I go into the docker image and remove the underscore from JAVA_OPTS it works as expected.

eyedeekay commented 1 year ago

Oops, here I am with the fix not checked in. That doesn't do anybody any good. Sorry guys about that, thanks @bedaro for calling my attention to it.

bedaro commented 1 year ago

The latest image worked on my existing config without modification. I haven't tested with a clean slate though