Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Random password generation sometimes uses incompatible characters
Some background for the changes introduced in this commit. The unexpected behavior detected by @werenall in #24 seems to be related with a change in the semantics of the processing of "environment files" in docker-compose (and `docker compose`). In older versions, variable definitions didn't have any kind of expansion / interpolation. E.g.: VAR=$OTHERVAR would make VAR have exactly the string `$OTHERVAR` (verbatim) as its value. At some point, this behavior was changed (but not documented!) in docker-compose. But it was changed in an inconsistent way (different versions having slightly different behaviors). And in Sept 2022, the documentation was updated to reflect the changes, and make them the official behavior. It seems that our code for the creation of "environment files" pre-dates those changes in the documentation. In addition to that, we seem to be using older versions of docker-compose (i.e., not the "latest and greatest"), so we didn't catch some edge cases. Given that: - the minimum required docker-compose version for HOP is 1.27.0, - version 1.27.0 is the first version that fully implements the "compose specification"[1], - and that the "compose specification" is where the change in the expansion / interpolation is standardized, we have decided to quote the values of the variables in the "environment file" we produce. For that, we need to make sure we quote any single quotes that are part of the original value, which in turn means we need to quote any quotes that were part of the original value. [Re: #24] [1] https://compose-spec.io/
- Loading branch information