flowchart TD
A[Start] --> B{Check Chrome<br/>Preferences}
B -->|Found| C[Extract PAC URL]
B -->|Not Found| D{Check Windows<br/>Registry}
C --> E[Download PAC Script]
D -->|Found| E
D -->|Not Found| F[Check Env Variables]
E --> G[Parse JavaScript]
G --> H[Determine Proxy<br/>for github.com]
H --> I[Configure Requests]
F --> I
network:proxy:http:http://proxy.company.com:8080https:http://proxy.company.com:8080no_proxy:-localhost-127.0.0.1-.company.internal# With authenticationauth:username:${PROXY_USER}# From environmentpassword:${PROXY_PASSWORD}# From environment
sync:auto_cert:true# GitBridge will:# 1. Extract from Windows store (if on Windows)# 2. Combine with certifi bundle# 3. Create temporary combined bundle
# GitBridge Windows Setup Script# Set up environment variables$env:GITHUB_TOKEN=Read-Host"Enter GitHub Token"-AsSecureString$env:GITSYNC_CONFIG="$HOME\.gitbridge\config.yaml"# Create config directoryNew-Item-ItemTypeDirectory-Force-Path"$HOME\.gitbridge"# Auto-detect proxy from IE/Edge$proxy=(Get-ItemProperty-Path'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings').ProxyServerif($proxy){$env:HTTPS_PROXY="http://$proxy"Write-Host"Proxy detected: $proxy"}# Install GitBridge with Windows supportpipinstall"gitbridge[win,pac]"# Test configurationgitbridgestatus--auto-proxy--auto-certWrite-Host"Setup complete! Run 'gitbridge sync --config $env:GITSYNC_CONFIG' to start"
# What happens internally:importwincertstore# Open Windows certificate storesforstorenamein('CA','ROOT'):withwincertstore.CertSystemStore(storename)asstore:forcertinstore:# Export and add to bundlepem_cert=cert.get_pem()# Added to temporary certificate bundle
# config-corporate.yamlrepository:url:https://github.com/company/internal-repobranch:mainlocal:path:C:\Projects\internal-repoauth:token:${GITHUB_TOKEN}network:proxy:https:http://${DOMAIN_USER}:${DOMAIN_PASS}@proxy.company.com:8080ssl:ca_bundle:C:\Company\Certificates\ca-bundle.crtsync:method:apiauto_proxy:false# Using manual configauto_cert:false# Using manual config
# config-pac.yamlrepository:url:https://github.com/company/projectlocal:path:~/projects/company-projectsync:auto_proxy:true# Detect from PACauto_cert:true# Detect from Windowsmethod:api# Fallback if detection failsfallback:proxy:http://proxy.company.com:8080no_ssl_verify:true# Last resort
#!/usr/bin/env python3"""Test corporate network configuration for GitBridge."""importrequestsimportosfromurllib.parseimporturlparsedeftest_connection():"""Test various connection methods."""# Test direct connectionprint("Testing direct connection...")try:r=requests.get("https://api.github.com",timeout=10)print(f"✓ Direct connection: {r.status_code}")exceptExceptionase:print(f"✗ Direct connection failed: {e}")# Test with proxyproxy=os.environ.get('HTTPS_PROXY')ifproxy:print(f"\nTesting with proxy: {proxy}")try:r=requests.get("https://api.github.com",proxies={'https':proxy},timeout=10)print(f"✓ Proxy connection: {r.status_code}")exceptExceptionase:print(f"✗ Proxy connection failed: {e}")# Test with custom certificatesca_bundle=os.environ.get('REQUESTS_CA_BUNDLE')ifca_bundle:print(f"\nTesting with certificates: {ca_bundle}")try:r=requests.get("https://api.github.com",verify=ca_bundle,timeout=10)print(f"✓ Certificate validation: {r.status_code}")exceptExceptionase:print(f"✗ Certificate validation failed: {e}")if__name__=="__main__":test_connection()
# Windows corporate setup (most common)gitbridgesync--auto-proxy--auto-cert--configconfig.yaml
# Manual proxy with authexportHTTPS_PROXY=http://DOMAIN\\username:password@proxy:8080
gitbridgesync--configconfig.yaml
# Custom certificate bundleexportREQUESTS_CA_BUNDLE=/path/to/company-certs.pem
gitbridgesync--configconfig.yaml
# Browser method when API is blockedgitbridgesync--methodbrowser--configconfig.yaml
# Debug mode for troubleshootinggitbridgesync--verbose--debug--configconfig.yaml
# Last resort (insecure!)gitbridgesync--no-ssl-verify--configconfig.yaml