nbdime icon indicating copy to clipboard operation
nbdime copied to clipboard

Listening on a different IP nbdimeserver

Open Dateez opened this issue 4 years ago • 3 comments

Hello, i'm currently working on jupyter hub but connected to another machine (server) which is shared with other people and does not allow Web based diffing/merging, for this reason i get the following message when trying to use diff-web:

[I nbdimeserver:423] Listening on 127.0.0.1, port 33523 [W webutil:18] No web browser found: could not locate runnable browser. [I webutil:29] URL: http://127.0.0.1:33523/difftool

i want to set nbdime to listen on another IP to solve this issue not on local host, therefore i set the nbdime_config.json as follows:

{"NbDiffWeb": {"ip": "xxx.xx.x.xx"}, "NbMergeWeb": {"ip": "xxx.xx.x.xx"}, "Server": {"ip": "xxx.xx.x.xx"},"NbDiffTool": {"ip": "xxx.xx.x.xx"}, "NbMergeTool": {"ip": "xxx.xx.x.xx"}}

from nbdime --config the changes seem to have taken place but still when running nbdime nbdime diff-web i still get that it's listening on 127.0.0.1: [I nbdimeserver:423] Listening on 127.0.0.1, port 33523 [W webutil:18] No web browser found: could not locate runnable browser. [I webutil:29] URL: http://127.0.0.1:33523/difftool

i've read from issue #255 that: "Adds an argument --ip to all web entry points (and similarly, nbdimeserver accepts an ip keyword), such that the listening interface can be specified."

but how do i use this --ip: to specify the listening interface when diffing/merging? how do i tell nbdime to listen on a public ip? an example would be of much help!

thanks in advance

Dateez avatar Oct 16 '20 14:10 Dateez

Hello! First of all, which version of nbdime are you using? 😃

Regarding the --ip xxx.xxx.xxx.xxx argument, that would be used in the command that starts nbdime. How are you starting it?

vidartf avatar Oct 20 '20 14:10 vidartf

Hello i'm on nbdime 2.1.0

Yes i've tried right now to use nbdime mergetool --ip xxx.xxx.xxx.xxx , this succeded in changing the listening interface to where i'm physically running the command, i thought this would solve the problem but i'm still getting this:

Skipping given filenames without .ipynb extension: ['--ip', 'xxx.xxx.xxx.xxx']
Merging:
Test_diff.ipynb
Normal merge conflict for 'Test_diff.ipynb':
  {local}: modified file
  {remote}: modified file
[I nbdimeserver:423] Listening on xxx.xxx.xxx.xxx, port xxxxx
[W webutil:18] No web browser found: could not locate runnable browser.
[I webutil:29] URL: http://xxx.xxx.xxx.xxx:xxxxx/mergetool

if i try to do: wget http://xxx.xxx.xxx.xxx:xxxxx/mergetool Connecting to /xxx.xxx.xxx.xxx:xx... failed: Connection refused.

Any idea on how to procede?

Dateez avatar Oct 20 '20 15:10 Dateez

UPDATE: wget http://xxx.xxx.xxx.xxx:xxxxx/mergetool seems to be working and i download a mergetool html:

<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>nbdime - diff and merge your Jupyter notebooks</title>

  </head>


  <!-- TODO: make nbdime.init() setup the forms/input user interface? -->

  <body> <!-- onload="nbdime.init()" -->

    

    <div id="nbdime-header" class="nbdime-Merge">
      <h3>Notebook Merge</h3>
      <div id="nbdime-header-buttonrow">
        <input id="nbdime-hide-unchanged" type="checkbox"><label for="cbox1">Hide unchanged cells</label></input>
        <button id="nbdime-save" style="display: none">Save</button>
        <button id="nbdime-download" style="display: none">Download</button>
        <button id="nbdime-close" style="display: none">Close tool</button>
      </div>
      <div id=nbdime-header-banner>
        <span id="nbdime-header-local">Local</span>
        <span id="nbdime-header-base">Base</span>
        <span id="nbdime-header-remote">Remote</span>
      </div>
    </div> <!-- ndime-header -->

    

    <div id="nbdime-root" class="nbdime-root">
    </div>

    <script id='nbdime-config-data' type="application/json">{"base": "./Test_diff_BASE_17066.ipynb", "baseUrl": "/", "closable": true, "hideUnchanged": true, "local": "./Test_diff_LOCAL_17066.ipynb", "mathjaxConfig": "TeX-AMS-MML_HTMLorMML-full,Safe", "mathjaxUrl": "/nb-static/mathjax/MathJax.js", "outputfilename": "Test_diff.ipynb", "remote": "./Test_diff_REMOTE_17066.ipynb", "savable": true}</script>
    <script src="/static/nbdime.js?v=d26ba26aa8d4dea5b3334d6d0f081a52"></script>
    <noscript>Nbdime relies on javascript for diff/merge views!</noscript>
  </body>
</html>

however as for local host i can't locate a runnable browser

Dateez avatar Oct 21 '20 10:10 Dateez