1
0

preseed-config.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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') === 'azure') {
  40. $CONFIG['objectstore'] = [
  41. 'class' => 'OC\\Files\\ObjectStore\\Azure',
  42. 'arguments' => [
  43. 'container' => 'test',
  44. 'account_name' => getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1',
  45. 'account_key' => getenv('OBJECT_STORE_SECRET') ?: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
  46. 'endpoint' => 'http://' . (getenv('OBJECT_STORE_HOST') ?: 'localhost') . ':10000/' . (getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1'),
  47. 'autocreate' => true
  48. ]
  49. ];
  50. } elseif (getenv('OBJECT_STORE') === 'swift') {
  51. $swiftHost = getenv('OBJECT_STORE_HOST') ?: 'localhost:5000';
  52. $CONFIG['objectstore'] = [
  53. 'class' => 'OC\\Files\\ObjectStore\\Swift',
  54. 'arguments' => [
  55. 'autocreate' => true,
  56. 'user' => [
  57. 'name' => getenv('OBJECT_STORE_KEY') ?: 'swift',
  58. 'password' => getenv('OBJECT_STORE_SECRET') ?: 'swift',
  59. 'domain' => [
  60. 'name' => 'Default',
  61. ],
  62. ],
  63. 'scope' => [
  64. 'project' => [
  65. 'name' => 'service',
  66. 'domain' => [
  67. 'name' => 'Default',
  68. ],
  69. ],
  70. ],
  71. 'serviceName' => 'service',
  72. 'region' => 'RegionOne',
  73. 'url' => "http://$swiftHost/v3",
  74. 'bucket' => 'nextcloud',
  75. ]
  76. ];
  77. }
  78. if (getenv('SHARDING') == '1') {
  79. $CONFIG['dbsharding'] = [
  80. 'filecache' => [
  81. 'shards' => [
  82. [
  83. 'port' => 5001,
  84. ],
  85. [
  86. 'port' => 5002,
  87. ],
  88. [
  89. 'port' => 5003,
  90. ],
  91. [
  92. 'port' => 5004,
  93. ],
  94. ]
  95. ]
  96. ];
  97. }