Skip to content

Add GitHub Enterprise Server (GHE.com / Data Residency) support #479

Description

@mbianchidev

Is your feature request related to a problem?

The Private Mirrors App currently does not support deployment or use against GitHub Enterprise Server (GHE.com / Data Residency) instances. Many enterprise customers require Data Residency or need to self-host on GHE, but cannot use this app due to hardcoded references to github.com for authentication and API endpoints.

Describe the solution you'd like

Add first-class support for GitHub Enterprise Server (GHE.com) deployments. Specifically:

  • Allow full configuration of GitHub API and OAuth/OIDC endpoints via environment variables (e.g., GITHUB_HOSTNAME, GITHUB_API_URL, OAUTH_BASE_URL)
  • Update NextAuth provider and authentication logic to use the configured GHE base hostname for OAuth flows
  • Ensure Probot/Octokit API calls are directed to the GHE API endpoint (not api.github.com)
  • Update documentation with explicit steps for GHE setup / deployment (including webhooks, App installation, and OAuth)
  • Validate fork/mirror flow is compatible with GHE fork network
  • Provide helper scripts, if needed, for GHE onboarding

Describe alternatives you've considered

There are manual/partial workarounds such as patching code and replacing URLs at deployment, but these break easily and are not maintainable across updates. No straightforward and documented path exists for running PMA on GHE.com.

Additional context

The current codebase hardcodes github.com URLs in both client and server components:

  • Authentication (NextAuth) only supports github.com and does not accept custom GHE OAuth endpoints
  • Octokit and Probot assume api.github.com unless extra configuration is injected (currently missing)

GHE.com customers, especially those with Data Residency requirements, cannot use this tool unless support is added.

Related findings:

  • Hardcoded token refresh and OAuth URL in src/app/api/auth/lib/nextauth-options.ts
  • No GHE_API_URL/GITHUB_HOSTNAME wire-up in .env.example or codebase
  • Documented in README: "The authentication of the UI will still need to be a user's github.com user"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions