Right now we have to explain to all people installing GitLab that they have to submit root and password to login initially.
There are three disadvantages:
It is a hurdle when installing GitLab
We have to unlearn the previous credential root and 5iveL!fe that can be found all over the internet
Having a default password looks insecure (it is ascetic since you have to change it on login)
Can we hotwire Devise so the first screen you see after installation is to set a new root password? This screen would have two fields, password and confirmation, there is no field for the old password.
This would:
Make installing GitLab easier
Prevent the user searching the net and fining old credentials
Would not look insecure
What needs to happen:
On new installations drop people in the root password reset screen without needing to login with default credentials
Preserve the existing option to set a password for the first user through the command line, they than will not have to reset the password on login
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
if we show the new password screen as the first screen a user sees when opening the fresh install window. Because if we still show a login screen which the user can enter anything at will, they don't get it either.
At the moment it is possible to set the root password during initial setup. If you use that you can prevent people from beating you to a fresh gitlab instance and becoming admin.
Whatever we change the current setup into, I think it would be good to design the new thing so that there is still/again a way to prevent users from becoming admin by reaching the gitlab instance first.
"hotwire Devise so the first screen you see after installation is to set a new root password" is as secure as the current situation (root/5iveL!fe) but at least we now have an option to be safer by overriding the password during initialization. That option should not be lost.
At the moment it is possible to set the root password during initial setup. If you use that you can prevent people from beating you to a fresh gitlab instance and becoming admin.
Does this solve the issue? Do you think this can be closed @jacobvosmaer?
@axil we already allow people to set a password from the command line if they are worried about a race to login. I care very deeply about the ease of installing GitLab and don't think the method described is convenient enough.
@rspeicher I haven't thought this true all the way. Now we still have a root credential that we need to communicate to the user. How hard would it be to have the user set both their username and their password?
@sytses Hmm, at that point they'd just be following the standard "Sign Up" procedure like any other user -- we'd have to add logic to automatically make the first signed-up (and probably confirmed) user an admin.
Hey folks, removing the default password just broke my server installation scripts where I’m setting up specific GitLab configurations automatically using the GitLab API immediately following an installation.
Without a default password, is there any way I can have a non-interactive setup of a specific Gitlab configuration?
Currently, I am using something similar to this and it breaks in 8.6+, with the first call returning a 401 unauthorised error and things cascading from there.
echo -e "\t* Setting the GitLab root password…"privateToken=$(curl "${curlSecurity}" -X POST https://${domain}/api/v3/session/ --data-urlencode 'login=root' --data-urlencode 'password=5iveL!fe' | jq --raw-output .private_token)# Create the Generated account and store its ID.echo -e "\t* Creating the ${gitlabAccountName} account on GitLab…"curl "${curlSecurity}" --header "PRIVATE-TOKEN: ${privateToken}" -X PUT https://${domain}/api/v3/users/1 --data-urlencode "password=${gitlabAccountPassword}"# Add the SSH key to the account.echo -e "\t* Adding SSH key to the account…"curl "${curlSecurity}" --header "PRIVATE-TOKEN: ${privateToken}" -X POST https://${domain}/api/v3/users/${accountID}/keys --data-urlencode "id=${accountID}" --data-urlencode "title=SSH Key" --data-urlencode "key=${publicKey}"# Create the repository for sites.echo -e "\t* Creating sites repository…"curl "${curlSecurity}" --header "PRIVATE-TOKEN: ${privateToken}" -X POST https://${domain}/api/v3/projects/user/${accountID} --data-urlencode "user_id=${accountID}" --data-urlencode "name=sites" --data-urlencode "description=Site drafts generated by Better Inspector." --data-urlencode "public=true"
etc.
(Where curlSecurity is simply '--insecure' if the script is running with Let’s Encrypt’s staging server.)
Has this change broken this use case or is there a different way I can achieve the same thing? If the former, may I please ask that this change be reverted as this is a core use case for us and one that makes GitLab easier to install and use as part of other systems.
Thoughts?
PS. Not sure if notifications are sent for closed issues, so pinging @sytses & @rspeicher :)
I'd like to second @aral 's issue. I am using GitLab as part of a docker compose for a build box that acts as a starter for our projects. I want to import several projects into GitLab prior to logging in to the UI, but this change has stopped me from being able to do so. Perhaps its possible to add a hook that allows you to activate the root user via CLI?