preseed-config.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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') === 'azure') {
  35. $CONFIG['objectstore'] = [
  36. 'class' => 'OC\\Files\\ObjectStore\\Azure',
  37. 'arguments' => [
  38. 'container' => 'test',
  39. 'account_name' => getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1',
  40. 'account_key' => getenv('OBJECT_STORE_SECRET') ?: 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
  41. 'endpoint' => 'http://' . (getenv('OBJECT_STORE_HOST') ?: 'localhost') . ':10000/' . (getenv('OBJECT_STORE_KEY') ?: 'devstoreaccount1'),
  42. 'autocreate' => true
  43. ]
  44. ];
  45. } elseif (getenv('OBJECT_STORE') === 'swift') {
  46. $swiftHost = getenv('OBJECT_STORE_HOST') ?: 'localhost:5000';
  47. $CONFIG['objectstore'] = [
  48. 'class' => 'OC\\Files\\ObjectStore\\Swift',
  49. 'arguments' => [
  50. 'autocreate' => true,
  51. 'user' => [
  52. 'name' => getenv('OBJECT_STORE_KEY') ?: 'swift',
  53. 'password' => getenv('OBJECT_STORE_SECRET') ?: 'swift',
  54. 'domain' => [
  55. 'name' => 'Default',
  56. ],
  57. ],
  58. 'scope' => [
  59. 'project' => [
  60. 'name' => 'service',
  61. 'domain' => [
  62. 'name' => 'Default',
  63. ],
  64. ],
  65. ],
  66. 'serviceName' => 'service',
  67. 'region' => 'RegionOne',
  68. 'url' => "http://$swiftHost/v3",
  69. 'bucket' => 'nextcloud',
  70. ]
  71. ];
  72. }