Skip to content

Github Enterprise support #114

Open

Description

@gragib

For a Github Enterprise server hosted behind a firewall at https://git.example.co/, what changes need to be made use it with a self-hosted version of github1s?

Activity

  1. gragib commented on Feb 14, 2021

    @gragib
    ContributorAuthor

    It would be mighty convenient if https://api.github.com/ was replaced with a configurable variable. In my hypothetical situation, GHE equivalent is https://git.example.co/api/v3/.

  2. gragib commented on Feb 14, 2021

    @gragib
    ContributorAuthor

    1. How do I ensure basic authentication is used for all API calls?
    2. Where do I add the token?
    3. What permissions are required when generating the token?

    Figured it out.

  3. gragib commented on Feb 14, 2021

    @gragib
    ContributorAuthor

    I have a hit a roadblock with the GraphQL API: path was added in GHE 3.0. I am on an older release.

    fragment TreeEntryFields on TreeEntry {
    oid
    name
    path
    type
    }

  4. gragib commented on Feb 14, 2021

    @gragib
    ContributorAuthor

    Removing path seems to get things in working order. What are the downsides?

  5. Shegox commented on Feb 14, 2021

    @Shegox

    One additional thing, which I noticed when setting it up for GitHub Enterprise Server that using GitHub pages is probably not the best idea for hosting because of two reasons:

    • It would be hosted under a different path: e.g. pages.github.example.com/github1s/$ORG/$REPO and this requires an adjustment in https://github.com/conwnet/github1s/blob/master/src/vs/github1s/util.ts#L18 E.g.:

        // remove path prefix (github1s) added by hosting on GitHub pages
        const pathname = urlObj.pathname.replace(/^\/github1s/,"");
        const parts = pathname.split(/\/|%2F/g).filter(Boolean);
    • hosting it under GitHub pages on an Enterprise Server would mean that the indexeddb (at least how far I understood it) could be accessed from any other GitHub page, meaning it would be quite easy to steal the tokens. As GitHub Enterprise doesn't support custom CNAMEs (like github.com) one should probably host it under a separate, isolated domain name and some static webserver (e.g. AWS S3 bucket).


    Another more generic idea would be to allow github1s to open urls in the form of github1s.com/$hostname/$ORG/$repo and adding support for multiple token/server. Then even Enterprise users could use github1s, even behind a firewall as requests are sent from the browser directly to the Enterprise Server and don't go over github1s.

  6. gragib commented on Feb 14, 2021

    @gragib
    ContributorAuthor

    At our place of work, we are supposed to use a Confluence wiki instead of GitHub Pages. Anybody who needs this will need to self-host it on localhost.

    I will try to sort out all the changes that need to be made and submit a PR in the near future.

  7. ajay-sreeram commented on Feb 19, 2021

    @ajay-sreeram

    1. How do I ensure basic authentication is used for all API calls?
    2. Where do I add the token?
    3. What permissions are required when generating the token?

    Figured it out.

    @gragib can you please elaborate the answers to these questions

  8. gragib commented on Feb 19, 2021

    @gragib
    ContributorAuthor

    #123 (comment)

    The UI for generating and adding a token is in the above comment. You will need to modify the GutHub URL to point to your instance of GHE.

  9. ajay-sreeram commented on Feb 19, 2021

    @ajay-sreeram

    Thankyou @gragib

  10. rpgeddam commented on Jun 17, 2021

    @rpgeddam

    https://github.com/conwnet/github1s/blob/master/extensions/github1s/src/client.ts#L11
    and API url in the file https://github.com/conwnet/github1s/blob/master/extensions/github1s/src/api.ts

    These URLs aren't valid anymore. nor can I find an api.ts file in the repo. What's the new location for these settings?

  11. Siddhant-K-code commented on Jun 18, 2021

    @Siddhant-K-code
    Collaborator

    https://github.com/conwnet/github1s/blob/master/extensions/github1s/src/client.ts#L11
    and API url in the file https://github.com/conwnet/github1s/blob/master/extensions/github1s/src/api.ts

    These URLs aren't valid anymore. nor can I find an api.ts file in the repo. What's the new location for these settings?

    you will get all your answers at: https://github.com/conwnet/github1s/tree/master/extensions/github1s/src/interfaces

  12. rpgeddam commented on Jun 22, 2022

    @rpgeddam

    you will get all your answers at: https://github.com/conwnet/github1s/tree/master/extensions/github1s/src/interfaces

    FWIW, this link isn't valid anymore either.

  13. conwnet commented on Jun 22, 2022

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions