addon-jupyterlab/jupyterlab/rootfs/etc/cont-init.d/jupyter.sh
Franck Nijhof 5a7eb72d4b
Refactor add-on (#232)
* Refactor add-on

* Replace NGinx Configuration

* Ingress!!!

* More tweaks, renames and other touches

* Revert accidental upgrade of JupyterLab
2021-02-02 22:36:04 +01:00

33 lines
1.1 KiB
Bash

#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: JupyterLab
# Configure JupterLabs
# ==============================================================================
if ! bashio::fs.directory_exists '/data/user-settings'; then
mkdir -p /data/user-settings \
|| bashio::exit.nok \
'Failed creating persistent user-settings directory'
fi
if ! bashio::fs.directory_exists '/data/workspaces'; then
mkdir -p /data/workspaces \
|| bashio::exit.nok \
'Failed creating persistent workspaces directory'
fi
if ! bashio::fs.directory_exists '/data/local'; then
mkdir -p /data/local \
|| bashio::exit.nok \
'Failed creating persistent local directory'
fi
ln -s /data/local /root/.local
bashio::var.json \
entry "$(bashio::addon.ingress_entry)" \
token "$(bashio::config 'github_access_token')" \
| tempio \
-template /etc/jupyter/jupyter_notebook_config.gtpl \
-out /etc/jupyter/jupyter_notebook_config.py