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

Add support of github enterprise #25

Open
jianwu opened this issue Feb 14, 2021 · 1 comment
Open

Add support of github enterprise #25

jianwu opened this issue Feb 14, 2021 · 1 comment
Labels
feature A new behavior for the application

Comments

@jianwu
Copy link

jianwu commented Feb 14, 2021

For many snippets that is work related. We can't store them in public github. So if this can store enterprise github will be great.

@SidneyNemzer
Copy link
Owner

Note that you can create a "secret" gist which is not listed publicly. However I think anyone can access it with the link, which understandably isn't acceptable for enterprise code.

I've never used GitHub enterprise but I assume it provides separate Gist storage? If so, we'd just need to replace github.com in a few places with a configurable hostname.

Looks like these URLs need to use the configurable hostname:

export const CREATE_ACCESS_TOKEN_URL =
"https://github.com/settings/tokens/new?description=Snippets%20Access%20Token&scopes=gist";
export const SNIPPETS_ISSUES_URL =
"https://github.com/SidneyNemzer/snippets/issues/new";

const usersGists = "https://gist.github.com/";

And then set the baseUrl for octokit: https://github.com/octokit/core.js#options

This would need to be another item in the settings page, and probably available as an option on the Login page too, hidden behind a button that says "Using GitHub Enterprise?".

I don't have time to dedicate to snippets right now, but I would accept a PR if you or someone else has time to implement this. I also don't have access to a GitHub Enterprise server so I would need help testing the changes.

@SidneyNemzer SidneyNemzer added the feature A new behavior for the application label May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new behavior for the application
Projects
None yet
Development

No branches or pull requests

2 participants