Private Bundle Repos - padogrid/padogrid GitHub Wiki

◀️ User Bundle Catalogs :link: Running Bundles in Container ▶️


If you have private bundle repos then you can access them using your personal access token or ssh public key.

Personal Access Token

Generating a personal access token

  1. Log into GitHub
  2. Click on your avatar icon in the upper right corner to display the pulldown menu.
  3. Select Settings
  4. Select Develper settings at the bottom of the left pane.
  5. Select Personal access tokens in the left pane.
  6. Select the Generate new token button.
  7. Copy the newly generated token.

See detailed instructions in the following link.

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

Caching your GitHub credentials in Git

You can cache your GitHub credentials to prevent repeatedly entering them when you access private repos.

1. Use git config credential.helper

Run the following command to temporarily cache your credentials. You can change the timeout value accordingly.

# Cache for 1 day (86400 seconds)
git config --global credential.helper 'cache --timeout=86400'

2. Use GitHub CLI to cache credentials. Follow the instructions in the link below to install GitHub CLI for your OS.

https://github.com/cli/cli#installation

Once installed, run the interactive command, gh, as follows.

gh auth login
  • When prompted for your preferred Git Operations, select HTTPS.
  • When asked if you would like to authenticate to Git with your GitHub credentials, enter 'Y'.
  • Select Paste an authentication token and paste your token.

3. Alternatively, on macOS, you can install GCM (Git Credential Manager). Please refer to the link below.

https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git

The GCM repo also provides installation instructions for macOS, Linux, and Windows. For example, on Linux, you can execute the following command to install GCM.

curl -LO https://aka.ms/gcm/linux-install-source.sh &&
sh ./linux-install-source.sh &&
git-credential-manager-core configure

ssh Public Key

Adding ssh Public Keys in GitHub

If you prefer to use ssh instead of https then you need to enter your public key in GitHub as follows.

  • Generate ssh keys.
ssh-keygen -t rsa
  • When prompted for Enter passphrase (empty for no passphrase):, leave blank, i.e., empty.
  • Copy the generated ~/.ssh/id_rsa.pub contents.
cat `~/.ssh/id_rsa.pub`
  • From your browser, go to your GitHub repo.
    • Select the Settings tab.
    • Select the Deploy keys option from the left pane.
    • Select the Add deploy key button.
    • Enter a name for your key in the Title field.
    • Paste the key contents in the Key field.
    • Select the Add key button to save the key.

You can also allow other users to access your private repos by adding their public keys.

Configuring GitHub ssh as Default

If you want to default to ssh for connecting to GitHub then set the GITHUB_PRIVATE_REPO_ENABLED environment variable to "true" in the ~/.padogrid/setenv.sh file as follows.

vi ~/.padogrid/setenv.sh

Added the following in ~/.padogrid/setenv.sh:

#
# Enter "true" to use ssh to clone GitHub repos, "false" to use https.
#
GITHUB_PRIVATE_REPO_ENABLED="true"

Running install_bundle with the option, -connect ssh

You can also use the -connect ssh option to connect to GitHub via ssh instead of setting the GITHUB_PRIVATE_REPO_ENABLED environment variable. For example, the following downloads and installs the specified bundle via ssh from the user1's GitHub account.

install_bundle -connect ssh -user user1 -download bundle-hazelcast-4-k8s-minishift

◀️ User Bundle Catalogs :link: Running Bundles in Container ▶️