0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-07-27 09:08:04 +02:00

Compare commits

...

4 commits

Author SHA1 Message Date
Josh
5bc732c07d
Merge a83363f812 into 29d959acfd 2024-11-06 11:28:40 +02:00
GitHub Workflow
29d959acfd Runs update.sh 2024-10-24 19:52:51 +00:00
Valentin Brandl
d3341b61c1
Fix initialization of autocreate and use_ssl (#2309)
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 https://github.com/nextcloud/docker/issues/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>
2024-10-24 19:52:36 +00:00
Josh
a83363f812
fix(entrypoint): set non-bogus $HOME when using su
Signed-off-by: Josh <josh.t.richards@gmail.com>
2024-10-19 11:06:15 -04:00
11 changed files with 21 additions and 21 deletions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -13,7 +13,7 @@ directory_empty() {
run_as() { run_as() {
if [ "$(id -u)" = 0 ]; then if [ "$(id -u)" = 0 ]; then
su -p "$user" -s /bin/sh -c "$1" HOME=/var/www su -p "$user" -s /bin/sh -c "$1"
else else
sh -c "$1" sh -c "$1"
fi fi

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions

View file

@ -14,8 +14,8 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '', 'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '', 'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:", 'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true, 'autocreate' => strtolower($autocreate) !== 'false',
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true, 'use_ssl' => strtolower($use_ssl) !== 'false',
// required for some non Amazon S3 implementations // required for some non Amazon S3 implementations
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false', 'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
// required for older protocol versions // required for older protocol versions