Datalore 2024.4 Help

Separate domain for HTML output

Datalore On-Premises allows you to use a separate dedicated domain for HTML outputs rendered as iframes in your code cell. The benefits of this feature are:

  • Guarantees security of iframe use in notebooks

  • Improves notebook performance through enabling static cache

Your options

Use our domain

You set up your environment to use our domain, https://*.dataloreusercontent.com.

Use your own domain

You set up your environment to use your own domain. Make sure that the page that will be requested has the proper HTML content. See the details in the procedure below.

Set up a dedicated domain for HTML output

  1. (Skip if using Datalore's domain) Deploy an HTML page with content as in the example below:

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <title>JetBrains Datalore</title> <script> (() => { const urlParams = new URLSearchParams(window.location.search); const frameId = urlParams.get('frameId'); function initialize() { window.parent.postMessage({ iframeToInitialize: frameId, }, '*'); } window.addEventListener("message", event => { if ("iframeContent" in event.data) { const iframe = document.getElementById("content") iframe.setAttribute("srcdoc", event.data.iframeContent) } }) window.addEventListener("DOMContentLoaded", () => initialize()); })() </script> <style> body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; } #content { display: block; width: 100%; height: 100%; border: none; } </style> </head> <body> <iframe id="content"></iframe> </body> </html>
  2. Specify the URL of the created page (our Datalore's dedicated domain) using the USER_CONTENT_URL environment variable in your config file.

    docker-compose.yaml

    services: datalore: ... environment: ... USER_CONTENT_URL: "your_domain_url"

    datalore.values.yaml

    dataloreEnv: .... USER_CONTENT_URL: "your_domain_url"
Last modified: 18 August 2024