NorwayX/docker
0
1#!/bin/bash2set -u3 4JUPYTER_TOKEN="${JUPYTER_TOKEN:=huggingface}"5NOTEBOOK_DIR="/data"6XRAY_VERSION="${XRAY_VERSION:-v25.4.30}"7XRAY_HOME="${XRAY_HOME:-$HOME/xray}"8XRAY_BIN="$XRAY_HOME/xray"9 10if [ -f /home/user/app/nodeget_bootstrap.sh ]; then11 bash /home/user/app/nodeget_bootstrap.sh || true12else13 echo "[nodeget] bootstrap script not found; skipping NodeGet agent startup"14fi15 16mkdir -p "$XRAY_HOME"17if [ ! -x "$XRAY_BIN" ]; then18 echo "[vless] downloading Xray $XRAY_VERSION"19 curl -fL "https://github.com/XTLS/Xray-core/releases/download/${XRAY_VERSION}/Xray-linux-64.zip" -o "$XRAY_HOME/xray.zip"20 unzip -o "$XRAY_HOME/xray.zip" -d "$XRAY_HOME"21 chmod +x "$XRAY_BIN"22fi23 24echo "[vless] starting Xray on 127.0.0.1:10000 path /vless"25nohup "$XRAY_BIN" run -config /home/user/app/xray_config.json > "$XRAY_HOME/xray.log" 2>&1 &26 27mkdir -p /tmp/nginx/client_body_temp /tmp/nginx/proxy_temp /tmp/nginx/fastcgi_temp /tmp/nginx/uwsgi_temp /tmp/nginx/scgi_temp28 29echo "[jupyter] starting JupyterLab on 127.0.0.1:7861"30jupyter labextension disable "@jupyterlab/apputils-extension:announcements"31jupyter-lab \32 --ip 127.0.0.1 \33 --port 7861 \34 --no-browser \35 --allow-root \36 --ServerApp.token="$JUPYTER_TOKEN" \37 --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \38 --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \39 --ServerApp.disable_check_xsrf=True \40 --LabApp.news_url=None \41 --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate" \42 --notebook-dir=$NOTEBOOK_DIR &43 44echo "[nginx] starting nginx on 0.0.0.0:7860"45nginx -c /home/user/app/nginx.conf -g "daemon off;"46 