Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T7092: Add Container Registry Mirror #4321

Open
wants to merge 3 commits into
base: current
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/templates/container/registries.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@
{% set _ = registry_list.append(r) %}
{% endfor %}
unqualified-search-registries = {{ registry_list }}
{% for r, r_options in registry.items() if r_options.disable is not vyos_defined %}
[[registry]]
location = "{{ r_options.mirror if r_options.mirror is vyos_defined else r }}"
insecure = {{ 'true' if r_options.insecure is vyos_defined else 'false' }}
prefix = "{{ r }}"
{% endfor %}
{% endif %}
14 changes: 14 additions & 0 deletions interface-definitions/container.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,20 @@
<children>
#include <include/interface/authentication.xml.i>
#include <include/generic-disable-node.xml.i>
<leafNode name="insecure">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How common are HTTP-only mirrors in the age of Let's Encrypt? Are there compelling arguments to support them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell how common, but those I have access to are all ip:port only and only for development servers and developer's machines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should insecure & authentication nodes be mutually exclusive?
Can't see it ever being advisable to send credentials over plaintext...

Copy link
Contributor Author

@sskaje sskaje Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should insecure & authentication nodes be mutually exclusive? Can't see it ever being advisable to send credentials over plaintext...

Theoritically yes, but you can't expect small company do everything right in their LAN.
throw a warning is enough.

Also, insecure can be used for self-signed certificate: https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md

insecure : true or false. By default, container runtimes require TLS when retrieving images from a registry. If insecure is set to true, unencrypted HTTP as well as TLS connections with untrusted certificates are allowed.

<properties>
<help>Set to allow registry using unencrypted HTTP as well as TLS connections with untrusted certificates.</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="mirror">
<properties>
<help>Registry mirror, use host[:port][/path]</help>
<constraint>
<regex>^(?:[[:alnum:]-]+(?:\.[[:alnum:]-]+)*|(?:[[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}|\[[[:xdigit:]:]+])(?::[[:digit:]]{1,5})?(?:\/[^[:space:]?#]*)?$</regex>
</constraint>
</properties>
</leafNode>
</children>
</tagNode>
</children>
Expand Down
Loading