Openrefine: browser should go to http://localhost not http://0.0.0.0

Created on 27 Feb 2020  路  13Comments  路  Source: OpenRefine/OpenRefine

I like to open up my OpenRefine for colleagues (security? phew!),

  • set this in refine.ini: REFINE_HOST=0.0.0.0
  • or run refine.bat -i 0.0.0.0

This works fine, but after the server starts, it sends my browser to http://0.0.0.0:3333 which doesn't work. It should send me to http://localhost:3333/

bug good first issue

Most helpful comment

Let's not try to change OS variables without ever informing them through dialogs, warnings, feedback, etc. "our core philosophy" rings here again.

I am not sure what you mean? I am not proposing to rename "0.0.0.0" to "localhost" in the OS (I don't think it's possible to do that at all!).

When run with the option -i 0.0.0.0, OpenRefine should not attempt to open http://0.0.0.0:3333/ in the browser, but rather http://localhost:3333/. That is the replacement I am proposing.

All 13 comments

Really? it works fine for me.

UPDATE: Oh! you mean AFTER the server starts and the default browser is launched automatically? What browser and OS are you using by the way?

I think the relevant code is https://github.com/OpenRefine/OpenRefine/blob/998a5423db73d3e9234767b951ba73f9604b3c97/server/src/com/google/refine/Refine.java#L466

This currently always tries to open the host that the server has been explicitly bound to.

Thanks @ostephens, let's make it a good first issue since it should be easy to fix, just adding a special case translating 0.0.0.0 to localhost, no?

I tried using this, it worked fine for me. Am I missing something here?

@kushthedude You are missing the full context... this handling is very OS specific and User specific. Why? Because "localhost" is really just a label, a key. What maps that key on many OS's is the host variables handling and methods of mapping. On Linux, this is done through /etc/hosts, and technically other ways as well that are not file based. On Windows, it's done through modifying in the registry or corp policy, or through the file C:\Windows\System32\drivers\etc\hosts.

Which is why I asked the OP which browser and OS he is using, and still waiting on reply.

@wetneb Users control their own mapping. Let's not try to change OS variables without ever informing them through dialogs, warnings, feedback, etc. "our core philosophy" rings here again.

Let's not try to change OS variables without ever informing them through dialogs, warnings, feedback, etc. "our core philosophy" rings here again.

I am not sure what you mean? I am not proposing to rename "0.0.0.0" to "localhost" in the OS (I don't think it's possible to do that at all!).

When run with the option -i 0.0.0.0, OpenRefine should not attempt to open http://0.0.0.0:3333/ in the browser, but rather http://localhost:3333/. That is the replacement I am proposing.

@wetneb ah, gotcha, thanks for clarifying! Now we're all on the same page reading the same book!

You guys are amazingly quick!
I'm on Windows running Chrome.

I should say that with default settings it sent me to 127.0.0.1, but I think localhost means the same and reads a bit better.

The next question (yes, I am too demanding) is whether the server can figure out my real IP (eg 192.168.1.123 for a local network) so I can copy it from the browser address bar and actually share it with colleagues. This is very non trivial: last I looked I had 5-6 netwirk interfaces including a VPN, docker, etc.

BTW, where is a good place to document this? With a title like "Running OpenRefine as a Server" or "Sharing Your OpenRefine with Colleagues"

hi @wetneb, could you answer the last two points

  • figure out my real IP
  • where to document

The next question (yes, I am too demanding) is whether the server can figure out my real IP (eg 192.168.1.123 for a local network) so I can copy it from the browser address bar and actually share it with colleagues. This is very non trivial: last I looked I had 5-6 netwirk interfaces including a VPN, docker, etc.

I don't know how to do this - I would say this is ill-defined in general, as your "real IP" depends on the network you want to expose OR to.

BTW, where is a good place to document this? With a title like "Running OpenRefine as a Server" or "Sharing Your OpenRefine with Colleagues"

It would be nice to mention this feature here: https://github.com/OpenRefine/OpenRefine/wiki/Installation-Instructions

I think a better substitution would be the loopback address (127.0.0.1) for the wildcard address (0.0.0.0). localhost is subject to being screwed up in a variety of ways and can point anywhere.

Was this page helpful?
0 / 5 - 0 ratings