1
0

preseed-config.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. $CONFIG = [
  3. 'appstoreenabled' => false,
  4. 'apps_paths' => [
  5. [
  6. 'path' => OC::$SERVERROOT . '/apps',
  7. 'url' => '/apps',
  8. 'writable' => true,
  9. ],
  10. ],
  11. ];
  12. if (is_dir(OC::$SERVERROOT.'/apps2')) {
  13. $CONFIG['apps_paths'][] = [
  14. 'path' => OC::$SERVERROOT . '/apps2',
  15. 'url' => '/apps2',
  16. 'writable' => false,
  17. ];
  18. }
  19. if (getenv('OBJECT_STORE') === 's3') {
  20. $CONFIG['objectstore'] = [
  21. 'class' => 'OC\\Files\\ObjectStore\\S3',
  22. 'arguments' => [
  23. 'bucket' => 'nextcloud',
  24. 'autocreate' => true,
  25. 'key' => getenv('OBJECT_STORE_KEY') ?: 'nextcloud',
  26. 'secret' => getenv('OBJECT_STORE_SECRET') ?: 'nextcloud',
  27. 'hostname' => getenv('OBJECT_STORE_HOST') ?: 'localhost',
  28. 'port' => 9000,
  29. 'use_ssl' => false,
  30. // required for some non amazon s3 implementations
  31. 'use_path_style' => true
  32. ]
  33. ];
  34. } elseif (getenv('OBJECT_STORE') === 's3-multibucket') {
  35. $CONFIG['objectstore_multibucket'] = [
  36. 'class' => 'OC\\Files\\ObjectStore\\S3',
  37. 'arguments' => [
  38. 'bucket' => 'nextcloud',
  39. 'autocreate' => true,
  40. 'key' => getenv('OBJECT_STORE_KEY') ?: 'nextcloud',
  41. 'secret' => getenv('OBJECT_STORE_SECRET') ?: 'nextcloud',
  42. 'hostname' => getenv('OBJECT_STORE_HOST') ?: 'localhost',
  43. 'port' => 9000,
  44. 'use_ssl' => false,
  45. // required for some non amazon s3 implementations
  46. 'use_path_style' => true
  47. ]
  48. ];
  49. } elseif (getenv('OBJECT_STORE') === 'azure') {
  50. $CONFIG['objectstore'] = [
  51. 'class' => 'OC\\Files\\ObjectStore\\Azure',
  52. 'arguments' => [
  53. 'container' => 'test',
  54. 'account_name' => getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1',
  55. 'account_key' => getenv('OBJECT_STORE_SECRET') ?: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
  56. 'endpoint' => 'http://' . (getenv('OBJECT_STORE_HOST') ?: 'localhost') . ':10000/' . (getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1'),
  57. 'autocreate' => true
  58. ]
  59. ];
  60. } elseif (getenv('OBJECT_STORE') === 'swift') {
  61. $swiftHost = getenv('OBJECT_STORE_HOST') ?: 'localhost:5000';
  62. $CONFIG['objectstore'] = [
  63. 'class' => 'OC\\Files\\ObjectStore\\Swift',
  64. 'arguments' => [
  65. 'autocreate' => true,
  66. 'user' => [
  67. 'name' => getenv('OBJECT_STORE_KEY') ?: 'swift',
  68. 'password' => getenv('OBJECT_STORE_SECRET') ?: 'swift',
  69. 'domain' => [
  70. 'name' => 'Default',
  71. ],
  72. ],
  73. 'scope' => [
  74. 'project' => [
  75. 'name' => 'service',
  76. 'domain' => [
  77. 'name' => 'Default',
  78. ],
  79. ],
  80. ],
  81. 'serviceName' => 'service',
  82. 'region' => 'RegionOne',
  83. 'url' => "http://$swiftHost/v3",
  84. 'bucket' => 'nextcloud',
  85. ]
  86. ];
  87. }