Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/page template #79

Merged
merged 6 commits into from
Sep 27, 2021

Conversation

raethlein
Copy link
Contributor

Add tabs for "Change Password" and "Authorize Users" into the page by using JupyterHub's template extension functionality (see documentation):
image

To use it, the user has to add the templates folder to the templates path in the JupyterHub configuration file. Example:
c.JupyterHub.template_paths = ["/usr/local/lib/python3.5/dist-packages/nativeauthenticator/templates/"]

@chicocvenancio
Copy link

To use it, the user has to add the templates folder to the templates path in the JupyterHub configuration file. Example:
c.JupyterHub.template_paths = ["/usr/local/lib/python3.5/dist-packages/nativeauthenticator/templates/"]

The template path depends on python version and method used to install the nativeauthenticator package, perhaps there is some way we could automate the template inclusion? (I think this needs some change upstream)

Otherwise, thanks for this, it is a nice addition to nativeauthenticator.

@raethlein
Copy link
Contributor Author

Good point! It would be possible to make it independent of the underlying folder structure like this:

import os, nativeauthenticator
c.JupyterHub.template_paths = ["{}/templates/".format(os.path.dirname(nativeauthenticator.__file__))]

This could be added to the documentation as an optional feature, but I understand if a completely automated solution would be preferred.

@leportella
Copy link
Collaborator

Hi @raethlein ! Thank you for your contribution! I tried both things locally and couldn't make it work. Any idea what I may be doing wrong?

@chicocvenancio
Copy link

chicocvenancio commented Aug 8, 2019

@leportella I had it working with c.JupyterHub.template_paths = ["/home/jovyan/.local/lib/python3.6/site-packages/nativeauthenticator/templates/"] on a jupyterhub/k8s-hub:0.9-dcde99a image with nativeauthenticator and this PR installed. (functionally the same as the last suggestion by @raethlein)

@leportella
Copy link
Collaborator

Yeah, this is definitely not ideal. I was wondering if we could automatically load this from inside the code. @yuvipanda do you have any thoughts on this?

@lambdaTotoro
Copy link
Collaborator

This PR hasn't seen any activity in a while, but I still think it would be lovely to have.
I tested @raethlein's last suggestion locally and it worked immediately. And I don't think the extra step in the configuration is too much to ask.

@lambdaTotoro
Copy link
Collaborator

I decided to merge this PR for the reasons above. I've tested it again today and like I said before, @raethlein's code to automatically find the template files works flawlessly. I have added it to the documentation as well.

@consideRatio
Copy link
Member

@lambdaTotoro when you mention @raethlein's code to automatically find the templates files, are you referring to this?

import os, nativeauthenticator
c.JupyterHub.template_paths = ["{}/templates/".format(os.path.dirname(nativeauthenticator.__file__))]

@lambdaTotoro
Copy link
Collaborator

That's the one, yes. Should be identical to the one in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants