preseed-config.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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' => 'dummy',
  26. 'secret' => 'dummy',
  27. 'hostname' => getenv('DRONE') === 'true' ? 'fake-s3' : 'localhost',
  28. 'port' => 4569,
  29. 'use_ssl' => false,
  30. // required for some non amazon s3 implementations
  31. 'use_path_style' => true
  32. ]
  33. ];
  34. }
  35. if (getenv('OBJECT_STORE') === 'swift') {
  36. $swiftHost = getenv('DRONE') === 'true' ? 'dockswift' : 'localhost';
  37. if (getenv('SWIFT-AUTH') === 'v2.0') {
  38. $CONFIG['objectstore'] = [
  39. 'class' => 'OC\\Files\\ObjectStore\\Swift',
  40. 'arguments' => [
  41. 'autocreate' => true,
  42. 'username' => 'swift',
  43. 'tenantName' => 'service',
  44. 'password' => 'swift',
  45. 'serviceName' => 'swift',
  46. 'region' => 'regionOne',
  47. 'url' => "http://$swiftHost:5000/v2.0",
  48. 'bucket' => 'nextcloud'
  49. ]
  50. ];
  51. } else {
  52. $CONFIG['objectstore'] = [
  53. 'class' => 'OC\\Files\\ObjectStore\\Swift',
  54. 'arguments' => [
  55. 'autocreate' => true,
  56. 'user' => [
  57. 'name' => 'swift',
  58. 'password' => 'swift',
  59. 'domain' => [
  60. 'name' => 'default',
  61. ]
  62. ],
  63. 'scope' => [
  64. 'project' => [
  65. 'name' => 'service',
  66. 'domain' => [
  67. 'name' => 'default',
  68. ],
  69. ],
  70. ],
  71. 'tenantName' => 'service',
  72. 'serviceName' => 'swift',
  73. 'region' => 'regionOne',
  74. 'url' => "http://$swiftHost:5000/v3",
  75. 'bucket' => 'nextcloud'
  76. ]
  77. ];
  78. }
  79. }
  80. if (getenv('OBJECT_STORE') === 'azure') {
  81. $CONFIG['objectstore'] = [
  82. 'class' => 'OC\\Files\\ObjectStore\\Azure',
  83. 'arguments' => [
  84. 'container' => 'test',
  85. 'account_name' => 'devstoreaccount1',
  86. 'account_key' => 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
  87. 'endpoint' => 'http://' . (getenv('DRONE') === 'true' ? 'azurite' : 'localhost') . ':10000/devstoreaccount1',
  88. 'autocreate' => true
  89. ]
  90. ];
  91. }