This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch postgresql
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/postgresql by this push:
     new 26259e43ee JAMES-2586 - Set blobStorage implementation is postgres by 
default
26259e43ee is described below

commit 26259e43eecec5569eb8f0abe101f30fd1adaf20
Author: Tung Tran <[email protected]>
AuthorDate: Tue Jan 9 13:09:44 2024 +0700

    JAMES-2586 - Set blobStorage implementation is postgres by default
---
 server/apps/postgres-app/docker-compose.yml        |  1 +
 .../sample-configuration/blob.properties           | 66 ++++++++++++++++++++++
 .../apache/james/PostgresJamesConfiguration.java   |  5 +-
 .../james/BodyDeduplicationIntegrationTest.java    |  2 +-
 4 files changed, 71 insertions(+), 3 deletions(-)

diff --git a/server/apps/postgres-app/docker-compose.yml 
b/server/apps/postgres-app/docker-compose.yml
index 50440253bd..2eabbe331b 100644
--- a/server/apps/postgres-app/docker-compose.yml
+++ b/server/apps/postgres-app/docker-compose.yml
@@ -21,6 +21,7 @@ services:
       - "8000:8000"
     volumes:
       - 
./sample-configuration-single/search.properties:/root/conf/search.properties
+      - ./sample-configuration/blob.properties:/root/conf/blob.properties
 
   postgres:
     image: postgres:16.1
diff --git a/server/apps/postgres-app/sample-configuration/blob.properties 
b/server/apps/postgres-app/sample-configuration/blob.properties
new file mode 100644
index 0000000000..3a01ce1e91
--- /dev/null
+++ b/server/apps/postgres-app/sample-configuration/blob.properties
@@ -0,0 +1,66 @@
+# ============================================= BlobStore Implementation 
==================================
+# Read https://james.apache.org/server/config-blobstore.html for further 
details
+
+# Choose your BlobStore implementation
+# Mandatory, allowed values are: file, s3, postgres.
+implementation=postgres
+
+# ========================================= Deduplication 
========================================
+# If you choose to enable deduplication, the mails with the same content will 
be stored only once.
+# Warning: Once this feature is enabled, there is no turning back as turning 
it off will lead to the deletion of all
+# the mails sharing the same content once one is deleted.
+# Mandatory, Allowed values are: true, false
+deduplication.enable=true
+
+# deduplication.family needs to be incremented every time the 
deduplication.generation.duration is changed
+# Positive integer, defaults to 1
+# deduplication.gc.generation.family=1
+
+# Duration of generation.
+# Deduplication only takes place within a singe generation.
+# Only items two generation old can be garbage collected. (This prevent 
concurrent insertions issues and
+# accounts for a clock skew).
+# deduplication.family needs to be incremented everytime this parameter is 
changed.
+# Duration. Default unit: days. Defaults to 30 days.
+# deduplication.gc.generation.duration=30days
+
+# ========================================= Encryption 
========================================
+# If you choose to enable encryption, the blob content will be encrypted 
before storing them in the BlobStore.
+# Warning: Once this feature is enabled, there is no turning back as turning 
it off will lead to all content being
+# encrypted. This comes at a performance impact but presents you from leaking 
data if, for instance the third party
+# offering you a S3 service is compromised.
+# Optional, Allowed values are: true, false, defaults to false
+encryption.aes.enable=false
+
+# Mandatory (if AES encryption is enabled) salt and password. Salt needs to be 
an hexadecimal encoded string
+#encryption.aes.password=xxx
+#encryption.aes.salt=73616c7479
+# Optional, defaults to PBKDF2WithHmacSHA512
+#encryption.aes.private.key.algorithm=PBKDF2WithHmacSHA512
+
+# ============================================ Blobs Exporting 
==============================================
+# Read https://james.apache.org/server/config-blob-export.html for further 
details
+
+# Choosing blob exporting mechanism, allowed mechanism are: localFile, linshare
+# LinShare is a file sharing service, will be explained in the below section
+# Optional, default is localFile
+blob.export.implementation=localFile
+
+# ======================================= Local File Blobs Exporting 
========================================
+# Optional, directory to store exported blob, directory path follows James 
file system format
+# default is file://var/blobExporting
+blob.export.localFile.directory=file://var/blobExporting
+
+# ======================================= LinShare File Blobs Exporting 
========================================
+# LinShare is a sharing service where you can use james, connects to an 
existing LinShare server and shares files to
+# other mail addresses as long as those addresses available in LinShare. For 
example you can deploy James and LinShare
+# sharing the same LDAP repository
+# Mandatory if you choose LinShare, url to connect to LinShare service
+# blob.export.linshare.url=http://linshare:8080
+
+# ======================================= LinShare Configuration 
BasicAuthentication ===================================
+# Authentication is mandatory if you choose LinShare, TechnicalAccount is need 
to connect to LinShare specific service.
+# For Example: It will be formalized to 'Authorization: Basic {Credential of 
UUID/password}'
+
+# blob.export.linshare.technical.account.uuid=Technical_Account_UUID
+# blob.export.linshare.technical.account.password=password
diff --git 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
index d526c89237..dbf65c350f 100644
--- 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
+++ 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
@@ -43,9 +43,9 @@ import com.google.common.base.Preconditions;
 
 public class PostgresJamesConfiguration implements Configuration {
 
-    private static final Logger LOGGER = 
LoggerFactory.getLogger(PostgresJamesConfiguration.class);
+    private static final Logger LOGGER = 
LoggerFactory.getLogger("org.apache.james.CONFIGURATION");
 
-    private static BlobStoreConfiguration.BlobStoreImplName DEFAULT_BLOB_STORE 
= BlobStoreConfiguration.BlobStoreImplName.FILE;
+    private static final BlobStoreConfiguration.BlobStoreImplName 
DEFAULT_BLOB_STORE = BlobStoreConfiguration.BlobStoreImplName.POSTGRES;
 
     public enum EventBusImpl {
         IN_MEMORY, RABBITMQ;
@@ -171,6 +171,7 @@ public class PostgresJamesConfiguration implements 
Configuration {
                 }
             });
 
+            LOGGER.info("BlobStore configuration {}", blobStoreConfiguration);
             return new PostgresJamesConfiguration(
                 configurationPath,
                 directories,
diff --git 
a/server/apps/postgres-app/src/test/java/org/apache/james/BodyDeduplicationIntegrationTest.java
 
b/server/apps/postgres-app/src/test/java/org/apache/james/BodyDeduplicationIntegrationTest.java
index ec50a57284..c048b3de6b 100644
--- 
a/server/apps/postgres-app/src/test/java/org/apache/james/BodyDeduplicationIntegrationTest.java
+++ 
b/server/apps/postgres-app/src/test/java/org/apache/james/BodyDeduplicationIntegrationTest.java
@@ -56,7 +56,7 @@ class BodyDeduplicationIntegrationTest implements 
MailsShouldBeWellReceived {
             .configurationFromClasspath()
             .searchConfiguration(SearchConfiguration.scanning())
             .blobStore(BlobStoreConfiguration.builder()
-                .file()
+                .postgres()
                 .disableCache()
                 .deduplication()
                 .noCryptoConfig())


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to