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 syncedGITHUB_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
🔄 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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
main← Head:master📝 Commits (1)
8d7ca8dAdd 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_ORGSenvironment variable to proactively exclude specific organizations from the sync process.Changes
GITHUB_EXCLUDED_ORGSaccepts a comma-separated list of organization names to excludedocker-compose.ymlanddocker-compose.dev.ymldocs/BUILD_GUIDE.mdwith usage exampleUsage
Benefits
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.