Commit Graph

70 Commits

Author SHA1 Message Date
Daniel J Walsh 409cc66a7c
Fix codespell errors
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-25 06:18:36 -04:00
Miloslav Trmač d8b67984d8 Use correct list syntax in containers-registries.conf(5)
Four leading spaces are interpreted by go-md2man as a code block.

Add a new line to start a new paragraph, so that go-md2man recognizes
the list syntax.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-22 17:45:09 +02:00
Valentin Rothberg 297ee4e43b man containers-registries.conf: clarify mirror association
Clarify that a `[[registry.mirror]]` is associated only with the
previous `[[registry]]`.

Fixes: #1523
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-04-22 09:04:01 +02:00
Qi Wang 0642df250f Add pull-from-mirror for adding per-mirror level restrictions
Close: https://github.com/containers/image/issues/1407
Add pull-from-mirror: all, digest-only, tag-only for adding per-mirror level restrictions
to image pull through mirrors.

The `mirror-by-digest-only` for primary is still allowed configuring,
and it is honored for compatibility

Signed-off-by: Qi Wang <qiwan@redhat.com>
2022-03-30 13:56:20 -04:00
Valentin Rothberg c828ec77f6 registries.conf: fix typo in prefix
The dot in a `*.` prefix is mandatory.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-28 10:48:47 +02:00
Valentin Rothberg f93baa51d7 registries.conf: prefixes: subdomain matching
Mention that wildcarded prefixes match an arbitrary number of
subdomains.

Closes: #1397
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-25 09:14:15 +01:00
svdHero 5431f38dce Adds hint about default config and removes obsolete markdown escaping
Signed-off-by: Joerg Baeuerle <joerg.baeuerle@gmx.net>
2022-01-18 13:16:01 +01:00
Reinhard Tartler d2c7b0b752 [CI:DOCS] Misc manpage fixups
Found by the Debian Lintian tool, this avoids some nroff warnings
in the generated manpages and allows proper whatis/apropos indexing.

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2021-10-06 15:42:53 -04:00
Miloslav Trmač 58a95db29d Fix documentation of oci: and oci-archive:
Fixes confusion reported in https://github.com/containers/podman/issues/11553 .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-09-14 10:58:28 +02:00
Daniel J Walsh d695b98f83
Merge pull request #1288 from saschagrunert/login-logout-tests
Support updating registry credentials scoped to namespaces/repos
2021-07-16 13:04:44 -04:00
Valentin Rothberg fede54a737 docs: containers-registries.conf.5.md
Drop "along as mentioned above" in the description of wildcards.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-14 11:01:02 +02:00
Valentin Rothberg 45a2d19dd1 docs: fix indentation in registries.conf
Fix a number of indentation issues in the containers-registries.conf man
page which caused rendering issues both in the man pages and the
upstream markdown on GitHub; move all to the root indent level/scope.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-14 11:00:12 +02:00
Sascha Grunert 2935f06f71
Error on namespaced registries for credential helpers
We now error on login if repositories or repository namespaces are used
for other credential helpers than the `AuthenticationFileHelper`. On
logout we ignore them and debug log a warning that nothing has been
modified.

The functions `SetCredentials` (for login) as well as
`RemoveAuthentication` (for logout) already feature support for path
based registries for the `AuthenticationFileHelper`. This patch adds
unit tests to ensure that the support will not break in the future.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-07-14 09:19:28 +02:00
Daniel J Walsh cdd6817ed6
Change all references to docker registry to container registry
Will leave references to distribution spec until there is an OCI Spec we
can point at.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-30 15:34:06 -04:00
Sascha Grunert 2cafc0105c
Add support for registry paths in auth.json
This patch adds support for `host[:port]/ns/…repo` to auth.json while
keeping the backwards compatible behavior.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-06-30 17:23:59 +02:00
Lokesh Mandvekar 373440662e Enable subdomain matching in registries.conf
This commit allows the prefix field in registries.conf to be in the
format: `prefix = "*.example.com" for wildcard subdomain matching.

refMatchesPrefix has been renamed to refMatchingPrefix. refMatchingPrefix
now returns the length of the prefix if there's a match
and the prefix doesn't contain `*.`. If prefix contains `*.` and there's
a match, then refMatchingPrefix returns the length of the refString
without the image. This change removes the need for
any additional string comparison in `rewriteReference`.

Co-authored-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2021-04-09 11:33:56 -04:00
Qi Wang f0555f0396 registries.conf: configure credential helpers
Allow for configuring credential helpers in `registries.conf` files.

Credential helpers are configured as a top-level field
`credential-helpers`.  This is an array of strings.  Items listed in the
array are consulted in the specified order when looking up or removing
credentials.

Note that there is a built-in credential helpers `containers-auth.json`
for using auth files.  If no global defaults are specified, we will
fallback to using auth files.  This assures backwards compat and a
working default setting.

The traces of the disabled "keyring" functionality have largely been
removed.  If we ever want to re-enable support, we can follow the
example of auth files and specify a new built-in keyring helper.

Using a built-in helper simplifies the code quite a bit since the code
structure boilds down to conditionally dispatching helpers; everything's
a credential helper with some special values for built-in helpers.

Make sure that the execution paths are properly logged (debug level).

Signed-off-by: Qi Wang <qiwan@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-04-02 14:45:07 +02:00
Josh Soref 111bf164be Spelling
* about
* appropriate
* busybox
* candidate
* candidates
* certificate
* config
* configuration
* containers
* decompression
* directory
* does-not/match
* does/not/exist
* doesnot
* doesnotexist
* exemplary
* garbage
* gzipped
* identify
* initially
* kubernetes
* length
* marshaling
* maximum
* mybetaproduct
* overridden
* parameter
* permissive
* policyconfiguration
* protocols
* reference
* referenceable
* requirement
* response
* simultaneously
* slashes
* subobject
* successfully
* this
* uncompressed
* unmarshaled
* unmarshaler
* unmarshaling it
* unmarshaller
* valid

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-23 14:37:37 -04:00
Dominic Yin f463e1409f fix typo in docs/containers-registries.conf.d.5.md
Signed-off-by: Dominic Yin <yindongchao@inspur.com>
2021-03-16 11:26:14 +01:00
Valentin Rothberg 9823c4765f short-name-aliases.conf: use cache folders instead of $HOME
As shown in github.com/containers/podman/issues/8559, writing to the
$HOME directory or root may be undesired.  Using /var/cache for root and
$HOME./cache for ordinary users, however, is common practice.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-09 11:42:28 +01:00
TerraTech 93436c61b3 Update containers-registries.conf.5.md
This change is intended to make the GitHub markdown render correctly.

The man page rendering was unaffected and still renders correctly.

Signed-off-by: TerraTech <TerraTech@users.noreply.github.com>
2021-02-02 03:04:09 -08:00
Lokesh Mandvekar f541c8245e Enable subdomain matching in policy.json
DockerReferenceNamespaces will also append wildcarded expressions for
subdomain matching in policy.json.

For example: [foo.example.com *.example.com *.com]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2021-01-14 10:10:12 -05:00
Miloslav Trmač 9dd2c4d959 Add a signedIdentity choice "type": "remapIdentity"
This allows accepting signatures for a complete or partial
mirror of some other repository namespace in a single step,
similar in signing effect to setting up mirrors in registries.conf,
but letting image consumers to refer to the mirrors directly.

For tag/digest matching, this currently only implemnents the
default matchRepoDigestOrExact-like semantics; it's the right
choice for almost all users, and we can add other alternatives
later if it turned out to be necessary.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-12-04 17:57:34 +01:00
Valentin Rothberg cf9ea2e816 pkg/shortnames
Add a new package for short-name resolution. `pkg/shortnames` is built
around the short-name aliasing in the registries.conf and introduces two
functions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-11-13 09:10:07 +01:00
Jason Travis 8cd70d6c93 docs: update reference to containers-registeries.d.md
Signed-off-by: Jason Travis <JasonTravis@nau.edu>
2020-10-23 18:08:35 -07:00
Qi Wang 259ec0bbdb Search credentials under XDG_CONFIG_HOME
Add XDG_CONFIG_HOME to the paths to be searched when login a registry. If XDG_CONFIG_HOME is empty, search under $HOME/.config. In the order that first search for authfile, XDG_RUNTIME_DIR, XDG_CONFIG_HOME, and docker config file.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-02 15:15:12 -04:00
Qi Wang 701023dd1a Set default rootless sigstore
Set default rootless sigstore to ~/.local/share/containers/sigstore if the caller is non-root.
Export the func ConfiguredSignatureStorageBase() for Podman image sign implementation.
Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-18 15:44:24 -04:00
Daniel J Walsh 33bcba75bb
Fix problems found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-15 10:17:41 -04:00
Qi Wang e5c467969e Support per user registries.d
Support per user  ~/.config/containers/registries.d to allow rootless podman push image sign.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-08-24 16:17:41 -04:00
Miloslav Trmač 0919e38dda Introduce docker-archive:path:@index syntax for reading untagged images
Add support for path:@index (e.g. path:@0, path:@1 ...) reference syntax
to docker-archive.

This will allow reading even untagged images from multi-image archives.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-08-20 09:56:08 +02:00
Miloslav Trmač c010778ba3 Allow choosing an image from tarfile.Reader by reference
We already accept the syntax for docker-archive: references,
now implement the lookup instead of warning and ignoring the value.

Implement the lookup in tarfile.Reader, not tarfile.Source,
because we will want to provide an API to obtain tags from a
Reader+Reference, without constructing a Source.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-08-20 09:56:08 +02:00
Qi Wang 3d43ff2de8 Load the rootless registries.conf.d for override
Load the rootless registries.conf.d for override

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-22 13:56:28 -04:00
Qi Wang dc78f17409 Add documentation for credHelper
Add documentation for credHelper. Close https://github.com/containers/libpod/issues/1675

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-04 14:56:51 -04:00
Qi Wang a20dbce9f7 Add hardcode Authfile for windows and mac
Add hardcode Authfile for windows and mac used for credential store.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-27 10:40:38 -04:00
Qi Wang 8cdf27d93a Add defaults for using the rootless policy path
Add support for default rootless policy path of $HOME/.config/containers/policy.json.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-14 12:13:03 -04:00
Daniel J Walsh 8051f86dde
Remove registries.conf VERSION 2 references from man page
VERSION 2 is fully supported, and should be just referred to as the current version.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 08:48:34 -04:00
Kang Huaishuai ced5884062
Update containers-registries.conf.5.md
Signed-off-by: Kang HuaiShuai <khs1994@khs1994.com>
2020-04-07 16:50:57 +08:00
Scott McCarty 5f92aa44cb
Updated warning about short names.
Patch originally from fatherlinux <smccarty@redhat.com>

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-13 08:28:45 -04:00
Valentin Rothberg 4227aadf4c containers-registries.conf.d: refine semantics
- Only load `.conf` suffixed files
- Enforce v2 format of registries.conf
- Don't recurse into sub-directories
- Rootless support
- Cache key consists of conf and dir path
- Merge `[[registry]]` tables
- Several code clean ups and minor fixes

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-13 11:23:55 +01:00
TomSweeneyRedHat 7b508e3100 Intial authfile man page
The initial man page for the authfile used by
the container tools.

Fixes: https://github.com/containers/libpod/issues/4359

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-03-04 08:38:39 -05:00
Daniel J Walsh 5ee42a1f9d Add $HOME/.config/containers/certs.d to perHostCertDirPath
We want to allow users to store certs in their homedir when running in rootless mode.
We want rootless podman and rootless buildah to add $HOME/.config/containers/certs.d
to the search path for certificates by default.

Currently there is no way for a non privileged user to get certs without being root on
the system or specify the certs dir on ever call.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-04 13:43:53 +01:00
Qi Wang 8c8fd0e70f Add $HOME/.config/containers/registries.conf to config path
provide per-user configuration of registries.conf under $HOME/.config/containers/registries.conf for other tools.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-04 10:53:07 +01:00
Valentin Rothberg eee0de5d00 registries.conf.d: add stances for the registries.conf
When loading the registries.conf, allow for loading additional files
from `/etc/containers/registries.conf.d`.  The files are loaded in
alpha-numerical order and specified fields will overwrite the previous
config.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-02 15:20:36 +01:00
Sascha Grunert 137bd7e0ff
Add documentation about rewriting docker.io registries
We now document the already existing internal `/library` suffix for
docker.io mirrors and provide an example how to deal with them.

I also fixed two typos in `containers-registries.d.5.md`.

Closes https://github.com/containers/image/issues/775

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-24 11:11:25 +01:00
TomSweeneyRedHat 9cabf276f5 Add registries warning to registries.conf
Add a warning about fully specifying registries
to the search list.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-12-13 17:51:49 -05:00
TomSweeneyRedHat 4009bbea65 Touch up transport man page
Touch up the containers-transports storage specificiation in the man page.

Fixes: #666

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-07-31 17:49:21 -04:00
W. Trevor King 8ed6527e91
*: Fix policy.json.md -> containers-policy.json.5.md references
Catching up with be91505 (docs: rename manpages to *.5.md, 2019-03-01, #594).

Generated with:

  $ sed -i 's/policy.json.md/containers-policy.json.5.md/g' $(git grep -l policy.json.md)

Looking to carry this over the finish line for Wking.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-21 04:02:18 -04:00
Sascha Grunert 067419f751
Fix typo in docs/containers-registries.conf.5.md
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-06-18 14:40:34 +02:00
Miloslav Trmač 4cd207c0a7 RFC: Significantly restructure the registries.conf documentation
Primarily, start with explaining the "prefix" field and its matching semantics,
and only then explain other fields.

Also, use definition lists (using a Markdown extension supported by go-md2man)
for the individual options instead of wordy "The option `foo` will ..." text
to make it easier to find the relevant sections.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-06-11 20:42:44 +02:00
Miloslav Trmač 586de82af5 Replace Registry.Search with V2RegistriesConfig.UnqualifiedSearchRegistries
This makes the order of all of the []Registry entries irrelevant, makes the
search order easy to find/determine, and makes it much easier to edit either
the search list or the other attributes of registries independently.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-05-29 00:30:42 +02:00