A Bluelink Registry Protocol implementation for plugins sourced from private GitHub repositories.
The Bluelink GitHub Registry is distributed as a Docker image that is published to the GitHub Container Registry.
To run the registry, you can use the following command:
docker run -d \
--name bluelink-github-registry \
-p 8085:8085 \
ghcr.io/newstack-cloud/bluelink-github-registry:latestDocker compose example:
services:
bluelink-github-registry:
image: ghcr.io/newstack-cloud/bluelink-github-registry:latest
container_name: bluelink-github-registry
ports:
- "8085:8085"You can deploy the registry to any environment that supports Docker, including Kubernetes, AWS ECS, and Azure Container Instances.
The Bluelink GitHub Registry is versioned using semantic versioning.
The Docker image is tagged with the version number, and the latest tag always points to the latest stable release.
There is a daily docker build for the main branch, this should be considered as a development build and can be used through the main docker image tag.
Configuration for the registry is expected to be provided via environment variables.
The following environment variables are supported, where some are required and some are optional:
BLUELINK_GITHUB_REGISTRY_PORT
optional
The port on which the registry will listen for incoming requests.
default value: 8085
BLUELINK_GITHUB_REGISTRY_AUTH_TOKEN_HEADER
optional
The name of the header that will be used to pass the authentication token to the registry.
This will be used to authenticate requests and is where a GitHub fine-grained personal access token should be provided.
You will need to make sure that the fine-grained token is for the resource owner of the plugin repositories (e.g. the GitHub user or organisation that owns the plugin repositories).
The service discovery document for the registry will include this header in the auth.v1 section as the value of the apiKeyHeader field.
default value: bluelink-gh-registry-token
BLUELINK_GITHUB_REGISTRY_BASE_URL
required
The base URL of the registry. This is used to construct the endpoints in the service discovery document
for the registry.
This should be a fully qualified URL, including the scheme (http or https).
When deploying the registry this would be something like https://registry.example.io,
or when running locally it could be http://registry.example.local.
The fully-qualified domain name in the URL must be the same as the prefix for plugins in the registry.
For example, if the base URL is https://registry.example.io, then the plugin prefix must be registry.example.io in order for the Bluelink CLI to be able to find the correct service discovery document.
Even when running locally, it is best to use a host name alias instead of localhost with port numbers due to the way the CLI resolves the registry based on the domain prefix in the plugin ID.
When deploying the registry, it is advised that you set up a TLS certificate for the registry to ensure that the registry is only accessible over HTTPS.
BLUELINK_GITHUB_REGISTRY_SIGNING_PUBLIC_KEYS
required
A serialised JSON string that contains the gpg public keys that can be used by the Bluelink CLI (and other clients) to verify the signatures of the plugins in the registry as per the Registry Protocol. The amount of signing keys that can be stored in this environment variable is limited by the maximum length (in bytes) of an environment variable in the operating system running the registry application. You can find instructions to generate the signing keys environment variable here.
The JSON contents should be of the following form:
{
"keys": [
{
"publicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n...\n-----END PGP PUBLIC KEY BLOCK-----"
}
]
}The public key should be in ASCII-armored format, and the file can contain multiple keys. This JSON contents should be prepared to be passed as an environment variable, with appropriate escaping to ensure it can be parsed as valid JSON by the registry application.
It should be noted that the signing keys environment variable contents must not contain any private keys, these must be kept separately in a secure environment and only used in your plugin release process.
BLUELINK_GITHUB_REGISTRY_HTTP_CLIENT_TIMEOUT
optional
The timeout in seconds for HTTP clients that are used to fetch resources from the release artifacts for a plugin version.
default value: 60
BLUELINK_GITHUB_REGISTRY_LOGGING_LEVEL
optional
The logging level for the registry. This can be set to debug, info, warn, or error.
This will control the verbosity of the logs that are generated by the registry.
default value: info
BLUELINK_GITHUB_REGISTRY_ENVIRONMENT
optional
The environment in which the registry is running. This can be set to development or production.
This is primarily used to control the formatting of logs. Logs are structured JSON logs in production and pretty printed in development.
default value: production
BLUELINK_GITHUB_REGISTRY_ACCESS_LOG_FILE
optional
The file path to which the access log will be written.
If not specified, the access log will be written to stdout.
BLUELINK_GITHUB_REGISTRY_OUTPUT_LOG_FILE
optional
The file path to which application logs (debug, info) will be written to.
If not specified, the application logs will be written to stdout.
BLUELINK_GITHUB_REGISTRY_ERROR_LOG_FILE
optional
The file path to which error logs (warn, error) will be written to.
If not specified, the error logs will be written to stderr.