Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 1.86 KB

File metadata and controls

75 lines (60 loc) · 1.86 KB

git-proxy in Java

This is a simple implementation of a git proxy in Java. This is a possible successor to finos/git-proxy which is written in Node.

Usage

To use this project, you need to have Java 17 or higher installed on your machine. You can run the project using the following command:

./gradlew run

Configuration

The Jetty-based server supports YAML-based configuration for providers and filters. Configuration files:

  • src/main/resources/application.yml - Base configuration
  • src/main/resources/application-local.yml - Local overrides

See CONFIGURATION.md for detailed configuration options.

Quick Configuration Example

Configure providers and filters in application-local.yml:

server:
  port: 8080

git-proxy:
  providers:
    github:
      enabled: true
    gitlab:
      enabled: true
    bitbucket:
      enabled: true
  filters:
    github-user-authenticated:
      enabled: true
      order: 1
      operations:
        - PUSH
      required-auth-schemes: bearer, token, basic
      providers:
        - github
    whitelists:
      - enabled: true
        order: 5
        operations:
          - FETCH
          - PUSH
        providers:
          - github
        slugs:
          - coopernetes/test-repo
          - finos/git-proxy

Endpoints

The proxy has support for GitHub, GitLab, and Bitbucket. The following endpoints are available which can be used to interact with an upstream git server:

  • /github.com/{owner}/{repo}
  • /gitlab.com/{owner}/{repo}
  • /bitbucket.org/{owner}/{repo}

An example of how to use the proxy is as follows:

git clone http://localhost:8080/github.com/finos/git-proxy.git

Demo

demo 1

demo 2

Running the server demo 3