preseed-config.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. }