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

#2420 …Handle encrypted_settings_key_base variable #2631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ymazzer
Copy link

@ymazzer ymazzer commented Sep 5, 2022

#2420 Handle encrypted_settings_key_base variable to allow restoring backups from gitlab instances not running from this image and using encrypted settings feature.

Copy link
Contributor

@kkimurak kkimurak left a comment

Choose a reason for hiding this comment

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

Hi, thank you for your contribution. Generally looks good.
I have commented on whether the parameter GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE should be required or not. I would appreciate it if you could confirm it.

assets/runtime/functions Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ymazzer
Copy link
Author

ymazzer commented Sep 12, 2022

Hi,

Just a little up, to check whether you can merge it?

Copy link
Contributor

@kkimurak kkimurak left a comment

Choose a reason for hiding this comment

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

Sorry for late, LGTM. Thank you for your contribution.

When I reviewed it again, I noticed that there were some codes report error when secret variables were not set. If your first code followed them, I might have done an unnecessary (and confusing) review.

Btw, I'm just a one of contributor. So please ask @sachilles to merge this PR by yourself (I'll enclose the mention in a code block to avoid pinging maintainers if it's not necessary - i.e. this comment does not send him notifications)

@@ -148,11 +148,12 @@ The quickest way to get started is using [docker-compose](https://docs.docker.co
wget https://raw.githubusercontent.com/sameersbn/docker-gitlab/master/docker-compose.yml
```

Generate random strings that are at least `64` characters long for each of `GITLAB_SECRETS_OTP_KEY_BASE`, `GITLAB_SECRETS_DB_KEY_BASE`, and `GITLAB_SECRETS_SECRET_KEY_BASE`. These values are used for the following:
Generate random strings that are at least `64` characters long for each of `GITLAB_SECRETS_OTP_KEY_BASE`, `GITLAB_SECRETS_DB_KEY_BASE`, `GITLAB_SECRETS_SECRET_KEY_BASE`, `GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE`. These values are used for the following:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Generate random strings that are at least `64` characters long for each of `GITLAB_SECRETS_OTP_KEY_BASE`, `GITLAB_SECRETS_DB_KEY_BASE`, `GITLAB_SECRETS_SECRET_KEY_BASE`, `GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE`. These values are used for the following:
Generate random strings that are at least `64` characters long for each of `GITLAB_SECRETS_OTP_KEY_BASE`, `GITLAB_SECRETS_DB_KEY_BASE`, `GITLAB_SECRETS_SECRET_KEY_BASE` and `GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE`. These values are used for the following:

@ymazzer
Copy link
Author

ymazzer commented May 11, 2023

Hi,

Juste a little gentle reminder on this PR to know what is still required to merge?

@ymazzer
Copy link
Author

ymazzer commented Jan 11, 2024

Hi,

I just updated the PR to work on top of 16.7.0, this feature is quite important for gitlab instances migrated from other installation methods to sameersbn/docker-gitlab docker image.

Could you please merge it?

@ymazzer
Copy link
Author

ymazzer commented Jan 12, 2024

Hi,

I just updated the PR to work on top of 16.7.0, this feature is quite important for gitlab instances migrated from other installation methods to sameersbn/docker-gitlab docker image.

Could you please merge it?

I forgot to mention @sachilles as recommended before :)

@ymazzer
Copy link
Author

ymazzer commented Feb 9, 2024

@sachilles What can I do to make it ok for merge?

@sachilles
Copy link
Collaborator

@ymazzer Thanks for your contribution and sorry for my late reply. I'll review your PR.

@@ -858,7 +858,8 @@ gitlab_configure_secrets() {
update_template ${GITLAB_SECRETS_CONFIG} \
GITLAB_SECRETS_DB_KEY_BASE \
GITLAB_SECRETS_SECRET_KEY_BASE \
GITLAB_SECRETS_OTP_KEY_BASE
GITLAB_SECRETS_OTP_KEY_BASE \
GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it problematic if GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE is not set?

For all other variables there is an explicit check to avoid empty strings. Should this check applied to GITLAB_SECRETS_ENCRYPTED_SETTINGS_KEY_BASE as well?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @sachilles,

Sorry for the delay, I was not notified of your mention.

Well gitlab starts, restarts and upgrades correctly without it within the current image. As long as you do not set it, it is ok.

But:

  • if you set it on a newly created instance, you need to keep it to make sure the secret is not overriden and to be able to decode already stored encrypted settings;
  • if you set it on an existing instance, you need to make sure to use the existing value of encrypted_settings_key_base inside /home/git/gitlab/config/secrets.yml if it exists, of not to set it if it is empty unless you never used encrypted settings.

By default this option is not set, and can be ignored. Thus it seems to me it should not warn neither block the user if it is not set (cf. https://docs.gitlab.com/ee/administration/encrypted_configuration.html)

…estoring backups from gitlab instances not running from this image and using encrypted settings feature.
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.

None yet

3 participants