1
0

preseed-config.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2012-2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. $CONFIG = [
  8. 'appstoreenabled' => false,
  9. 'apps_paths' => [
  10. [
  11. 'path' => OC::$SERVERROOT . '/apps',
  12. 'url' => '/apps',
  13. 'writable' => true,
  14. ],
  15. ],
  16. ];
  17. if (is_dir(OC::$SERVERROOT . '/apps2')) {
  18. $CONFIG['apps_paths'][] = [
  19. 'path' => OC::$SERVERROOT . '/apps2',
  20. 'url' => '/apps2',
  21. 'writable' => false,
  22. ];
  23. }
  24. if (getenv('OBJECT_STORE') === 's3') {
  25. $CONFIG['objectstore'] = [
  26. 'class' => 'OC\\Files\\ObjectStore\\S3',
  27. 'arguments' => [
  28. 'bucket' => 'nextcloud',
  29. 'autocreate' => true,
  30. 'key' => getenv('OBJECT_STORE_KEY') ?: 'nextcloud',
  31. 'secret' => getenv('OBJECT_STORE_SECRET') ?: 'nextcloud',
  32. 'hostname' => getenv('OBJECT_STORE_HOST') ?: 'localhost',
  33. 'port' => 9000,
  34. 'use_ssl' => false,
  35. // required for some non amazon s3 implementations
  36. 'use_path_style' => true
  37. ]
  38. ];
  39. } elseif (getenv('OBJECT_STORE') === 's3-multibucket') {
  40. $CONFIG['objectstore_multibucket'] = [
  41. 'class' => 'OC\\Files\\ObjectStore\\S3',
  42. 'arguments' => [
  43. 'bucket' => 'nextcloud',
  44. 'autocreate' => true,
  45. 'key' => getenv('OBJECT_STORE_KEY') ?: 'nextcloud',
  46. 'secret' => getenv('OBJECT_STORE_SECRET') ?: 'nextcloud',
  47. 'hostname' => getenv('OBJECT_STORE_HOST') ?: 'localhost',
  48. 'port' => 9000,
  49. 'use_ssl' => false,
  50. // required for some non amazon s3 implementations
  51. 'use_path_style' => true
  52. ]
  53. ];
  54. } elseif (getenv('OBJECT_STORE') === 'azure') {
  55. $CONFIG['objectstore'] = [
  56. 'class' => 'OC\\Files\\ObjectStore\\Azure',
  57. 'arguments' => [
  58. 'container' => 'test',
  59. 'account_name' => getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1',
  60. 'account_key' => getenv('OBJECT_STORE_SECRET') ?: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
  61. 'endpoint' => 'http://' . (getenv('OBJECT_STORE_HOST') ?: 'localhost') . ':10000/' . (getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1'),
  62. 'autocreate' => true
  63. ]
  64. ];
  65. } elseif (getenv('OBJECT_STORE') === 'swift') {
  66. $swiftHost = getenv('OBJECT_STORE_HOST') ?: 'localhost:5000';
  67. $CONFIG['objectstore'] = [
  68. 'class' => 'OC\\Files\\ObjectStore\\Swift',
  69. 'arguments' => [
  70. 'autocreate' => true,
  71. 'user' => [
  72. 'name' => getenv('OBJECT_STORE_KEY') ?: 'swift',
  73. 'password' => getenv('OBJECT_STORE_SECRET') ?: 'swift',
  74. 'domain' => [
  75. 'name' => 'Default',
  76. ],
  77. ],
  78. 'scope' => [
  79. 'project' => [
  80. 'name' => 'service',
  81. 'domain' => [
  82. 'name' => 'Default',
  83. ],
  84. ],
  85. ],
  86. 'serviceName' => 'service',
  87. 'region' => 'RegionOne',
  88. 'url' => "http://$swiftHost/v3",
  89. 'bucket' => 'nextcloud',
  90. ]
  91. ];
  92. }
  93. if (getenv('SHARDING') == '1') {
  94. $CONFIG['dbsharding'] = [
  95. 'filecache' => [
  96. 'shards' => [
  97. [
  98. 'port' => 5001,
  99. ],
  100. [
  101. 'port' => 5002,
  102. ],
  103. [
  104. 'port' => 5003,
  105. ],
  106. [
  107. 'port' => 5004,
  108. ],
  109. ]
  110. ]
  111. ];
  112. }