conwnet / github1s

One second to read GitHub code with VS Code.
https://github1s.com
MIT License
22.79k stars 863 forks source link

feat: Github Enterprise support #496

Open kcoms555 opened 1 year ago

kcoms555 commented 1 year ago

Summary

Support Github Enterprise

How to switch between GitHub Enterprise <-> GitHub

// open /platform_config.js with your editor
export const DefaultPlatform = Platform.GitHub // <- set it as Platform.GitHubEnterprise if want or Platform.GitHub
export class ConfigsForEnterprise {
    // if DefaultPlatform is Platform.GitHubEnterprise, then items below must be rewritten
    // insert your baseUrl. It is used to access to most cases.
    // access ex) https://your.enterprise.url/some_org/some_repo/blob/some_branch/dir1/dir2/filename
    static github_enterprise_baseUrl = 'https://your.enterprise.url';

    // insert your api url. It is used to access to api.
    // if you uses GitHub Enterprise API v3, then set it as http(s)://HOSTNAME/api/v3
    // access ex) https://your.enterprise.url/api/v3/repos/some_org/some_repo/commits
    static github_enterprise_api_url = 'https://your.enterprise.url/api/v3';

    // insert your github enterprise client_id
    // how to get a new client_id: https://your.enterprise.url/settings/applications/new
    static github_enterprise_client_id = 'xxxxxxxxxxxxxxxxxxxx';

    // insert your github1s server url(NOT github enterprise baseUrl!) on which your github1s applications are running
    // It is required to get authentication token from your github enterprise to your github1s server.
    static auth_page_origin = 'https://your.github1s.server';
}

Limitation

  1. In the private network(internet isolated), applications requiring Internet are not working including Sourcegraph which helps indexing. If needed, It should deployed and edit source codes related to that parts.
  2. Depending on each individual situation, there may be restrictions on API access, limit on the number of requests, and unexpected bugs according to the GitHub Enterprise policy.

Related Issues

welcome[bot] commented 1 year ago

Hello there!👋 Welcome to the project!💖 Thank you and congrats🎉 for opening your first pull request✨ 🙌.We will get back to you as soon as we can.😄

vercel[bot] commented 1 year ago

@kcoms555 is attempting to deploy a commit to the Github1s Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
github1s ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 26, 2023 10:49am
Siddhant-K-code commented 10 months ago

cc: @conwnet wdyt about this?

conwnet commented 10 months ago

cc: @conwnet wdyt about this?

I found some copy-and-paste code in this PR, so I'm going to take the time to sort it out.

Siddhant-K-code commented 10 months ago

We would also require a GitHub Enterprise URL to test this out. @kcoms555 Do you have any demo GitHub Enterprise URL to test this out?