org-roam / org-roam-ui

A graphical frontend for exploring your org-roam Zettelkasten
GNU General Public License v3.0
1.99k stars 109 forks source link

Question: How to set it from `localhost` to machine name / IP address? #293

Open frankjonen opened 1 year ago

frankjonen commented 1 year ago

I want to use the UI from my iPad as a reference tool.

However when I try to access the server with anything other than the home loopback, it can't be found. What parameter do I need to set so it works normally across the network?

Thanks.

wylited commented 1 year ago

I'm not an expert at org-roam-ui, I've only recently started using it. I believe you can set the host under next.config.js as

host: '0.0.0.0'

So that it will listen to all networks.

Then you have to open your own host machine's firewall on port 35901 I use ufw so it looks like

ufw allow 35901/tcp
ufw allow 35901/udp

I also believe you will need to edit the org-roam-ui.el file and change the websocket server from localhost to 0.0.0.0

at org-roam-ui.el here

You may also need to port forward 35901 on your router to make it accessible.

I really hope this helps (or works, I haven't had the time to test it) If one of the maintainers sees this, and I am wrong, I apologize.

frankjonen commented 1 year ago

I tried a bunch of things now and all only resulted in errors. So I wrote a quick forwarder in Go. It's here if someone wants it.

digitables commented 1 year ago

I tried a bunch of things now and all only resulted in errors. So I wrote a quick forwarder in Go. It's here if someone wants it.

Hey there, this doesn't seem to work. I'm attempting to run my Org-Roam through a VPS via nginx so I can access it anywhere, but the JS seems to have 'localhost' hardcoded. I don't know how NPM projects work so I don't know how to fix it.

frankjonen commented 1 year ago

Oh sorry, I forgot to follow this up. I got the UI to render and didn't have much time that day to check further.

I think it's because it does local file-system stuff in a way that can't be routed. My solution for now is to shop around for a school/edu laptop that can run Emacs well enough without being obnoxious to the wallet (I don't like laptops).