[PR #47] [MERGED] Add GITHUB_EXCLUDED_ORGS support for organization filtering #112

Closed
opened 2026-02-27 15:55:11 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/47
Author: @djmango
Created: 7/18/2025
Status: Merged
Merged: 7/19/2025
Merged by: @arunavo4

Base: mainHead: master


📝 Commits (1)

  • 8d7ca8d Add GITHUB_EXCLUDED_ORGS support for organization filtering

📊 Changes

4 files changed (+20 additions, -2 deletions)

View changed files

📝 docker-compose.dev.yml (+1 -0)
📝 docker-compose.yml (+1 -0)
📝 docs/BUILD_GUIDE.md (+2 -1)
📝 src/lib/github.ts (+16 -1)

📄 Description

Add GITHUB_EXCLUDED_ORGS Environment Variable for Organization Filtering

Problem

Users deploying gitea-mirror in environments with IP restrictions (like Proxmox/LXC) encounter sync failures when GitHub organizations have IP allowlists enabled. The entire sync process would crash with a 403 Forbidden error.

Solution

Added GITHUB_EXCLUDED_ORGS environment variable to proactively exclude specific organizations from the sync process.

Changes

  • Environment Variable: GITHUB_EXCLUDED_ORGS accepts a comma-separated list of organization names to exclude
  • Filtering Logic: Organizations are filtered out before any GitHub API calls are made
  • Case Insensitive: Matching works regardless of casing
  • Docker Support: Added to both docker-compose.yml and docker-compose.dev.yml
  • Documentation: Updated docs/BUILD_GUIDE.md with usage example

Usage

# Exclude organizations with IP restrictions or that shouldn't be synced
GITHUB_EXCLUDED_ORGS=private-org,restricted-org,test-org

Benefits

  • Prevents sync failures due to IP allowlists
  • Gives users control over which organizations to sync
  • Maintains fast parallel processing for remaining organizations
  • Zero impact when not used (optional feature)

Fixes issues with IP allowlist restrictions in enterprise/restricted environments. https://github.com/RayLabsHQ/gitea-mirror/issues/46


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RayLabsHQ/gitea-mirror/pull/47 **Author:** [@djmango](https://github.com/djmango) **Created:** 7/18/2025 **Status:** ✅ Merged **Merged:** 7/19/2025 **Merged by:** [@arunavo4](https://github.com/arunavo4) **Base:** `main` ← **Head:** `master` --- ### 📝 Commits (1) - [`8d7ca8d`](https://github.com/RayLabsHQ/gitea-mirror/commit/8d7ca8dd8fa040a80e34053311eb296f9dcd2d18) Add GITHUB_EXCLUDED_ORGS support for organization filtering ### 📊 Changes **4 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docker-compose.dev.yml` (+1 -0) 📝 `docker-compose.yml` (+1 -0) 📝 `docs/BUILD_GUIDE.md` (+2 -1) 📝 `src/lib/github.ts` (+16 -1) </details> ### 📄 Description ## Add GITHUB_EXCLUDED_ORGS Environment Variable for Organization Filtering ### Problem Users deploying gitea-mirror in environments with IP restrictions (like Proxmox/LXC) encounter sync failures when GitHub organizations have IP allowlists enabled. The entire sync process would crash with a 403 Forbidden error. ### Solution Added `GITHUB_EXCLUDED_ORGS` environment variable to proactively exclude specific organizations from the sync process. ### Changes - **Environment Variable**: `GITHUB_EXCLUDED_ORGS` accepts a comma-separated list of organization names to exclude - **Filtering Logic**: Organizations are filtered out before any GitHub API calls are made - **Case Insensitive**: Matching works regardless of casing - **Docker Support**: Added to both `docker-compose.yml` and `docker-compose.dev.yml` - **Documentation**: Updated `docs/BUILD_GUIDE.md` with usage example ### Usage ```bash # Exclude organizations with IP restrictions or that shouldn't be synced GITHUB_EXCLUDED_ORGS=private-org,restricted-org,test-org ``` ### Benefits - ✅ Prevents sync failures due to IP allowlists - ✅ Gives users control over which organizations to sync - ✅ Maintains fast parallel processing for remaining organizations - ✅ Zero impact when not used (optional feature) Fixes issues with IP allowlist restrictions in enterprise/restricted environments. https://github.com/RayLabsHQ/gitea-mirror/issues/46 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:55:11 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#112
No description provided.