Skip to content

docs: Add warning about private tokens - #387

Merged
yuvipanda merged 6 commits into
jupyterhub:mainfrom
jnywong:docs-tokens
Feb 3, 2026
Merged

docs: Add warning about private tokens#387
yuvipanda merged 6 commits into
jupyterhub:mainfrom
jnywong:docs-tokens

Conversation

@jnywong

@jnywong jnywong commented Jan 26, 2026

Copy link
Copy Markdown
Member

Ref #342

Comment thread docs/faq.md Outdated
@jnywong
jnywong requested a review from yuvipanda January 27, 2026 13:57
@jnywong

jnywong commented Jan 27, 2026

Copy link
Copy Markdown
Member Author

Cool! I have transferred across content from https://infrastructure.2i2c.org/howto/features/private-nbgitpuller/#helm-values-configuration and included a warning about using PAT tokens to authorize acces to private repos.

Screenshot 2026-01-27 at 13 58 51

Comment thread docs/faq.md Outdated
Please do not include [personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens) in the nbgitpuller link, e.g. using a GitHub repo URL of the form `https://login:<TOKEN>@hostname/path.git`, since this is logged on the Jupyter server. Anyone with access to server can therefore see your private token.
```

If you would like to share content from a private repository, you can use [git-credential-helpers](https://github.com/yuvipanda/git-credential-helpers) to do so.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's note this only works on github?

Comment thread docs/faq.md Outdated
You must use the **private key**, not a **client secret**.
```

- To configure helm chart values for [Zero to JupyterHub](https://z2jh.jupyter.org/en/stable/) clusters, see [this example](https://infrastructure.2i2c.org/howto/features/private-nbgitpuller/#helm-values-configuration).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/faq.md Outdated

- Create a new private key for authentication with the `Generate a private key` button. This should download a private key file, that you should keep secure and configure in the next step.

1. Update `gitconfig` file with the following

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a note about what the location of this is? In my experience this is the hardest. On JupyterHub, let's recommend /etc/gitconfig (for system-wide config), with a caveat that it needs to be $PREFIX/etc/gitconfig if you're using git from conda-forge (conda-forge/git-feedstock#113). This avoids the pitfall of people putting it in per-user git config for themselves (under ~/.gitconfig) and confused why it doesn't affect anyone else

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git can suggest the path via git config --system --list --show-origin, if there is some doubt, but @yuvipanda 's /etc/ and ${PREFIX}/etc/ suggestions are probably sufficient.

Comment thread docs/faq.md Outdated
Please do not include [personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens) in the nbgitpuller link, e.g. using a GitHub repo URL of the form `https://login:<TOKEN>@hostname/path.git`, since this is logged on the Jupyter server. Anyone with access to server can therefore see your private token.
```

If you would like to share content from a private repository, you can use [git-credential-helpers](https://github.com/yuvipanda/git-credential-helpers) to do so.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though people can click through to read the description and code of git-credential-helpers, maybe it'd be useful to briefly describe what it is here? Something like: (from a comment in its code)

git-credential-helpers lets git automatically create GitHub app installation tokens for interacting with private repos that have the GitHub app installed.

Comment thread docs/faq.md Outdated

- Create a new private key for authentication with the `Generate a private key` button. This should download a private key file, that you should keep secure and configure in the next step.

1. Update `gitconfig` file with the following

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git can suggest the path via git config --system --list --show-origin, if there is some doubt, but @yuvipanda 's /etc/ and ${PREFIX}/etc/ suggestions are probably sufficient.

@jnywong

jnywong commented Jan 29, 2026

Copy link
Copy Markdown
Member Author

I've made a few more edits to take into account the suggestions, so open for review again :)

@jnywong
jnywong requested a review from ryanlovett February 2, 2026 14:28
@jnywong

jnywong commented Feb 2, 2026

Copy link
Copy Markdown
Member Author

Hey @ryanlovett could you give this a glance over and let me know what you think?

@ryanlovett ryanlovett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@yuvipanda
yuvipanda merged commit f4e5add into jupyterhub:main Feb 3, 2026
3 checks passed
@yuvipanda

Copy link
Copy Markdown
Contributor

ty for your review, @ryanlovett

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants