diff --git a/conf/jupyterhub_config.py b/conf/jupyterhub_config.py index f80f11b..f8af4a1 100644 --- a/conf/jupyterhub_config.py +++ b/conf/jupyterhub_config.py @@ -171,7 +171,7 @@ c.JupyterHub.bind_url = 'http://:__PORT____PATH__' #c.JupyterHub.cookie_secret_file = 'jupyterhub_cookie_secret' ## The location of jupyterhub data files (e.g. /usr/local/share/jupyterhub) -c.JupyterHub.data_files_path = '__FINAL_PATH__/.venv/share/jupyterhub' +c.JupyterHub.data_files_path = '__INSTALL_DIR__/.venv/share/jupyterhub' ## Include any kwargs to pass to the database connection. See # sqlalchemy.create_engine for details. @@ -589,7 +589,7 @@ c.JupyterHub.spawner_class = 'sudospawner.SudoSpawner' # Some spawners allow shell-style expansion here, allowing you to use # environment variables here. Most, including the default, do not. Consult the # documentation for your spawner to verify! -c.Spawner.args = ['--config=__FINAL_PATH__/config/jupyter_notebook_config.py'] +c.Spawner.args = ['--config=__INSTALL_DIR__/config/jupyter_notebook_config.py'] ## An optional hook function that you can implement to pass `auth_state` to the # spawner after it has been initialized but before it starts. The `auth_state` diff --git a/conf/nginx.conf b/conf/nginx.conf index 75770a5..4a311b9 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,3 +1,4 @@ +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { proxy_pass http://localhost:__PORT__; diff --git a/hooks/post_user_create b/hooks/post_user_create index bdaa322..c87255e 100644 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -6,7 +6,7 @@ source /usr/share/yunohost/helpers app="${0//.\/50-}" user=$1 -final_path="$(ynh_app_setting_get --app=$app --key=final_path)" +install_dir="$(ynh_app_setting_get --app=$app --key=install_dir)" enable_extensions="$(ynh_app_setting_get --app=$app --key=enable_extensions)" ynh_use_nodejs @@ -14,5 +14,5 @@ ynh_use_nodejs if [ $enable_extensions -eq 1 ]; then export JUPYTERLAB_DIR="$(getent passwd $user | cut -d: -f6)/.local/share/$app/lab" node_path="$nodejs_path:$(sudo -u $user sh -c 'echo $PATH')" - sudo -u $user env "PATH=$node_path:$PATH" "$final_path/.venv/bin/jupyter" lab build --app-dir="$JUPYTERLAB_DIR" + sudo -u $user env "PATH=$node_path:$PATH" "$install_dir/.venv/bin/jupyter" lab build --app-dir="$JUPYTERLAB_DIR" fi diff --git a/manifest.toml b/manifest.toml index 33c7fb0..09b9a4d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -29,16 +29,13 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/jupyterlab" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [install.init_main_permission] @@ -58,9 +55,21 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = true [resources] + [resources.ports] + main.default = 8080 + hub.default = 8081 + http_proxy.default = 8082 + [resources.system_user] [resources.install_dir] [resources.permissions] main.url = "/" + + [resources.apt] + packages = "python3-dev python3-pip" + + extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main" + extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg" + extras.yarn.packages = "yarn" diff --git a/scripts/_common.sh b/scripts/_common.sh index 20c17f8..1b2fc49 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="python3-dev python3-pip libffi-dev libzmq3-dev" - nodejs_version="16" jupyterlab_version="3.2.5"