/
s3directupload-config.xml.nxftl
94 lines (86 loc) · 5.87 KB
/
s3directupload-config.xml.nxftl
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
<?xml version="1.0"?>
<component name="s3DirectUpload">
<#if "${nuxeo.s3storage.useDirectUpload}" == "true">
<extension target="org.nuxeo.ecm.core.transientstore.TransientStorageComponent" point="store">
<store name="s3TransientStore" class="org.nuxeo.ecm.core.transientstore.keyvalueblob.KeyValueBlobTransientStore">
<property name="blobProvider">s3DirectUploadBlobProviderDestination</property> <!-- this is the destination bolb provider -->
<property name="keyValueStore">s3DirectUploadKeyValueStore</property> <!-- not defined there, fallback on default -->
<targetMaxSizeMB>${nuxeo.s3storage.transient.targetMaxSizeMB}</targetMaxSizeMB>
<absoluteMaxSizeMB>-1</absoluteMaxSizeMB>
<firstLevelTTL>${nuxeo.s3storage.transient.ttl}</firstLevelTTL>
<secondLevelTTL>${nuxeo.s3storage.transient.ttl2}</secondLevelTTL>
</store>
</extension>
<!-- this is the blobProvider pointing to the transient bucket -->
<!-- it is the source blobProvider -->
<extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration">
<blobprovider name="s3DirectUploadBlobProviderSource">
<class>${nuxeo.core.binarymanager}</class>
<property name="awsid">${nuxeo.s3storage.transient.awsid}</property>
<property name="awssecret">${nuxeo.s3storage.transient.awssecret}</property>
<property name="awstoken">${nuxeo.s3storage.transient.awstoken}</property>
<property name="bucket">${nuxeo.s3storage.transient.bucket}</property>
<property name="endpoint">${nuxeo.s3storage.transient.endpoint}</property>
<property name="pathstyleaccess">${nuxeo.s3storage.transient.pathstyleaccess}</property>
<property name="accelerateMode">${nuxeo.s3storage.transient.accelerateMode}</property>
<property name="region">${nuxeo.s3storage.transient.region}</property>
<property name="bucket_prefix">${nuxeo.s3storage.transient.bucket_prefix}</property>
<property name="crypt.serverside">${nuxeo.s3storage.transient.crypt.serverside}</property>
<property name="cachesize">100MB</property>
<!-- min file age, in second, to be removed from cache if the size max size is reached, default is 3600 -->
<property name="cacheminage">${nuxeo.s3storage.cacheminage}</property>
<property name="connection.max">${nuxeo.s3storage.connection.max}</property>
<property name="connection.retry">${nuxeo.s3storage.connection.retry}</property>
<property name="connection.timeout">${nuxeo.s3storage.connection.timeout}</property>
<property name="socket.timeout">${nuxeo.s3storage.socket.timeout}</property>
<!-- this blob provider is used for transient storage -->
<property name="transient">true</property>
</blobprovider>
</extension>
<!-- this is the blobProvider backing the transientStore used by the batchHandler -->
<!-- it is the destination blobProvider -->
<extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration">
<blobprovider name="s3DirectUploadBlobProviderDestination">
<class>${nuxeo.core.binarymanager}</class>
<property name="awsid">${nuxeo.s3storage.awsid}</property>
<property name="awssecret">${nuxeo.s3storage.awssecret}</property>
<property name="awstoken">${nuxeo.s3storage.awstoken}</property>
<property name="bucket">${nuxeo.s3storage.bucket}</property>
<property name="region">${nuxeo.s3storage.region}</property>
<property name="bucket_prefix">s3DirectUpload</property>
<property name="crypt.serverside">${nuxeo.s3storage.crypt.serverside}</property>
<property name="cachesize">${nuxeo.s3storage.cachesize}</property>
<property name="connection.max">${nuxeo.s3storage.connection.max}</property>
<property name="connection.retry">${nuxeo.s3storage.connection.retry}</property>
<property name="connection.timeout">${nuxeo.s3storage.connection.timeout}</property>
<property name="socket.timeout">${nuxeo.s3storage.socket.timeout}</property>
<!-- this blob provider is used for transient storage -->
<property name="transient">true</property>
<property name="keyStrategy">managed</property>
</blobprovider>
</extension>
<!-- the transient bucket and prefix are used to retrieve the file uploaded by the client -->
<extension target="org.nuxeo.ecm.automation.server.BatchManager" point="handlers">
<batchHandler>
<name>s3</name>
<class>org.nuxeo.ecm.core.storage.sql.S3DirectBatchHandler</class>
<property name="transientStore">s3TransientStore</property>
<property name="blobProvider">s3DirectUploadBlobProviderSource</property>
<property name="awsid">${nuxeo.s3storage.transient.awsid}</property>
<property name="awssecret">${nuxeo.s3storage.transient.awssecret}</property>
<property name="awstoken">${nuxeo.s3storage.transient.awstoken}</property>
<property name="bucket">${nuxeo.s3storage.transient.bucket}</property>
<property name="endpoint">${nuxeo.s3storage.transient.endpoint}</property>
<property name="expiration">${nuxeo.s3storage.transient.expiration}</property>
<property name="pathstyleaccess">${nuxeo.s3storage.transient.pathstyleaccess}</property>
<property name="accelerateMode">${nuxeo.s3storage.transient.accelerateMode}</property>
<property name="region">${nuxeo.s3storage.transient.region}</property>
<property name="bucket_prefix">${nuxeo.s3storage.transient.bucket_prefix}</property>
<property name="crypt.serverside">${nuxeo.s3storage.transient.crypt.serverside}</property>
<property name="crypt.kms.key">${nuxeo.s3storage.transient.crypt.kms.key}</property>
<property name="policyTemplate">{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:PutObject","Resource":["arn:aws:s3:::${nuxeo.s3storage.transient.bucket}/*"]}]}</property>
<property name="roleArn">${nuxeo.s3storage.transient.roleArn}</property>
</batchHandler>
</extension>
</#if>
</component>