summaryrefslogtreecommitdiffstats
path: root/tests/preseed-config.php
blob: 97c8a1d11a814ca693a55c4be0e9563512c255ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php

$CONFIG = [
	'appstoreenabled' => false,
	'apps_paths' => [
		[
			'path' => OC::$SERVERROOT . '/apps',
			'url' => '/apps',
			'writable' => true,
		],
	],
];

if (is_dir(OC::$SERVERROOT.'/apps2')) {
	$CONFIG['apps_paths'][] = [
		'path' => OC::$SERVERROOT . '/apps2',
		'url' => '/apps2',
		'writable' => false,
	];
}

if (getenv('OBJECT_STORE') === 's3') {
	$CONFIG['objectstore'] = [
		'class' => 'OC\\Files\\ObjectStore\\S3',
		'arguments' => [
			'bucket' => 'nextcloud',
			'autocreate' => true,
			'key' => 'dummy',
			'secret' => 'dummy',
			'hostname' => getenv('DRONE') === 'true' ? 'fake-s3' : 'localhost',
			'port' => 4569,
			'use_ssl' => false,
			// required for some non amazon s3 implementations
			'use_path_style' => true
		]
	];
}
if (getenv('OBJECT_STORE') === 'swift') {
	$swiftHost = getenv('DRONE') === 'true' ? 'dockswift' : 'localhost';

	if (getenv('SWIFT-AUTH') === 'v2.0') {
		$CONFIG['objectstore'] = [
			'class' => 'OC\\Files\\ObjectStore\\Swift',
			'arguments' => [
				'autocreate' => true,
				'username' => 'swift',
				'tenantName' => 'service',
				'password' => 'swift',
				'serviceName' => 'swift',
				'region' => 'regionOne',
				'url' => "http://$swiftHost:5000/v2.0",
				'bucket' => 'nextcloud'
			]
		];
	} else {
		$CONFIG['objectstore'] = [
			'class' => 'OC\\Files\\ObjectStore\\Swift',
			'arguments' => [
				'autocreate' => true,
				'user' => [
					'name' => 'swift',
					'password' => 'swift',
					'domain' => [
						'name' => 'default',
					]
				],
				'scope' => [
					'project' => [
						'name' => 'service',
						'domain' => [
							'name' => 'default',
						],
					],
				],
				'tenantName' => 'service',
				'serviceName' => 'swift',
				'region' => 'regionOne',
				'url' => "http://$swiftHost:5000/v3",
				'bucket' => 'nextcloud'
			]
		];
	}
}
if (getenv('OBJECT_STORE') === 'azure') {
	$CONFIG['objectstore'] = [
		'class' => 'OC\\Files\\ObjectStore\\Azure',
		'arguments' => [
			'container' => 'test',
			'account_name' => 'devstoreaccount1',
			'account_key' => 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
			'endpoint' => 'http://' . (getenv('DRONE') === 'true' ? 'azurite' : 'localhost') . ':10000/devstoreaccount1',
			'autocreate' => true
		]
	];
}