Skip to content

chore(hooks): impl generate secrets for dvcr hook in go #1001

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yaroslavborbat
Copy link
Member

@yaroslavborbat yaroslavborbat commented Apr 29, 2025

Description

impl generate secrets for dvcr hook in go

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: module
type: feature
summary: impl generate secrets for dvcr hook in go

Copy link
Contributor

@danilrwx danilrwx left a comment

Choose a reason for hiding this comment

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

build failed

Copy link
Member

@fl64 fl64 left a comment

Choose a reason for hiding this comment

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

It is necessary that the old ones, which are created in the python hook, are also valid here

switch {
case dataFromValues.Htpasswd == "" && dataFromSecret.Htpasswd == "":
input.Logger.Info("Regenerate Htpasswd")
htpasswd, err := generateHtpasswd(password)
Copy link
Member

Choose a reason for hiding this comment

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

where is salt?

Copy link
Member Author

Choose a reason for hiding this comment

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

we not generate htpasswd with salt. Salt it is internal param REGISTRY_HTTP_SECRET for dvcr

Copy link
Member Author

Choose a reason for hiding this comment

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

https://distribution.github.io/distribution/about/configuration/

A random piece of data used to sign state that may be stored with the client to protect against tampering. For production environments you should generate a random piece of data using a cryptographically secure random generator. If you omit the secret, the registry will automatically generate a secret when it starts. If you are building a cluster of registries behind a load balancer, you MUST ensure the secret is the same for all registries.

fl64

This comment was marked as duplicate.

fl64

This comment was marked as duplicate.

@yaroslavborbat yaroslavborbat force-pushed the feat/impl-generate-sercrets-for-dvcr-in-go branch 5 times, most recently from 615c9ba to 2e53f24 Compare April 30, 2025 11:55
@yaroslavborbat yaroslavborbat changed the title feat(hooks): impl generate secrets for dvcr hook in go chore(hooks): impl generate secrets for dvcr hook in go Apr 30, 2025
@yaroslavborbat yaroslavborbat force-pushed the feat/impl-generate-sercrets-for-dvcr-in-go branch from 2e53f24 to 52c4e91 Compare April 30, 2025 14:35
@yaroslavborbat yaroslavborbat requested review from fl64 and danilrwx April 30, 2025 14:36
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@yaroslavborbat yaroslavborbat force-pushed the feat/impl-generate-sercrets-for-dvcr-in-go branch from 9bc1e02 to 051dc33 Compare April 30, 2025 16:57
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants