Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69cb0d0

Browse files
authored
Merge branch 'main' into jupyterlab-subdomain
2 parents aa294c3 + 13b60da commit 69cb0d0

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

jupyterlab/main.tf

+3-7
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ variable "share" {
4040
}
4141

4242
variable "subdomain" {
43-
type = bool
44-
default = true
45-
validation {
46-
condition = var.share == "owner" || var.share == "authenticated" || var.share == "public"
47-
error_message = "Incorrect value. Please set either 'owner', 'authenticated', or 'public'."
48-
}
43+
type = bool
44+
description = "Determines whether JupyterLab will be accessed via it's own subdomain or whether it will be accessed via a path on Coder."
45+
default = true
4946
}
5047

5148
variable "order" {
@@ -84,4 +81,3 @@ resource "coder_app" "jupyterlab" {
8481
threshold = 10
8582
}
8683
}
87-
}

jupyterlab/run.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env sh
22

3+
if [ -n "$BASE_URL" ]
4+
then
5+
BASE_URL="--ServerApp.base_url=${BASE_URL}"
6+
fi
7+
38
BOLD='\033[0;1m'
49

510
printf "$${BOLD}Installing jupyterlab!\n"
@@ -15,11 +20,17 @@ if ! command -v jupyterlab > /dev/null 2>&1; then
1520
fi
1621
# install jupyterlab
1722
pipx install -q jupyterlab
18-
echo "🥳 jupyterlab has been installed\n\n"
23+
printf "%s\n\n" "🥳 jupyterlab has been installed"
1924
else
20-
echo "🥳 jupyterlab is already installed\n\n"
25+
printf "%s\n\n" "🥳 jupyterlab is already installed"
2126
fi
2227

2328
echo "👷 Starting jupyterlab in background..."
2429
echo "check logs at ${LOG_PATH}"
25-
$HOME/.local/bin/jupyter-lab --ServerApp.ip='0.0.0.0' --ServerApp.port=${PORT} --no-browser --ServerApp.token='' --ServerApp.password='' > ${LOG_PATH} 2>&1 &
30+
$HOME/.local/bin/jupyter-lab --no-browser \
31+
"$BASE_URL" \
32+
--ServerApp.ip='*' \
33+
--ServerApp.port="${PORT}" \
34+
--ServerApp.token='' \
35+
--ServerApp.password='' \
36+
> "${LOG_PATH}" 2>&1 &

0 commit comments

Comments
 (0)