mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-22 23:51:42 -05:00
[GH-ISSUE #269] Support for non-github.com domains #2248
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yeahitsjan on GitHub (Apr 15, 2026).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/269
Originally assigned to: @arunavo4 on GitHub.
Hi! This tool looks promising. Currently having access to a Github Enterprise Cloud instance I would like to ask if its possible to also connect to those and mirror them accordingly? Theoretically the REST API or OctoKit should be compatible with it.
Many thanks!
Jan
@yeahitsjan commented on GitHub (Apr 15, 2026):
As I can see, it seems that
GH_API_URLcan be set as it is loaded from environment variables. Is that true?8fac30fc02/src/lib/github.ts (L43)@arunavo4 commented on GitHub (Apr 16, 2026):
Yes @yeahitsjan set
GH_API_URLto your Enterprise API endpoint (e.g.https://HOSTNAME/api/v3for GHE Server, orhttps://api.<tenant>.ghe.comfor GHEC with data residency) and it'll route Octokit there. Standard GHEC on github.com already works out of the box.@arunavo4 commented on GitHub (Apr 20, 2026):
Documented this in the README and environment variables reference so it's discoverable for future users:
GH_API_URL.env.examplenow includes aGH_API_URLexampleTL;DR:
Closing as answered — feel free to reopen if you hit any Enterprise-specific issues. Thanks for the nudge to document it!
@yeahitsjan commented on GitHub (Apr 20, 2026):
Hi @arunavo4,
thanks for documenting it! I currently use the
dev.yml, and insertedGH_API_URLinto it. When authenticating, it still points to theapi.github.comURL, which is indeed wrong (due to data residency):I also ran
docker exec gitea-mirror-dev envand can clearly see that it setGH_API_URLas expected.What did I do wrong here?
Thank you!
@arunavo4 commented on GitHub (Apr 20, 2026):
@yeahitsjan Found the Root cause:
GH_API_URLwas only honored bycreateGitHubClient(), but several Octokit call sites (including the one behind Test Connection) constructednew Octokit(...)directly, so they always hitapi.github.comregardless of the env var. That's exactly the 401 you were seeing.Fix is up in #273. It routes every Octokit construction through
createGitHubClient(), which means the Test Connection button, public-repo sync, metadata/force-push detection, and the scheduler's auto-discovery/auto-mirror/auto-start paths now all respectGH_API_URL.Once it merges and the
dev.ymlimage rebuilds, your existing config (GH_API_URL=https://api.TENANT.ghe.com) should just work. Reopening this issue so it stays visible until you confirm.@arunavo4 commented on GitHub (Apr 20, 2026):
Released as v3.15.3. Docker image is building now (run) — typically ~5 min from tag push to
ghcr.io/raylabshq/gitea-mirror:v3.15.3+:latest.Once it's up, pull the new image (or rebuild from
mainif you're tracking dev), and your existingGH_API_URL=https://api.TENANT.ghe.comconfig should route the Test Connection call (and every other GitHub call) to your tenant endpoint. Please confirm when you've had a chance to verify and I'll close this.@yeahitsjan commented on GitHub (Apr 20, 2026):
This works insanely great @arunavo4! Many thanks - will come back to you eventually later ;-)