FastGithub Documentation

repository·main·Indexed 21 days ago

https://github.com/wanggithubuser/fastgithub

FastGithub is a tool designed to accelerate access to GitHub services by providing clean IP resolution, IP speed testing, and custom TLS configurations. It helps resolve connectivity issues with GitHub, Git operations (clone, pull, push), and CDN resources. The tool supports deployment on macOS, Windows, Linux, and via Docker Compose, and includes guides for configuring system proxies and trusting self-signed CA certificates in Git and Firefox.

Tokens
2.6K
Snippets
7
Records
16
Agent score
72%

What's inside FastGithub

  1. Overview of FastGithub

    main

    FastGithub is a tool designed to accelerate access to GitHub services. It addresses common connectivity issues such as the inability to open GitHub, failure to load user avatars, issues with uploading/downloading releases, and failures during git-clone, git-pull, or git-push operations.

    Key Features:

    • Provides clean IP resolution for domains.
    • Performs IP speed testing and selects the fastest available IP.
    • Allows custom TLS connection configurations for domains.
    • Replaces Google CDN resources to resolve loading issues for JS and CSS on various international websites.
  2. Install the FastGithub certificate on macOS

    main

    To allow FastGithub to function correctly, you must install and trust its certificate via Keychain Access:

    1. Launch FastGithub. This will generate a cacert directory in the application folder.
    2. Open the cacert directory and double-click fastgithub.cer.
    3. The Keychain Access window will open. Locate FastGitHub in the list and double-click it.
    4. In the certificate details window, expand the Trust section.
    5. Change the setting to Always Trust.
  3. Configure Manual Proxy on macOS

    main

    If you prefer manual configuration, use the following steps:

    1. Open System Settings (or System Preferences) on your Mac.
    2. Navigate to Network.
    3. Click Advanced.
    4. Select the Proxies tab.
    5. Check both Web Proxy (HTTP) and Secure Web Proxy (HTTPS).
    6. Enter the proxy address displayed in the FastGithub application window.
  4. Deploy FastGithub using Docker Compose

    main

    You can use docker-compose for quick deployment, typically used for demo purposes or temporary projects.

    Requirements:

    • Docker 18.09 or higher
    • Docker Compose

    Steps:

    1. Locate the docker-compose.yaml file in the source directory.
    2. Update the sample and build images in docker-compose.yaml according to your specific needs to accelerate github.com source code access.
  5. Configure Automatic Proxy on macOS

    main

    You can use the automatic proxy configuration provided by FastGithub:

    1. Open System Settings (or System Preferences) on your Mac.
    2. Navigate to Network.
    3. Click Advanced.
    4. Select the Proxies tab.
    5. Check the box for Automatic Proxy Configuration.
    6. Enter the proxy address displayed in the FastGithub application window.
  6. Deploy FastGithub on macOS

    main

    To use FastGithub on macOS, follow these steps:

    1. Run the fastgithub binary by double-clicking it.
    2. Install the certificate located at cacert/fastgithub.cer and set it to Trusted.
    3. Configure your system proxy (automatic or manual HTTP/HTTPS) to: http://127.0.0.1:38457.

    For detailed configuration steps, refer to the MacOSXConfig.md file in the repository.

  7. Deploy FastGithub via Docker Compose

    main

    For environments with Docker 18.09 and docker-compose installed, you can use the provided docker-compose.yaml file.

    To use it for a specific project (e.g., accelerating a local build of GitHub source code):

    1. Locate the docker-compose.yaml in the source directory.
    2. Update the sample and build images within the file to match your requirements.
    3. Run docker-compose up to deploy.
  8. Deploy FastGithub on Linux

    main

    FastGithub supports running as a standalone terminal application or as a systemd service on Linux x64.

    Terminal Mode

    Run the binary with sudo: sudo ./fastgithub

    Service Mode (systemd)

    • Install and start service: sudo ./fastgithub start
    • Uninstall and stop service: sudo ./fastgithub stop

    Proxy Configuration

    After running, you must configure your system to use the local proxy. Set your automatic system proxy or manually configure HTTP/HTTPS proxy to: http://127.0.0.1:38457

    # Run in terminal
    sudo ./fastgithub
    
    # Install as systemd service
    sudo ./fastgithub start
    
    # Stop and uninstall service
    sudo ./fastgithub stop
    
    # Proxy address to use
    # http://127.0.0.1:38457
  9. Deploy FastGithub using Docker Compose

    main

    You can deploy FastGithub and a sample build environment using the provided docker-compose.yaml. The setup consists of three services:

    1. fastgithub: The core service using the slcnx/fastgithub image. It runs in host network mode and uses a named volume cacert to persist certificates.
    2. sample: A client environment (based on ubuntu:18.04) used to demonstrate the acceleration. It depends on fastgithub, uses host network mode, and automatically installs the FastGithub certificate and clones a repository (kubernetes/kubernetes) upon startup. It routes traffic through the FastGithub proxy via https_proxy and http_proxy environment variables.
    3. build: An Nginx-based service that depends on the sample service to process or serve data from the shared build_data volume.

    Note on Networking: The services use network_mode: host, meaning they share the host's network stack. This is required for the proxy to intercept traffic correctly.

    version: "3.7"
    services:
      fastgithub:
        image: slcnx/fastgithub
        network_mode: host
        restart: always
        volumes:
        - cacert:/fastgithub/cacert/
      sample:
        depends_on:
        - fastgithub
        image: slcnx/ubuntu:18.04
        volumes:
        - cacert:/tmp/cacert
        - build_data:/build_data
        working_dir: /build_data
        restart: on-failure
        tty: true
        entrypoint: sh -c 'cp /tmp/cacert/fastgithub.cer /usr/local/share/ca-certificates/fastgithub.crt && update-ca-certificates && git clone https://github.com/kubernetes/kubernetes.git'
        command: ""
        environment:
          https_proxy: http://127.0.0.1:38457
          http_proxy: http://127.0.0.1:38457
        network_mode: host
      build:
        working_dir: /build_data
        depends_on:
        - sample
        image: nginx
        volumes:
        - build_data:/build_data
    volumes:
      cacert: {}
      build_data: {}
  10. Deploy FastGithub on Windows

    main

    FastGithub can be run as a desktop application or installed as a Windows service.

    Desktop Mode (x64)

    Double-click FastGithub.UI.exe to run the graphical interface.

    Service Mode (x64)

    Use the CLI to manage the installation of FastGithub as a Windows service:

    • Install and start service: fastgithub.exe start
    • Uninstall and stop service: fastgithub.exe stop
    # Install and start as a Windows service
    fastgithub.exe start
    
    # Uninstall and stop the service
    fastgithub.exe stop
  11. Resolve macOS 'developer cannot be verified' error

    main

    If macOS prevents you from opening FastGithub with the error "XXX" cannot be opened because the developer cannot be verified, you must remove the quarantine attribute from the application files.

    Open your terminal, navigate to the directory containing the FastGithub executable, and run the following command:

    sudo xattr -d com.apple.quarantine *.*
  12. Configure Certificate Trust for FastGithub

    main

    FastGithub generates a unique self-signed CA certificate for each host, stored in the cacert folder. To use the service, the client device must install and unconditionally trust this CA certificate.

    Security Warning: Do not share your certificate private key with others to avoid potential security risks.

    Application Specific Fixes:

    Git

    If Git returns an SSL certificate problem, force Git to use the system's certificate library:

    git config --global http.sslbackend schannel

    Firefox

    If Firefox displays a connection is potentially insecure warning:

    1. Navigate to Settings -> Privacy & Security.
    2. Under the Certificates section, click View Certificates.
    3. Go to the Authorities tab.
    4. Click Import and select the file cacert/fastgithub.cer.
    5. Check the box "Trust this CA to identify websites".