Hodladi / Phoenixd-Server-Ui

A UI for Acinq Phoenix Server
12 stars 3 forks source link

connect to phoenixd on local network #6

Closed EdoardoSnodato closed 2 months ago

EdoardoSnodato commented 2 months ago

I want connect my smartphone (using Phoenixd-Server-Ui) to my pc phoenixd Both devices are connected on local network. How to edit phoenix.conf on my pc ?

Hodladi commented 2 months ago

Hi!

First question, are you gonna use https://pwallet.app or are you gonna self-host the UI? If https://pwallet.app then follow those steps according to that scenario.

https://pwallet.app Scenario There is a couple of issues with this setup but they can be fixed.

  1. Is your PC an always running machine connected to internet?

    • If yes, then you will need to expose the port your Phoenix Server to internet. This because pwallet.app cant reach LAN machines, only WAN machines. To expose your phoneix server to internet you firstly need to open the corresponding port in your router and point it to the machine running phoenix server. Secondly, make sure you open up the corresponding port in your PC ( i Assume windows ? )
  2. Go to https://pwallet.app and in settings enter your WAN ip ( get it from https://whatsmyip.com/ ) and the password from your phoenix.conf

Self-hosting pWallet If you self-host pwallet on the same machine as your phoenix server, then the IP can be localhost:port-of-phoenix-server and password is still the one in phoenix.conf

But to reach the UI outside your LAN you need to expose the UI in the same way as above scenario for phoenix server. the UI when you self-host it runs on port 2291

Hodladi commented 2 months ago

So simplified and i assume you are gonna use https://pwallet.app

  1. Open your phoenix.conf and make it look like this
    http-bind-ip=192.168.X.XX   <-- CHANGE THIS TO YOUR COMPUTERS LAN IP
    http-bind-port=2121 <--- CHANGE THIS TO YOUR DESIRED PORT
    http-password=abc123abc123abc123abc123 <---- THIS IS YOUR PASSWORD GENERATED BY PHOENIX SERVER
  2. Open the port you chose in windows firewall on your computer running phoneix server
  3. Go to your router settings page and port forward the port you chose and point it to your computer running the server
  4. Figure out your WAN ip, use https://whatsmyip.com/ to find out.
  5. Open https://pwallet.app in a browser, preferable chrome to install it as a PWA app on your phone or if your on android, download the apk from github repo
  6. Enter your http://WANIP:PORT in "Phoenixd server url" input in settings
  7. Enter your Phoenix Server password ( from phoenix.conf ) in "Phoenixd server password" input in settings.

Then it should work!

EdoardoSnodato commented 2 months ago
  1. I use https://pwallet.app/
  2. My pc running 24/7
  3. On pc i use Debian Linux

Question: Phoenixd use port 9740 ?

Hodladi commented 2 months ago

If you havent changed any settings from default then it uses 9740 If you run debian, make sure you open port 9740 in UFW and also point that port in your router to your pc.

EdoardoSnodato commented 2 months ago

i need study this points, i'm poor on networking

It would have been simple, if pwallet allowed connection to Local Lan Machines

Hodladi commented 2 months ago

If you want that, then you need to self-host it. Then it works over LAN.

But if you wanna reach the UI over imternet you need to open port 2291 in router. But the communication between UI and Phoenix Server can still be LAN.

But to be clear, then you don't use pwallet.app, you use your own session of the same code. pwallet.app can't reach all users LAN servers since it's hosted online and not your LAN.

And another to be clear, to reach your session you reach it through your WAN ip or pointing a domain to your WAN ip.

Screenshot_20240726_194047_Samsung Internet.jpg