Skip to content

Commit ad05507

Browse files
committed
Add missing reverse-proxy, s3, swift, and upgrade-disable-web.config config.php files
Signed-off-by: jessebot <jessebot@linux.com>
1 parent d76149e commit ad05507

4 files changed

Lines changed: 113 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
$overwriteHost = getenv('OVERWRITEHOST');
3+
if ($overwriteHost) {
4+
$CONFIG['overwritehost'] = $overwriteHost;
5+
}
6+
7+
$overwriteProtocol = getenv('OVERWRITEPROTOCOL');
8+
if ($overwriteProtocol) {
9+
$CONFIG['overwriteprotocol'] = $overwriteProtocol;
10+
}
11+
12+
$overwriteCliUrl = getenv('OVERWRITECLIURL');
13+
if ($overwriteCliUrl) {
14+
$CONFIG['overwrite.cli.url'] = $overwriteCliUrl;
15+
}
16+
17+
$overwriteWebRoot = getenv('OVERWRITEWEBROOT');
18+
if ($overwriteWebRoot) {
19+
$CONFIG['overwritewebroot'] = $overwriteWebRoot;
20+
}
21+
22+
$overwriteCondAddr = getenv('OVERWRITECONDADDR');
23+
if ($overwriteCondAddr) {
24+
$CONFIG['overwritecondaddr'] = $overwriteCondAddr;
25+
}
26+
27+
$trustedProxies = getenv('TRUSTED_PROXIES');
28+
if ($trustedProxies) {
29+
$CONFIG['trusted_proxies'] = array_filter(array_map('trim', explode(' ', $trustedProxies)));
30+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
if (getenv('OBJECTSTORE_S3_BUCKET')) {
3+
$use_ssl = getenv('OBJECTSTORE_S3_SSL');
4+
$use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
5+
$use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
6+
$autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
7+
$CONFIG = array(
8+
'objectstore' => array(
9+
'class' => '\OC\Files\ObjectStore\S3',
10+
'arguments' => array(
11+
'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
12+
'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
13+
'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',
14+
'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
15+
'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
16+
'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
17+
'autocreate' => (strtolower($autocreate) === 'false' || $autocreate == false) ? false : true,
18+
'use_ssl' => (strtolower($use_ssl) === 'false' || $use_ssl == false) ? false : true,
19+
// required for some non Amazon S3 implementations
20+
'use_path_style' => $use_path == true && strtolower($use_path) !== 'false',
21+
// required for older protocol versions
22+
'legacy_auth' => $use_legacyauth == true && strtolower($use_legacyauth) !== 'false'
23+
)
24+
)
25+
);
26+
27+
if (getenv('OBJECTSTORE_S3_KEY_FILE')) {
28+
$CONFIG['objectstore']['arguments']['key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_KEY_FILE')));
29+
} elseif (getenv('OBJECTSTORE_S3_KEY')) {
30+
$CONFIG['objectstore']['arguments']['key'] = getenv('OBJECTSTORE_S3_KEY');
31+
} else {
32+
$CONFIG['objectstore']['arguments']['key'] = '';
33+
}
34+
35+
if (getenv('OBJECTSTORE_S3_SECRET_FILE')) {
36+
$CONFIG['objectstore']['arguments']['secret'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SECRET_FILE')));
37+
} elseif (getenv('OBJECTSTORE_S3_SECRET')) {
38+
$CONFIG['objectstore']['arguments']['secret'] = getenv('OBJECTSTORE_S3_SECRET');
39+
} else {
40+
$CONFIG['objectstore']['arguments']['secret'] = '';
41+
}
42+
43+
if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) {
44+
$CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')));
45+
} elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) {
46+
$CONFIG['objectstore']['arguments']['sse_c_key'] = getenv('OBJECTSTORE_S3_SSE_C_KEY');
47+
}
48+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
if (getenv('OBJECTSTORE_SWIFT_URL')) {
3+
$autocreate = getenv('OBJECTSTORE_SWIFT_AUTOCREATE');
4+
$CONFIG = array(
5+
'objectstore' => [
6+
'class' => 'OC\\Files\\ObjectStore\\Swift',
7+
'arguments' => [
8+
'autocreate' => $autocreate == true && strtolower($autocreate) !== 'false',
9+
'user' => [
10+
'name' => getenv('OBJECTSTORE_SWIFT_USER_NAME'),
11+
'password' => getenv('OBJECTSTORE_SWIFT_USER_PASSWORD'),
12+
'domain' => [
13+
'name' => (getenv('OBJECTSTORE_SWIFT_USER_DOMAIN')) ?: 'Default',
14+
],
15+
],
16+
'scope' => [
17+
'project' => [
18+
'name' => getenv('OBJECTSTORE_SWIFT_PROJECT_NAME'),
19+
'domain' => [
20+
'name' => (getenv('OBJECTSTORE_SWIFT_PROJECT_DOMAIN')) ?: 'Default',
21+
],
22+
],
23+
],
24+
'serviceName' => (getenv('OBJECTSTORE_SWIFT_SERVICE_NAME')) ?: 'swift',
25+
'region' => getenv('OBJECTSTORE_SWIFT_REGION'),
26+
'url' => getenv('OBJECTSTORE_SWIFT_URL'),
27+
'bucket' => getenv('OBJECTSTORE_SWIFT_CONTAINER_NAME'),
28+
]
29+
]
30+
);
31+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
$CONFIG = array (
3+
'upgrade.disable-web' => true,
4+
);

0 commit comments

Comments
 (0)