-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
After renaming basicauth to basic_auth directive Caddyfile fails to load if custom salt argument was used #6379
Comments
Scrypt support was deprecated a long time ago (about 2 years). We removed scrypt support. It doesn't have to do with renaming the directive. |
well it's hard to retrace the changes without links to older documentation version, my config is using default parameters, and it's not apparent that other algorithms didn't support salt parameter etc I have a very simple issue: after upgrade and following the release note changes, my config doesn't work anymore and I have no easy way to migrate; I have no idea if scrypt was the default years ago, or that salt parameter was only applicable to scrypt either. |
The default has always been bcrypt which has the salt integrated in the hash string. The only way you could need the salt is if you used scrypt which has been deprecated for two years. You would have seen warnings in your logs all this time about it. You should have heeded those warnings and migrated your password hashes. |
realistically no one would bother to look at the logs until everything is broken, unless you're a big corpo and actually care about proactive infra monitoring anyway, I don't see any warnings in the systemd journal before the upgrade, and if what you're saying is true and salt was silently ignored all this time, I'll try simply removing it from config file and see if the old credentials still work |
I disagree. You always should keep an eye on your logs. It's irresponsible to not look at your logs. That's the only avenue Caddy has to give you feedback about anything that might become a problem. If you were using bcrypt hashes, then yes the salts in your config were never looked at, because the salt is built into the hash (delimited by The reason we produced hashes with base64 before was because scrypt required it because it emitted the hashes in raw binary, so we allowed using base64 in the config. But that was redundant for bcrypt because it has its own textual format that doesn't require additional encoding. Now you can load both ways for bcrypt but the standard bcrypt format is preferred. |
Well you may disagree all you want, but the fact is it's hard to retrace what's broken after upgrade and why. As I said, at the very least there should be a note in the documentation that explains the configuration format change and migration notes, including the change of the default hashing algorithm, the removal of extra parameters, and how people can tell they're affected. |
The note existed in the docs for two years that scrypt was deprecated. When we remove it, we also clean up the docs to remove references to it to get rid of irrelevant information. If you tried to use salts with bcrypt, that was a user-error, because that doesn't make any sense (because bcrypt manages its own salt in the hash). Trying to use a custom salt doesn't make sense anyway, salts should always be randomly generated at the time of generating the password, and should always be different for all passwords, otherwise it's possible to produce a rainbow table using that salt if it's reused. |
That's a strange decision, to remove actually helpful note for people who will be struggling the most trying to figure out what needs to be fixed. As for primer on salts, thanks, I have sufficient background in crypto, but it doesn't mean I can look at the legacy caddyfile and immediately understand what all the random parameters are meant to be especially when everything is using defaults without explicitly stating the configured algorithm anywhere. All I see as a user, is that first it fails to start because it wants Anyway, it was using scrypt or whatever default was years ago when the config file was generated, so I'll have to update all the passwords, which sucks, not gonna lie. |
Scrypt was never the default. You would have had to explicitly choose to use it. And Caddy will have warned every time you load with the algorithm configured to scrypt that it was deprecated. You can revert to 2.7.6 if you need to keep using those for the time being, giving you time to migrate.
No, that's a deprecation warning, not a reason that it would fail to start. Caddy will still work with both directive names. You still haven't shown any of your logs nor your Caddyfile. So we might be talking past eachother, making assumptions about what eachother are seeing. Please help us by showing detail if you still think there's an actual problem. |
The default has been bcrypt ever since there was a default before Caddy v2 was even released, all the way back in early 2020: 57c6f22 Maybe if you show us your config we can help you understand more about the changes in 2.8. Then we can decide whether this needs to stay open if there's anything actionable for us to do. |
my config file literally looks like this, so I have zero clue:
|
How do you know that it doesn't work if you remove the salt? How did you actually try that? Scrypt was dropped in this PR #6091. If you were using
But since you aren't doing that, you must be using |
yeah, I've regenerated the password for one user that I know for sure is used in my ddns script, everything else I'll only know when something will break somewhere, (I can't find the old password hash values to see if it was double-b64 encoded or not; I had to remove the auth part of the config to make caddy work again for other parts of the server). |
Wait, you've already lost your basicauth config? I'm not sure I follow. If so, then obviously there's nothing else to do here and we should close this issue. |
Yes, I can live with the changes I had to make on the double. But closing the issue? I disagree. The whole point I opened it is because I do not agree with your approach of releasing breaking changes without proper mention in the release notes and removing any helpful info on changes/migration from documentation. Like, yes, you've deprecated it some time ago, but you're actually breaking the compatibility, and it's impossible to find anything useful anywhere right now. |
It is in the release notes: https://github.com/caddyserver/caddy/releases/tag/v2.8.0 If you were specifying salts when using I'll close this, there's nothing actionable for us to do here.
That's all. |
Basically, this was an undocumented change that removed support for custom salt. Old configuraitons using this feature can not be updated to use the new
basic_auth
directive without regenerating all the hashes (in some cases this is not even possible).Please at the very least update the documentation, adding the migration guide/breaking changes section, but ideally restore the compatibility with old config format.
The text was updated successfully, but these errors were encountered: