Skip to main content

JupyterHub service to expose notifications for Jupyter

Project description

SwanNotificationsService

JupyterHub service that exposes an API with notifications for the logged in user. The notifications are specified in a json file. If a "maintenance file" exists, a notification will be given that the service is under maintenance.

This extension works in conjunction with SwanNotifications.

Requirements

This module requires and installs JupyterHub.

Installation

Install the package:

pip install swannotificationsservice

Update the container image

This folder contains a Dockerfile that can be used to create an image for the pod that runs the notifications service. Once you release to PyPI you need to create a new image, e.g.

docker build -t gitlab-registry.cern.ch/swan/docker-images/jupyterhub/notifications:v0.1.0 && docker push gitlab-registry.cern.ch/swan/docker-images/jupyterhub/notifications:v0.1.0

Usage

Call the binary and specify configuration parameters:

swannotificationsservice --notifications_file /srv/jupyterhub/notifications.json

Configuration parameters:

  • port (default: 8888)
  • notifications_file (default: /srv/jupyterhub/notifications.json)
  • maintenance_file (default: /etc/nologin)
  • prefix (default: /)

Notifications file example:

[
    {
        "user": "*",
        "id": "notif1",
        "level": "info",
        "dismissible": 0,
        "message": "This is a notification"
    }
]

Explanation:

  • user: username or '*' for all users;
  • id: unique identifier;
  • level: type of the notification (notice, info, success, or error)
  • dismissible: wether the user will be able to permanently hide the notification (0 or 1)
  • message: the text/html message

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swannotificationsservice-1.0.4.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swannotificationsservice-1.0.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file swannotificationsservice-1.0.4.tar.gz.

File metadata

File hashes

Hashes for swannotificationsservice-1.0.4.tar.gz
Algorithm Hash digest
SHA256 926c9d41c6dbdec40d3d0a6e3a8344c42c8f92acd9ac1185f632a448b5cb6dc7
MD5 49fabf41b35ed4dbd256dc4f67c220e3
BLAKE2b-256 1fe485a2a6ddb6e6e3522ccb36309fc58c777606641d36b1f5426085902a17b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for swannotificationsservice-1.0.4.tar.gz:

Publisher: swan-ci-ca.yml on swan-cern/jupyterhub-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swannotificationsservice-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for swannotificationsservice-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 79044f4f68f82675741a20d9961ffefcd2df85e19ddd58ad68af1f8b1f526392
MD5 41306c38e63624c989180537505b96aa
BLAKE2b-256 566b46c13f9b0e702527e7029b7aa46bb56e8afab60dc1d5d6fab9fbb4d717b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for swannotificationsservice-1.0.4-py3-none-any.whl:

Publisher: swan-ci-ca.yml on swan-cern/jupyterhub-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page