jupyterhub二次开发包括用户界面以及登录验证方式
首先是验证方式的改变,默认登录方式是用户是不能注册登录的,用户在第一次登录时设置他们的密码,而我们需要重新改变登录方式
参考链接:
修改默认登录方式的官方方法
步骤:
You must install this authenticator throught the project’s repository.
切换目录
cd /opt
git clone https://github.com/jupyterhub/nativeauthenticator.git
上面安装速度慢的话可以尝试下面命令
git clone https://gitee.com/ocean_industry_ty/nativeauthenticator.git
切换目录
cd /opt/nativeauthenticator/
进行安装
pip install -e .
通过配置文件修改默认登录认证方式
vim /etc/jupyterhub/jupyterhub_config.py
将下面内容添加进配置文件
c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'
下面为认证可选项可加可不加
c.Authenticator.allowed_failed_logins = 3
c.Authenticator.seconds_before_next_try = 1200
c.Authenticator.ask_email_on_signup = True
接下来就可以运行这个jupyterhub服务器了,参照上面步骤
需要注意的是即使前面已经注册过并且已经登录上去了,这里都必须重新注册一次,通过用前面已经成功登录的帐号再重新再注册一次