Categorygithub.com/greboid/registryauth
module
1.0.20
Repository: https://github.com/greboid/registryauth.git
Documentation: pkg.go.dev

# README

Docker registry authentication

Provides token based authentication for a registry server allowing public read access to select resources whilst restricting write access and read access to any resources not exposed publicly.

There are three binaries available for building and containers published for all.

Common configuration

CLI FlagEnv varDescription
-portPORTServer port to listen on, defaults to 8080
-publicPUBLICcomma separated list of prefixes that will be public, a leading slash is not required, except if you want the entire registry to be public, set this to /
-usersUSERSjson list list of users if using in compose append a pipe after the env var and put a user per line you'll need to double the dollar symbols to escape them ie username:$$crypted$$password
-realmREALMRealm for the registry
-issuerISSUERIssuer for the registry
-serviceSERVICEService for the registry
-data-dirDATA_DIRData directory for storing certificates and registry data (if required)
-cert-dirCERT_DIRDirectory for storing the generated certificates, by default this will be [DATA_DIR]/certs

There is also support for showing a basic registry listing, this can be configured with the below settings.

The self-contained registry will show these on the index page, the auth component will add them to the root of wherever this is being served, so you'll likely want to add some proxy rules to accommodate this.

CLI FlagEnv VarDescription
-show-indexSHOW_INDEXShow's a basic index page rather than an empty page
-show-listingsSHOW_LISTINGSIndex page lists all public repositories (does not require -show-index)
-registry-hostREGISTRY_HOSTThe full URL of the registry to be listed
-refresh-intervalREFRESH_INTERVALTime between refreshes of the internal registry. This is go duration

Generating passwords

The passwords are bcrypted, and can be generated with the genpass command, this takes no arguments and will output the crypted version of the entered password.

Self Contained

The self-contained option does need to be given a path for the registry data

CLI FlagEnvironment variableDescription
-registry-dirREGISTRY_DIRPath to the registry data, by default this will be [DATA_DIR]/registry

Auth component

The auth component will create a set of certificates and output these to disk, it will then listen on the configured port for requests from the registry and answer them accordingly. You'll need to configure the registry to have access to the certificate produced by this project as it will be used to sign requests, you'll also need to set the following options to match those configured on the auth component. The certificate will be [CERT_DIR]/cert.pem and the key if required will be [CERT_DIR]/key.pem

Environment Variables:

REGISTRY_AUTH: token
REGISTRY_AUTH_TOKEN_REALM: https://<hostname>/auth
REGISTRY_AUTH_TOKEN_SERVICE: <service name>
REGISTRY_AUTH_TOKEN_ISSUER: <issuer name>
REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: <CERT_DIR>/cert.pem

Configuration File:

auth:
  token:
    realm: https://<hostname>/auth
    service: <service name>
    issuer: <issuer name>
    rootcertbundle: <CERT_DIR>/cert.pem

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author