1
0

preseed-config.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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' => array(
  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' => array(
  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' => array(
  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' => array(
  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. }