【发布时间】:2019-02-06 18:18:39
【问题描述】:
我已经通过 conda install 在 Ubuntu 16.04 上安装了 Jupyterhub。接下来,我通过在 jupyterhub_config.py 中添加以下内容使其使用 oAuthenticator
from oauthenticator.github import GitHubOAuthenticator
c.JupyterHub.authenticator_class = GitHubOAuthenticator
c.GitHubOAuthenticator.create_system_users = True
我还在 ~/.bashrc 中添加了以下内容并获取了它
#For OAuthentication
export GITHUB_CLIENT_ID=id
export GITHUB_CLIENT_SECRET=secret
export OAUTH_CALLBACK_URL=http://xyz:8000/hub/oauth_callback
export GIT_REPO_NAME=mmf
export GIT_BRANCH_NAME=master
export GITHUB_ACCESS_TOKEN= mytoken
启动 jupyterhub 后,我能够获得“使用 git 登录”页面。
现在,我通过创建 /etc/systemd/system/jupyterhub.service 并将以下内容添加到其中,将 jupyterhub 配置为作为服务运行
[Unit]
Description=Starts JupyterHub as Daemon
After=syslog.target network.target
[Service]
User=root
Environment=”PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/etc/Applications/Anaconda3/bin”
ExecStart=/etc/Applications/Anaconda3/bin/jupyterhub –f /etc/Applications/JupyterHub/jupyterhub_config.py
[Install]
WantedBy=multi-user.target
现在,我使用 systemctl start jupyterhub 启动它,但现在我得到的是常规登录页面,而不是 git 登录。
这可能是因为它没有读取jupyterhub_config.py。我检查了jupyterhub.service 中提到的所有目录,它们都签出了。
Anaconda 安装目录:/etc/Applications/Anaconda3/
Jupyterhub 配置文件目录:/etc/Applications/JupyterHub/jupyterhub_config.py
谁能帮我解决这个问题?
【问题讨论】:
标签: jupyterhub