Message of the day

jupyterlab_galaxahub_motd_extension {{version}}

This lab has no message of the day for you yet. The lab administrator sets it up; the rest of this page is for them.

What the extension does

On lab start the extension asks the hub for the welcome entries of the user's groups and the broadcasts sent to the user, and shows them in this tab: the entries as cards, the broadcasts in the Notifications column. When the hub gives no entry, the tab shows a local page instead: this page, until the lab config names another. The tab opens by itself once per lab server start; a later load, a browser refresh included, does not open it, and the command Message of the day: Open opens it at any time.

Lab config

In jupyter_server_config.py or jupyter_lab_config.py, for a GalaxaHub lab:

import os

hub = os.environ.get("JUPYTERHUB_API_URL", "")
if hub:
    c.GalaxaHubMotd.motd_api_url = f"{hub}/extensions/motd"
    c.GalaxaHubMotd.notifications_api_url = f"{hub}/user-notifications"
c.GalaxaHubMotd.fallback_html = "/opt/motd/index.html"  # when the hub gives no entry
c.GalaxaHubMotd.label = "Welcome"                       # the tab label
c.GalaxaHubMotd.open_on_start = True                    # once per lab server start
c.GalaxaHubMotd.html_allow_scripts = True               # False runs no script in a page

With either URL empty the extension asks no hub. The files beside fallback_html are served with it, so its images load. The scripts of the local page run while html_allow_scripts is on; a hub page's also need the hub to allow script.

Lab settings

In the Settings Editor, under Message of the day: openOnStart (default true), reopenOnBroadcast (default false), pollMinutes (default 0, never pulls again) and notificationWindow (24h, 3d or 7d; default 24h).

Hub API

The lab server calls these URLs with Authorization: token <JUPYTERHUB_API_TOKEN>; the browser never holds the token.

URL Answer
GET <motd_api_url>/rich {"entries": [{"label", "kind": "markdown", "body"} or {"label", "kind": "html", "url"}]}; label heads the entry's card, and an entry with an empty label has no header bar
GET <motd_api_url>/terminal the terminal text, text/plain
GET <notifications_api_url> {"notifications": [{"ts", "message", "type", "audience"}]}

A 404 on a URL means the hub has no motd extension. The full contract is docs/design-api.md.

Terminal

jupyterlab-galaxahub-motd prints what the hub holds for the user in a lab terminal, not this page; --help lists its commands.