8000 feat(jupyterlab): add support for `subdomain=false` by framctr · Pull Request #316 · coder/modules · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

feat(jupyterlab): add support for subdomain=false #316

Merged
merged 20 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by e 8000 xtension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions jupyterlab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ variable "share" {
}

variable "subdomain" {
type = bool
default = true
validation {
condition = var.share == "owner" || var.share == "authenticated" || var.share == "public"
error_message = "Incorrect value. Please set either 'owner', 'authenticated', or 'public'."
}
type = bool
description = "Determines whether JupyterLab will be accessed via it's own subdomain or whether it will be accessed via a path on Coder."
default 10000 = true
}

variable "order" {
Expand Down Expand Up @@ -84,4 +81,3 @@ resource "coder_app" "jupyterlab" {
threshold = 10
}
}
}
17 changes: 14 additions & 3 deletions jupyterlab/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env sh

if [ -n "$BASE_URL" ]
then
BASE_URL="--ServerApp.base_url=${BASE_URL}"
fi

BOLD='\033[0;1m'

printf "$${BOLD}Installing jupyterlab!\n"
Expand All @@ -15,11 +20,17 @@ if ! command -v jupyterlab > /dev/null 2>&1; then
fi
# install jupyterlab
pipx install -q jupyterlab
echo "🥳 jupyterlab has been installed\n\n"
printf "%s\n\n" "🥳 jupyterlab has been installed"
else
echo "🥳 jupyterlab is already installed\n\n"
printf "%s\n\n" "🥳 jupyterlab is already installed"
fi

echo "👷 Starting jupyterlab in background..."
echo "check logs at ${LOG_PATH}"
$HOME/.local/bin/jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --no-browser --ServerApp.token='' --ServerApp.password='' > ${LOG_PATH} 2>&1 &
$HOME/.local/bin/jupyter-lab --no-browser \
"$BASE_URL" \
--ServerApp.ip='*' \
--ServerApp.port="${PORT}" \
--ServerApp.token='' \
--ServerApp.password='' \
> "${LOG_PATH}" 2>&1 &
0