nginx does not support bcrypt when using auth_basic #4332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Registry only support bcrypt when using basic auth.
However, nginx does not support bcrypt, only md5....
Without this change you'll get error in the nginx log like
[crit] 5#5: *1 crypt_r() failed (22: Invalid argument)
Ref. https://stackoverflow.com/questions/31833583/nginx-gives-an-internal-server-error-500-after-i-have-configured-basic-auth
edit:
So to conclude, the example in registry/recipes/nginx.md creates the password hashes using bcrypt, while the libc in the nginx image being used doesn't support bcrypt.
This PR fixed the problem by changing hashes from bcrypt to md5, while the more correct way (as pointed out by Stephen ) would be to switch to a image with a libc which supports bcrypt.
Therefore I am reverting this fix and change to nginx:alpine image in #4489