禁用Jupyterhub中的下载功能



我是Jupyterhub的新手。我们遵循文档,通过helm在kubernetes中安装了jupyterhub。我一直在读到,在jupyterhub中没有任何功能可以禁用下载文件的功能。我在一些论坛上看到,通过nginx可以将所有"/文件"路由到黑洞。然而,它没有起作用。下面是我的配置。

舵杆配置

ingress:
enabled: true
host:
- myhost.example.com

k8服务.yaml

apiVersion: v1
kind: Service
metadata:
name: default-http-backend
spec:
selector:
app: default-http-backend
ports:
- protocol: TCP
port: 80

K8入口

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: jupyterhub-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: myhost.example.com
http:
paths:
- path: /user/(*.)/files/
backend:
serviceName: default-http-backend
servicePort: 80
- path: /
backend:
serviceName: proxy-public
servicePort: 80

由于v3.1.0,您可以使用jupyter标签扩展名禁用下载:

# disable downloads from File > Download
jupyter labextension disable @jupyterlab/docmanager-extension:download
# disable downloads from the context menu in the file browser
jupyter labextension disable @jupyterlab/filebrowser-extension:download

github原始问题:https://github.com/jupyterlab/jupyterlab/issues/5274

最新更新