Skip to content

Add GITHUB_EXCLUDED_ORGS support for organization filtering #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2025

Conversation

djmango
Copy link
Contributor

@djmango djmango commented Jul 18, 2025

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. #46

@arunavo4 arunavo4 merged commit 6ea5e9e into RayLabsHQ:main Jul 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants