Cameron-IPFSPodcasting / podcastnode-Umbrel

Umbrel IPFS Podcast Node for IPFSPodcasting.net
GNU General Public License v3.0
6 stars 3 forks source link

Option to see the IPFS WebUI #3

Open suorcd opened 2 years ago

suorcd commented 2 years ago

Since the IPFS Web GUI is probably already running, it would be nice to have the option to see that exposed on the Umbrel node.

Cameron-IPFSPodcasting commented 2 years ago

I tried to expose the IPFS UI in the initial release, but the Umbrel guys had an issue with two ports exposed for user interfaces. http://umbrel.local:8675/ for the podcasting client, plus http://umbrel.local:5001/ for the IPFS UI.

There was also a CORS issue with the IPFS UI. IPFS locks it down to localhost and warns you about remote access (https://docs.ipfs.io/reference/http/api/). Umbrel was worried also. Here is that thread. https://github.com/getumbrel/umbrel/pull/1356#pullrequestreview-969505267 I removed the IPFS UI to get it in the app store.

I suppose if there's a way to make it secure & use the same port (8675), it could be added to the UI.

Cameron-IPFSPodcasting commented 2 years ago

There's a "hack" to expose it on your Umbrel (for anyone who wants to try)

Login to the umbrel & edit docker-compose.yml.

ssh umbrel.local
nano ~/umbrel/app-data/ipfs-podcasting/docker-compose.yml

Add 5001:5001 in the ports section...

    ports:
      - ${APP_IPFS_PODCASTING_P2P_PORT}:4001  # IPFS
      - 5001:5001

Save, then login to the docker environment...

docker exec -ti ipfs-podcasting_web_1 bash

Get your IP address with "ifconfig". Then run the following commands (put the docker IP address in the 3rd command)...

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
ipfs config --json Addresses.API '["/ip4/127.0.0.1/tcp/5001", "/ip4/<dockerIPaddress>/tcp/5001"]'

"exit" the docker container.

Stop and restart the app..

~/umbrel/scripts/app stop ipfs-podcasting
~/umbrel/scripts/app start ipfs-podcasting

You should now be able to load the IPFS UI from http://umbrel.local:5001/webui/

suorcd commented 2 years ago

Those instructions worked

suorcd commented 2 years ago

On a related note, I was updating the wrong docker-compose.yml; i was editing the side loaded one not the one in app-data. I now have UDP 0.0.0.0:4001->4001/tcp, 0.0.0.0:5001->5001/tcp, 0.0.0.0:4001->4001/udp, 8675/tcp

suorcd commented 2 years ago

Another ignore-able tangent

This might be too much at the moment, but what about 2 Apps. Moving to the IPFS to its own Umbrel App and connecting to it via the IPFS python toolkit. This could default to making to requiring the IPFS app, but also have the possibility of connecting to a IPFS node outside of Umbrel.

suorcd commented 2 years ago

when running ipfs-podcasting# ipfs config --json Addresses.API '["/ip4/127.0.0.1/tcp/5001", "/ip4/10.21.21.93/tcp/5001"]' I used the containers ip address, not the umbrel host ip.

using ipfs diag sys you can get the containers IP address, with some parsing.

Cameron-IPFSPodcasting commented 2 years ago

I used the containers ip address, not the umbrel host ip.

That's correct. The 10.21.21.93 container IP is where you want to listen (open port 5001) The Umbrel host IP (umbrel.local) is where the CORS/security issue shows up. It acts like a proxy to your LAN (so any IP can access the API).

Moving to the IPFS to its own Umbrel App and connecting to it via the IPFS python toolkit.

Looked into using an existing IPFS docker image, but it seemed really complicated. : ) And would also confuse the users about what files are being used for IPFS Podcasting.