Fix initialization of autocreate and use_ssl - #2309
Conversation
8f2969e to
3c82bad
Compare
|
What exactly do you mean? What "gibberish" don't you understand and which part of my proposed change is "no good"? I did my best to be clear and improve this project. I opened an issue with a reproducible bug, then did local tests to see where the bug originates and fixed the bug so the image behaves as documented. Maybe this testcase helps clear things up: <?php
$foo = getenv('FOO');
$old_result = (strtolower($foo) === 'false' || $foo == false) ? false : true;
echo 'Old Result: ';
var_dump($old_result);
$new_result = strtolower($foo) !== 'false';
echo 'New Result: ';
var_dump($new_result);This shows, that the old logic does not work as documented (e.g. default to |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
How do I submit my PR via mail? Or do you mean that my commit message has to contain I will update the commit message and push again soon |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Related: #1948 |
According to the documentation, both `OBJECTSTORE_S3_SSL` and `OBJECTSTORE_S3_AUTOCREATE` should default to `true`. Currently, when these environment variables are not set, they default to `false`. (See nextcloud#2308). This fix works, because `strtolower(false)` returns the empty string. So when `OBJECTSTORE_S3_SSL` is not set and `getenv('OBJECTSTORE_S3_SSL')` returns `false`, the check `strtolower($use_ssl) !== 'false'` will evaluate to `true`. With this fix, both values will be `true` if they are * not set * the empty string * any string that is not equal to `false` when converted to lowercase This should now match the documented behavior. Signed-off-by: Valentin Brandl <mail@vbrandl.net>
3c82bad to
053da1e
Compare
|
I just pushed again with proper Also sorry for feeding the troll... I fell for them, but reported the account to Github. |
|
Thanks! |
Unify with micro-services image fix: nextcloud/docker#2309 Signed-off-by: Josh <josh.t.richards@gmail.com>
Unify with micro-services image fix: nextcloud/docker#2309 Signed-off-by: Josh <josh.t.richards@gmail.com>
Simplifies the boolean logic for autocreate and use_ssl parameters. The new logic is clearer: these values are true by default unless explicitly set to the string 'false'. Co-authored-by: Valentin Brandl <mail@vbrandl.net> Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
According to the documentation, both
OBJECTSTORE_S3_SSLandOBJECTSTORE_S3_AUTOCREATEshould default totrue. Currently, when these environment variables are not set, they default tofalse. (Closes #2308).This fix works, because
strtolower(false)returns the empty string. Sowhen
OBJECTSTORE_S3_SSLis not set andgetenv('OBJECTSTORE_S3_SSL')returns
false, the checkstrtolower($use_ssl) !== 'false'willevaluate to
true.With this fix, both values will be
trueif they arefalsewhen converted to lowercaseThis should now match the documented behavior.