{"id":27972853,"url":"https://github.com/thiagobarbosa/github-package-proxy","last_synced_at":"2025-06-21T05:37:20.169Z","repository":{"id":214805618,"uuid":"737380548","full_name":"thiagobarbosa/github-package-proxy","owner":"thiagobarbosa","description":"A simple proxy application to expose Github Maven Packages without authentication","archived":false,"fork":false,"pushed_at":"2024-11-12T05:49:45.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T23:30:26.947Z","etag":null,"topics":["authentication","github","github-packages","gradle","libraries","maven","nodejs","packages","proxy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagobarbosa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-30T20:28:17.000Z","updated_at":"2024-11-12T05:49:49.000Z","dependencies_parsed_at":"2023-12-30T23:24:09.458Z","dependency_job_id":"fe4c7c3e-ea49-434e-ab64-0993709d66cc","html_url":"https://github.com/thiagobarbosa/github-package-proxy","commit_stats":null,"previous_names":["thiagobarbosa/github-package-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thiagobarbosa/github-package-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fgithub-package-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fgithub-package-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fgithub-package-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fgithub-package-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagobarbosa","download_url":"https://codeload.github.com/thiagobarbosa/github-package-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fgithub-package-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261070625,"owners_count":23105442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","github","github-packages","gradle","libraries","maven","nodejs","packages","proxy"],"created_at":"2025-05-07T23:20:06.759Z","updated_at":"2025-06-21T05:37:15.157Z","avatar_url":"https://github.com/thiagobarbosa.png","language":"JavaScript","readme":"# Github Package Proxy\n\nThis is a simple application to proxy the Gradle/Maven requests when importing your libraries published via Github Packages in order to allow anonymous requests.\n\nCurrently Github does not allow public access to your Github Packages. So when someone is importing your Github package they need to do so like this:\n\n```\nrepositories {\n    maven {\n        url = uri(\"https://maven.pkg.github.com/OWNER/REPOSITORY\")\n        credentials {\n            username = project.findProperty(\"gpr.user\") ?: System.getenv(\"USERNAME\")\n            password = project.findProperty(\"gpr.key\") ?: System.getenv(\"TOKEN\")\n        }\n   }\n}\n```\n\nWhich is basically unpractical for open sourced libraries.\n\nSo this application allows your library to be imported without credentials via Gradle or Maven. \n\nThis entire project will be deprecated once Github allows unauthenticated requests to packages.\nYou can read more about this discussion [here](https://github.com/orgs/community/discussions/26634).\n\n## How it works\n\n1. This app exposes an endpoint to be called on Gradle/Maven import files when importing your library\n2. The app then proxies the request to `maven.pkg.github.com` using your personal Github token that has access to the library\n3. The responses from `maven.pkg.github.com` is then returned to the caller.\n\n## Setup\n\n1. Inside file `server.js`, replace the variable `GITHUB_OWNER` by your Github username/organization that owns the repository for your package, and the variable `GROUP_ID` by the group id of your package (like `com/example`).\n2. Create a `.env` file and add a variable called `GITHUB_TOKEN` for your token. This token needs to have read access to packages on Github.\n\n## Usage\n\nWhen importing one of your packages, you can use the URL `https://urlForYourProxy` like this:\n\n```\nrepositories {\n    mavenCentral()\n    maven {\n        url = uri(\"https://urlForYourProxy\")\n    }\n}\n```\n\n```\ndependencies {\n    implementation \"com.{your-org-id}.{your-package-name}:{your-version}\"\n}\n```\n\n## Hosting your proxy\n\nThis proxy can be hosted anywhere that exposes a URL to the internet. This is an example to host it using Google Cloud Run:\n\n### Create a docker image\n\nYou can create your image running this command:\n\n```\ndocker build --tag {your-gcloud-region}-docker.pkg.dev/{your-gcloud-project-name}/{proxy-name}/main-image:latest .\n```\n\n### Push your docker image to Google Artifact Registry\n\nThen push it to Google Cloud:\n```\ndocker push {name-of-your-image-created-in-the-previous-step}\n```\n\n### Deploy your docker image to Google Cloud Run\n\nFinally, deploy your docker image to a Cloud Run application\n```\ngcloud run deploy {app-name} --allow-unauthenticated --image \"{image-name}\"\n```\n\nCloud Run will generate a public URL of your proxy app. You can create a custom domain for your app inside Cloud Run if you want to use a friendlier domain.\n\n## License\n\nThis code is free to use under the terms of the MIT licence. See [LICENSE](https://github.com/thiagobarbosa/github-package-proxy/blob/main/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagobarbosa%2Fgithub-package-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagobarbosa%2Fgithub-package-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagobarbosa%2Fgithub-package-proxy/lists"}