Metadata-Version: 2.3
Name: gitbridge
Version: 0.7.0b1
Summary: Synchronize GitHub repositories when git access is blocked
Author: Nevedomski Sergei
Author-email: Nevedomski Sergei <info@nevedomski.us>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Dist: requests>=2.31.0
Requires-Dist: playwright>=1.40.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.1.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: certifi>=2023.0.0
Requires-Dist: pytest>=7.4.0 ; extra == 'all'
Requires-Dist: pytest-cov>=4.1.0 ; extra == 'all'
Requires-Dist: ruff>=0.1.0 ; extra == 'all'
Requires-Dist: mypy>=1.5.0 ; extra == 'all'
Requires-Dist: types-requests>=2.31.0 ; extra == 'all'
Requires-Dist: types-pyyaml>=6.0 ; extra == 'all'
Requires-Dist: types-tqdm>=4.66.0 ; extra == 'all'
Requires-Dist: mkdocs>=1.6.0 ; extra == 'all'
Requires-Dist: mkdocs-material>=9.6.16 ; extra == 'all'
Requires-Dist: mkdocs-material-extensions>=1.3.1 ; extra == 'all'
Requires-Dist: pymdown-extensions>=10.8 ; extra == 'all'
Requires-Dist: mkdocs-git-revision-date-localized-plugin>=1.4.7 ; extra == 'all'
Requires-Dist: mkdocs-minify-plugin>=0.8.0 ; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.30.0 ; extra == 'all'
Requires-Dist: pillow>=10.4.0 ; extra == 'all'
Requires-Dist: cairosvg>=2.7.1 ; extra == 'all'
Requires-Dist: pypac>=0.16.0 ; sys_platform == 'win32' and extra == 'all'
Requires-Dist: wincertstore>=0.2.0 ; sys_platform == 'win32' and extra == 'all'
Requires-Dist: pywin32>=300 ; sys_platform == 'win32' and extra == 'all'
Requires-Dist: pytest>=7.4.0 ; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0 ; extra == 'dev'
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
Requires-Dist: mypy>=1.5.0 ; extra == 'dev'
Requires-Dist: types-requests>=2.31.0 ; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0 ; extra == 'dev'
Requires-Dist: types-tqdm>=4.66.0 ; extra == 'dev'
Requires-Dist: mkdocs>=1.6.0 ; extra == 'docs'
Requires-Dist: mkdocs-material>=9.6.16 ; extra == 'docs'
Requires-Dist: mkdocs-material-extensions>=1.3.1 ; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.8 ; extra == 'docs'
Requires-Dist: mkdocs-git-revision-date-localized-plugin>=1.4.7 ; extra == 'docs'
Requires-Dist: mkdocs-minify-plugin>=0.8.0 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.30.0 ; extra == 'docs'
Requires-Dist: pillow>=10.4.0 ; extra == 'docs'
Requires-Dist: cairosvg>=2.7.1 ; extra == 'docs'
Requires-Dist: pypac>=0.16.0 ; sys_platform == 'win32' and extra == 'windows'
Requires-Dist: wincertstore>=0.2.0 ; sys_platform == 'win32' and extra == 'windows'
Requires-Dist: pywin32>=300 ; sys_platform == 'win32' and extra == 'windows'
Requires-Python: >=3.10
Project-URL: Changelog, https://nevedomski.github.io/gitbridge/changelog.html
Project-URL: Documentation, https://nevedomski.github.io/gitbridge/
Project-URL: Homepage, https://nevedomski.github.io/gitbridge/
Project-URL: Issues, https://github.com/nevedomski/gitbridge/issues
Project-URL: Repository, https://github.com/nevedomski/gitbridge
Provides-Extra: all
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: windows
Description-Content-Type: text/markdown

# GitBridge - GitHub Repository Synchronization Tool

[![CI](https://github.com/nevedomski/gitBridge/workflows/CI/badge.svg)](https://github.com/nevedomski/gitBridge/actions)
[![GitHub Release](https://img.shields.io/github/v/release/nevedomski/gitbridge?include_prereleases&label=version)](https://github.com/nevedomski/gitbridge/releases)
[![PyPI Version](https://img.shields.io/pypi/v/gitbridge?label=pypi)](https://pypi.org/project/gitbridge/)
[![Python Versions](https://img.shields.io/pypi/pyversions/gitbridge)](https://pypi.org/project/gitbridge/)
[![codecov](https://codecov.io/gh/nevedomski/gitBridge/branch/main/graph/badge.svg)](https://codecov.io/gh/nevedomski/gitBridge)
[![Tests](https://img.shields.io/github/actions/workflow/status/nevedomski/gitbridge/ci.yml?branch=main&label=tests)](https://github.com/nevedomski/gitbridge/actions)
[![Known Vulnerabilities](https://snyk.io/test/github/nevedomski/gitbridge/badge.svg)](https://snyk.io/test/github/nevedomski/gitbridge)
[![Ruff Format](https://img.shields.io/github/actions/workflow/status/nevedomski/gitbridge/ruff-format.yml?branch=main&label=ruff%20format)](https://github.com/nevedomski/gitbridge/actions)
[![Ruff Lint](https://img.shields.io/github/actions/workflow/status/nevedomski/gitbridge/ruff-lint.yml?branch=main&label=ruff%20lint)](https://github.com/nevedomski/gitbridge/actions)
[![MyPy](https://img.shields.io/github/actions/workflow/status/nevedomski/gitbridge/mypy.yml?branch=main&label=mypy)](https://github.com/nevedomski/gitbridge/actions)
[![License](https://img.shields.io/github/license/nevedomski/gitbridge)](./LICENSE)
[![Docs](https://img.shields.io/badge/docs-github%20pages-blue)](https://nevedomski.github.io/gitBridge/)

**Production-ready tool to synchronize GitHub repositories when direct git access is blocked.**

🎯 **Status**: Security beta release v0.6.3b1 - All critical security issues fixed ✅

## Features

- **GitHub API Sync**: Uses GitHub's REST API for efficient repository synchronization
- **Browser Automation Fallback**: Falls back to Playwright-based browser automation if API access is blocked
- **Incremental Updates**: Only downloads changed files after initial sync
- **Configuration Support**: Flexible configuration via YAML files
- **Command-Line Interface**: Easy-to-use CLI for various sync operations
- **Progress Tracking**: Visual progress bars and detailed logging
- **Automatic Proxy Detection**: Auto-detects proxy settings from Windows/Chrome PAC scripts
- **Corporate Environment Support**: Works with SSL certificates and proxy configurations
- **Cross-Platform**: Works on Windows, Linux, and macOS
- **Comprehensive Testing**: 502+ tests with 83% code coverage

## Installation

Using [uv](https://github.com/astral-sh/uv):

```bash
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the project
uv pip install -e .

# Or install with development dependencies
uv pip install -e ".[dev]"

# Install with PAC proxy support (Windows)
uv pip install -e ".[pac]"
```

## Quick Start

1. Create a configuration file (`config.yaml`):

```yaml
repository:
  url: https://github.com/username/repo
  branch: main

local:
  path: /path/to/local/folder

auth:
  token: your_github_personal_access_token

sync:
  method: api  # or 'browser'
  incremental: true
```

2. Run the sync:

```bash
gitbridge sync --config config.yaml
```

## Usage

### Basic Sync
```bash
gitbridge sync --repo https://github.com/username/repo --local /path/to/local
```

### With Personal Access Token
```bash
gitbridge sync --repo https://github.com/username/repo --local /path/to/local --token YOUR_TOKEN
```

### Force Browser Mode
```bash
gitbridge sync --repo https://github.com/username/repo --local /path/to/local --method browser
```

### Check Repository Status
```bash
gitbridge status --config config.yaml
```

### Corporate Environment Support

For Windows users in corporate environments:

```bash
# Auto-detect proxy from Chrome/Windows settings
gitbridge sync --repo https://github.com/username/repo --local /path/to/local --auto-proxy

# Auto-detect certificates from Windows certificate store
gitbridge sync --repo https://github.com/username/repo --local /path/to/local --auto-cert

# Use both auto-detection features together
gitbridge sync --config config.yaml --auto-proxy --auto-cert

# Last resort: disable SSL verification
gitbridge sync --config config.yaml --auto-proxy --no-ssl-verify
```

Or add to your configuration file:

```yaml
sync:
  auto_proxy: true   # Auto-detect proxy from PAC
  auto_cert: true    # Auto-detect certificates from Windows
  # verify_ssl: false  # Only if absolutely necessary
```

The tool will automatically:
- Extract proxy settings from Windows/Chrome PAC scripts
- Export trusted certificates from Windows certificate store
- Combine them with certifi's default bundle
- Configure requests to use both proxy and certificates

## Configuration

### Environment Variables
- `GITHUB_TOKEN`: GitHub Personal Access Token
- `GITSYNC_CONFIG`: Default configuration file path

### Configuration File Format
See `config.example.yaml` for a complete example.

## Requirements

- Python 3.10+ (recommended: 3.11+)
- [uv](https://github.com/astral-sh/uv) for dependency management
- For browser mode: Chrome/Chromium and ChromeDriver

## Development

```bash
# Install development dependencies
make install-dev

# Format code
make format

# Run linting
make lint

# Type checking
make type-check

# Run tests
make test
```

## Limitations

- Binary files larger than 100MB may fail with API method
- Browser method is significantly slower than API method
- Some GitHub Enterprise features may not be supported

## License

MIT License