Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GitHub Enterprise Server #2729

Open
suzuki-shunsuke opened this issue Mar 10, 2024 · 1 comment
Open

Support GitHub Enterprise Server #2729

suzuki-shunsuke opened this issue Mar 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@suzuki-shunsuke
Copy link
Member

Feature Overview

Support Registries and packages hosted at GitHub Enterprise Servers.

Why is the feature needed?

Some users use GitHub Enterprise Servers and host internal tools.
It would be nice that they can host private Registries and distribute their tools with aqua.

Workaround

No response

Example Code

registry.yaml

Add .hosts and .packages[].host.

hosts:
- name: example
  github_enterprise:
    base_url: htttps://example.com
    upload_url: htttps://example.com
packages:
- type: github_release
  host: example
  repo_owner: aquaproj
  repo_name: example

aqua.yaml

Add .hosts and .registries[].host.

hosts:
  - name: example
    github_enterprise:
      base_url: htttps://example.com
      upload_url: htttps://example.com
      token_envs:
        - GH_ENTERPRISE_TOKEN
    hosts:
      - name: example
        token_envs:
          - GH_ENTERPRISE_TOKEN
registries:
  - name: foo
    type: github_content
    host: example
    repo_owner: aquaproj
    repo_name: aqua-registry
    ref: v3.90.0
    path: registry.yaml

Note

This issue is based on the discussion https://github.com/orgs/aquaproj/discussions/2726#discussioncomment-8713641 .

https://pkg.go.dev/github.com/google/go-github/v60/github#Client.WithEnterpriseURLs

WithEnterpriseURLs returns a copy of the client configured to use the provided base and upload URLs. If the base URL does not have the suffix "/api/v3/", it will be added automatically. If the upload URL does not have the suffix "/api/uploads", it will be added automatically.

Note that WithEnterpriseURLs is a convenience helper only; its behavior is equivalent to setting the BaseURL and UploadURL fields.

Another important thing is that by default, the GitHub Enterprise URL format should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. The upload URL format should be http(s)://[hostname]/api/uploads/.

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label Mar 10, 2024
@suzuki-shunsuke suzuki-shunsuke moved this to Backlog in main Mar 10, 2024
@bhundven
Copy link
Contributor

If there is anything I can test, I would be very happy to do so!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Backlog
Development

No branches or pull requests

2 participants