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

GITLAB_SECRETS_DB_KEY_BASE parameter #443

Closed
pnelsonsr opened this issue Sep 27, 2015 · 14 comments
Closed

GITLAB_SECRETS_DB_KEY_BASE parameter #443

pnelsonsr opened this issue Sep 27, 2015 · 14 comments

Comments

@pnelsonsr
Copy link

Went to upgrade to 8.0.2 and when I start it I get an error:

ERROR:
Please configure the GITLAB_SECRETS_DB_KEY_BASE parameter.
Cannot continue. Aborting...

what is this and how do I fix it?

@Allineer
Copy link
Contributor

README.md

@pnelsonsr
Copy link
Author

@Allineer I only had read through the Upgrading part. So here is what needs to happen...

  1. generate a long random string with:
    pwgen -Bsv1 64
  2. then add that to my docker run command with:
    GITLAB_SECRETS_DB_KEY_BASE="<generated string>"
  3. then do the docker run
    great everything works. but I'm still unclear what this is for?

@Allineer
Copy link
Contributor

@pnelsonsr

  # db_key_base is used to encrypt for Variables. Ensure that you don't lose it.
  # If you change or lose this key you will be unable to access variables stored in database.
  # Make sure the secret is at least 30 characters and all random,
  # no regular words or you'll be exposed to dictionary attacks.

This option is coming from GitLab CI & now it's used only here

@pnelsonsr
Copy link
Author

Ahh its for db encryption. So, the key will be needed for back up systems. Its important to keep secret in a password kind of way.

@sameersbn
Copy link
Owner

It is used by the CI feature of gitlab to encrypt build variables.

@sameersbn
Copy link
Owner

@Allineer Thanks for helping users resolve issues. Your the best 👍

@sameersbn
Copy link
Owner

ps. please subscribe to issue #39 to get notified about such breaking changes.

@pnelsonsr pnelsonsr reopened this Sep 29, 2015
@pnelsonsr
Copy link
Author

@sameersbn yeah it kind of hit me at a moment of weakness as I had a few headaches going on with other systems. If you had something in upgrade section of the readme then I would have been golden. I just entered a issue because you are always there for us! I'll subscribe to #39 and hopefully catch this kind of thing next time.

So, I understand what the key does but the reason I kind of needed to know what it was doing is we keep a couple of docker systems ready to take on a promotion if a failure happens. So understanding if this value was unique to the server or unique to the db (pg) was important. Kind of a "Why its there?" and "What is it doing?" in important to us from an operational standpoint. That's the why and what of what I was asking about.

@favorinfo
Copy link

what if I forgot my secret?

I had used sameersbn/gitlab:7.9.0, and I forget the path I stored the secret or never owned the sercret?

@sameersbn
Copy link
Owner

@favorinfo The GITLAB_SECRETS_DB_KEY_BASE variable has been added only since version 8.0.0 for the Gitlab CE image. Before that it existed as the GITLAB_CI_SECRETS_DB_KEY_BASE parameter in the GitLab CI image.

This variable is used to encrypt build script variables. Loosing/changing this key would mean that any variables that you may have added for your CI jobs cannot be decrypted and hence would not be usable.

The build script variables can be used to encrypt sensitive information such as usernames and passwords in your ci jobs and can be added at Continuous Integration > project > Variables, which become available as environment variables in you build jobs.

@sameersbn
Copy link
Owner

@pnelsonsr I have now added a note in the upgrading section

@pnelsonsr
Copy link
Author

@sameersbn cool!
@favorinfo you didn't have to have GITLAB_SECRETS_DB_KEY_BASE prior to 8.0.0 so you probably didn't have one. Just create a random string with pwgen -Bsv1 64 and assign it in your docker run command options docker run --name gitlab -d [OPTIONS] sameersbn/gitlab:8.0.2. Once it is set you will need it after that.

@sameersbn
Copy link
Owner

marking this issue resolved.

@bor8
Copy link

bor8 commented Jul 3, 2019

Sorry if I'm involved.

I forgot to change the variables GITLAB_SECRETS_DB_KEY_BASE, GITLAB_SECRETS_SECRET_KEY_BASE and GITLAB_SECRETS_OTP_KEY_BASE, i.e. they are still at the default value.

Is that a problem? What happens if I change the values afterwards? I haven't worked much with CI yet.

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

No branches or pull requests

5 participants