Add support for other GitHub user packages - not just self-owned#19
Open
hedrickbt wants to merge 4 commits intowilldurand:mainfrom
Open
Add support for other GitHub user packages - not just self-owned#19hedrickbt wants to merge 4 commits intowilldurand:mainfrom
hedrickbt wants to merge 4 commits intowilldurand:mainfrom
Conversation
…you use a devcontainer since the binary built in the devcontainer is mounted back to the original filesystem.
…omma delimited list of GitHub username to pull packages for.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can supply a GITHUB_USERS environment variable that contains a comma delimited list of GitHub users.
Ex: export GITHUB_USERS="blakeblackshear,someotherusername"
By doing so not only will container registry proxy list the packages from your own GitHub account, but also the packages available in the other user accounts.
I have provided an updated Docker image for testing
hedrickbt/container-registry-proxy:main.bth
https://hub.docker.com/repository/docker/hedrickbt/container-registry-proxy/general
TESTS
Multiple users, but one is a duplicate
export GITHUB_USERS="blakeblackshear,blakeblackshear"
2024/02/17 18:06:52 starting container registry proxy on 127.0.0.1:10000
2024/02/17 18:06:57 Catalog Request GET -> /v2/_catalog
2024/02/17 18:06:57 GitHub Users ,blakeblackshear,blakeblackshear
2024/02/17 18:06:57 ListPackages for "" found 0 new packages
2024/02/17 18:06:57 ListPackages for "blakeblackshear" found 1 new packages
2024/02/17 18:06:58 ListPackages for "blakeblackshear" found 0 new packages
If you don't export GITHUB_USERS, it will only do the default, self, packages
unset GITHUB_USERS
2024/02/17 18:12:23 starting container registry proxy on 127.0.0.1:10000
2024/02/17 18:12:29 Catalog Request GET -> /v2/_catalog
2024/02/17 18:12:29 GitHub Users
2024/02/17 18:12:29 ListPackages for "" found 0 new packages
If at least 1 username does not get an error for the package list, , it will be returned to synology
export GITHUB_USERS="blakeblackshear2,blakeblackshear"
2024/02/17 18:18:04 starting container registry proxy on 127.0.0.1:10000
2024/02/17 18:18:20 Catalog Request GET -> /v2/_catalog
2024/02/17 18:18:20 GitHub Users ,blakeblackshear2,blakeblackshear
2024/02/17 18:18:20 ListPackages for "" found 0 new packages
2024/02/17 18:18:20 WARN ListPackages for "blakeblackshear2" error: GET https://api.github.com/users/blakeblackshear2/packages?package_type=container: 404 Not Found []
2024/02/17 18:18:21 ListPackages for "blakeblackshear" found 1 new packages
If every single username, including the default user "", fails a generic error will be shown by Synology. Ex invalid github token.
2024/02/17 18:21:27 starting container registry proxy on 127.0.0.1:10000
2024/02/17 18:21:33 Catalog Request GET -> /v2/_catalog
2024/02/17 18:21:33 GitHub Users ,blakeblackshear2,blakeblackshear2
2024/02/17 18:21:33 WARN ListPackages for "" error: GET https://api.github.com/user/packages?package_type=container: 401 Bad credentials []
2024/02/17 18:21:33 WARN ListPackages for "blakeblackshear2" error: GET https://api.github.com/users/blakeblackshear2/packages?package_type=container: 401 Bad credentials []
2024/02/17 18:21:34 WARN ListPackages for "blakeblackshear2" error: GET https://api.github.com/users/blakeblackshear2/packages?package_type=container: 401 Bad credentials []
2024/02/17 18:21:34 Not Found GET /v1/search?q=library/&n=50&page=1 -> https://ghcr.io