You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/06/05 03:04:27 UTC

[james-project] branch master updated (154cf9b -> d38d697)

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

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from 154cf9b  JAMES-3591 Allow disactivation of CassandraBlobStoreDAO startup warning via environment variable
     new 0002586  JAMES-3261 Expose volumes for the memory image with JIB
     new 7727c03  JAMES-3261 Package the Distributed server docker image with JIB
     new 4015b6d  JAMES-3261 Package the Cassandra server docker image with JIB
     new 1180ca6  JAMES-3261 Package the JPA server docker image with JIB
     new 648fd34  JAMES-3261 Package the JPA SMTP server docker image with JIB
     new ba66d12  JAMES-3261 Indicate in READMEs how to set up custom keystore
     new d6df893  JAMES-3261 README should advise to rely on maven as a build system
     new dd030ff  JAMES-3261 Link projects specific READMEs within the main README.
     new a402635  JAMES-3261 Useful commands: use embedded cli script for embedded images
     new 8c7e81d  JAMES-3261 Adapt running the distributed server with docker documentation
     new d38d697  JAMES-3261 Fix typos in James memory JIB declarations

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.adoc                                        | 194 ++-------------------
 .../run/guice/cassandra-rabbitmq/Dockerfile        |  46 -----
 .../cassandra-rabbitmq/destination/run_james.sh    |   9 -
 dockerfiles/run/guice/cassandra/Dockerfile         |  48 -----
 .../destination/glowroot/plugins/spooler.json      |  45 -----
 .../run/guice/cassandra/destination/run_james.sh   |   9 -
 dockerfiles/run/guice/jpa-smtp/Dockerfile          |  48 -----
 .../jpa-smtp/destination/extensions-jars/README.md |   5 -
 .../run/guice/jpa-smtp/destination/run_james.sh    |  11 --
 dockerfiles/run/guice/jpa/Dockerfile               |  50 ------
 dockerfiles/run/guice/jpa/destination/run_james.sh |  10 --
 .../servers/pages/distributed/run-docker.adoc      |  43 ++---
 server/container/guice/cassandra-guice/README.adoc |  51 +++++-
 server/container/guice/cassandra-guice/pom.xml     | 123 +++++++++++++
 .../src/main}/extensions-jars/README.md            |   2 +-
 .../cassandra-guice/src/main}/glowroot/admin.json  |   0
 .../src/main}/glowroot/plugins/blobstore.json      |   0
 .../src/main}/glowroot/plugins/imap.json           |   0
 .../src/main}/glowroot/plugins/jmap.json           |   0
 .../main}/glowroot/plugins/mailboxListener.json    |   0
 .../src/main}/glowroot/plugins/smtp.json           |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../src/main}/glowroot/plugins/task.json           |   0
 .../src/main/scripts/james-cli                     |   0
 .../guice/cassandra-rabbitmq-guice/README.adoc     |  50 +++++-
 .../guice/cassandra-rabbitmq-guice/pom.xml         | 120 +++++++++++++
 .../src/main}/extensions-jars/README.md            |   2 +-
 .../src/main}/glowroot/admin.json                  |   0
 .../src/main}/glowroot/plugins/blobstore.json      |   0
 .../src/main}/glowroot/plugins/imap.json           |   0
 .../src/main}/glowroot/plugins/jmap.json           |   0
 .../main}/glowroot/plugins/mailboxListener.json    |   0
 .../src/main}/glowroot/plugins/smtp.json           |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../src/main}/glowroot/plugins/task.json           |   0
 .../src/main/scripts/james-cli                     |   0
 server/container/guice/jpa-guice/README.adoc       |  51 +++++-
 server/container/guice/jpa-guice/pom.xml           | 114 ++++++++++++
 .../jpa-guice/src/main}/extensions-jars/README.md  |   2 +-
 .../guice/jpa-guice/src/main}/glowroot/admin.json  |   0
 .../jpa-guice/src/main}/glowroot/plugins/imap.json |   0
 .../jpa-guice/src/main}/glowroot/plugins/jmap.json |   0
 .../main}/glowroot/plugins/mailboxListener.json    |   0
 .../jpa-guice/src/main}/glowroot/plugins/smtp.json |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../jpa-guice/src/main}/glowroot/plugins/task.json |   0
 .../src/main/scripts/james-cli                     |   0
 server/container/guice/jpa-smtp/README.adoc        |  51 +++++-
 server/container/guice/jpa-smtp/pom.xml            | 125 ++++++++++++-
 .../jpa-smtp/src/main}/extensions-jars/README.md   |   2 +-
 .../guice/jpa-smtp/src/main}/glowroot/admin.json   |   0
 .../src/main/glowroot/plugins/imap.json            |   0
 .../jpa-smtp/src/main}/glowroot/plugins/jmap.json  |   0
 .../src/main/glowroot/plugins/mailboxListener.json |   0
 .../jpa-smtp/src/main}/glowroot/plugins/smtp.json  |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../jpa-smtp/src/main}/glowroot/plugins/task.json  |   0
 .../src/main/scripts/james-cli                     |   0
 server/container/guice/memory-guice/README.md      |   8 +
 server/container/guice/memory-guice/pom.xml        |   8 +-
 .../src/main/extensions-jars/README.md             |   2 +-
 61 files changed, 741 insertions(+), 488 deletions(-)
 delete mode 100644 dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
 delete mode 100755 dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
 delete mode 100644 dockerfiles/run/guice/cassandra/Dockerfile
 delete mode 100644 dockerfiles/run/guice/cassandra/destination/glowroot/plugins/spooler.json
 delete mode 100755 dockerfiles/run/guice/cassandra/destination/run_james.sh
 delete mode 100644 dockerfiles/run/guice/jpa-smtp/Dockerfile
 delete mode 100644 dockerfiles/run/guice/jpa-smtp/destination/extensions-jars/README.md
 delete mode 100755 dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
 delete mode 100644 dockerfiles/run/guice/jpa/Dockerfile
 delete mode 100755 dockerfiles/run/guice/jpa/destination/run_james.sh
 copy {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/cassandra-guice/src/main}/extensions-jars/README.md (74%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/cassandra-guice/src/main}/glowroot/admin.json (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/blobstore.json (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/imap.json (100%)
 copy {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/jmap.json (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/mailboxListener.json (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/smtp.json (100%)
 copy {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/spooler.json (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/cassandra-guice/src/main}/glowroot/plugins/task.json (100%)
 copy server/container/guice/{memory-guice => cassandra-guice}/src/main/scripts/james-cli (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/extensions-jars/README.md (74%)
 rename {dockerfiles/run/guice/jpa-smtp/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/admin.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/blobstore.json (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/imap.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/jmap.json (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/mailboxListener.json (100%)
 rename {dockerfiles/run/guice/jpa-smtp/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/smtp.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/spooler.json (100%)
 rename {dockerfiles/run/guice/jpa-smtp/destination => server/container/guice/cassandra-rabbitmq-guice/src/main}/glowroot/plugins/task.json (100%)
 copy server/container/guice/{memory-guice => cassandra-rabbitmq-guice}/src/main/scripts/james-cli (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/jpa-guice/src/main}/extensions-jars/README.md (74%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/jpa-guice/src/main}/glowroot/admin.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/jpa-guice/src/main}/glowroot/plugins/imap.json (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/jpa-guice/src/main}/glowroot/plugins/jmap.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/jpa-guice/src/main}/glowroot/plugins/mailboxListener.json (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/jpa-guice/src/main}/glowroot/plugins/smtp.json (100%)
 rename {dockerfiles/run/guice/jpa/destination => server/container/guice/jpa-guice/src/main}/glowroot/plugins/spooler.json (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/jpa-guice/src/main}/glowroot/plugins/task.json (100%)
 copy server/container/guice/{memory-guice => jpa-guice}/src/main/scripts/james-cli (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/jpa-smtp/src/main}/extensions-jars/README.md (74%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/jpa-smtp/src/main}/glowroot/admin.json (100%)
 copy server/container/guice/{memory-guice => jpa-smtp}/src/main/glowroot/plugins/imap.json (100%)
 rename {dockerfiles/run/guice/cassandra/destination => server/container/guice/jpa-smtp/src/main}/glowroot/plugins/jmap.json (100%)
 copy server/container/guice/{memory-guice => jpa-smtp}/src/main/glowroot/plugins/mailboxListener.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/jpa-smtp/src/main}/glowroot/plugins/smtp.json (100%)
 rename {dockerfiles/run/guice/jpa-smtp/destination => server/container/guice/jpa-smtp/src/main}/glowroot/plugins/spooler.json (100%)
 rename {dockerfiles/run/guice/cassandra-rabbitmq/destination => server/container/guice/jpa-smtp/src/main}/glowroot/plugins/task.json (100%)
 copy server/container/guice/{memory-guice => jpa-smtp}/src/main/scripts/james-cli (100%)

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 11/11: JAMES-3261 Fix typos in James memory JIB declarations

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d38d6976d9d37b6667e65078e292d000dea173f9
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon May 31 18:05:15 2021 +0700

    JAMES-3261 Fix typos in James memory JIB declarations
---
 server/container/guice/memory-guice/pom.xml                            | 2 +-
 server/container/guice/memory-guice/src/main/extensions-jars/README.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/container/guice/memory-guice/pom.xml b/server/container/guice/memory-guice/pom.xml
index 85bfcdf..ed3c7a2 100644
--- a/server/container/guice/memory-guice/pom.xml
+++ b/server/container/guice/memory-guice/pom.xml
@@ -251,7 +251,7 @@
                 <artifactId>download-maven-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>install-jbpm</id>
+                        <id>install-glowroot</id>
                         <goals>
                             <goal>wget</goal>
                         </goals>
diff --git a/server/container/guice/memory-guice/src/main/extensions-jars/README.md b/server/container/guice/memory-guice/src/main/extensions-jars/README.md
index 2cea759..dab5c40 100644
--- a/server/container/guice/memory-guice/src/main/extensions-jars/README.md
+++ b/server/container/guice/memory-guice/src/main/extensions-jars/README.md
@@ -2,4 +2,4 @@
 
 The jar in this folder will be added to JAMES classpath when mounted under /root/extensions-jars inside the running container.
 
-You can use it to add you customs Mailets/Matchers.
+You can use it to add your custom Mailets/Matchers.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 10/11: JAMES-3261 Adapt running the distributed server with docker documentation

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c7e81d581c35e973f2bb75c3266a4df5acb14d8
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:39:39 2021 +0700

    JAMES-3261 Adapt running the distributed server with docker documentation
---
 .../servers/pages/distributed/run-docker.adoc      | 43 +++++++++++-----------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/docs/modules/servers/pages/distributed/run-docker.adoc b/docs/modules/servers/pages/distributed/run-docker.adoc
index 22a9ad4..2dce838 100644
--- a/docs/modules/servers/pages/distributed/run-docker.adoc
+++ b/docs/modules/servers/pages/distributed/run-docker.adoc
@@ -34,13 +34,17 @@ Follow the 'Useful commands' section for more information about James CLI.
 
 === Requirements
 
-Built artifacts should be in ./dockerfiles/run/guice/cassandra-rabbitmq/destination folder for cassandra.
-If you haven't already:
+Compile the whole project:
 
-    $ docker build -t james/project dockerfiles/compilation/java-11
-    $ docker run -v $HOME/.m2:/root/.m2 -v $PWD:/origin \
-  -v $PWD/dockerfiles/run/guice/cassandra-rabbitmq/destination:/cassandra-rabbitmq/destination \
-  -t james/project -s HEAD
+    mvn clean install -DskipTests -T 4
+
+Then load the distributed server docker image:
+
+    docker load -i server/container/guice/cassandra-rabbitmq-guice/target/jib-image.tar
+
+Alternatively we provide convenience distribution for the latest release:
+
+    docker pull apache/james:distributed-3.6.0
 
 === Running
 
@@ -68,18 +72,15 @@ You can find more explanation on the need of Tika in this page http://james.apac
 
 We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.
 
-Copy your TLS keys to `run/guice/cassandra-rabbitmq/destination/conf/keystore` or generate it using the following command. The password must be `james72laBalle` to match default configuration.
+Copy your TLS keys to the current folder or generate it using the following command. The password must be `james72laBalle` to match default configuration.
 
-    $ keytool -genkey -alias james -keyalg RSA -keystore dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/keystore
-
-Then we need to build james container :
-
-    $ docker build -t james_run dockerfiles/run/guice/cassandra-rabbitmq
+    $ keytool -genkey -alias james -keyalg RSA -keystore keystore
 
 To run this container :
 
     $ docker run --hostname HOSTNAME -p "25:25" -p 80:80 -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" -p "127.0.0.1:8000:8000" --link cassandra:cassandra --link rabbitmq:rabbitmq
-   --link elasticsearch:elasticsearch --link tika:tika --link s3:s3.docker.test --name james_run -t james_run
+         --link elasticsearch:elasticsearch --link tika:tika --link s3:s3.docker.test --name james_run
+         -v $PWD/keystore:/root/conf/keystore -t apache/james:distributed-latest
 
 Where :
 
@@ -88,18 +89,17 @@ Where :
 Webadmin port binding is restricted to loopback as users are not authenticated by default on webadmin server. Thus you should avoid exposing it in production.
 Note that the above example assumes `127.0.0.1` is your loopback interface for convenience but you should change it if this is not the case on your machine.
 
-If you want to pass additional options to the underlying java command, you can configure a _JVM_OPTIONS_ env variable, for example add:
+If you want to pass additional options to the underlying java command, you can configure a _JAVA_TOOL_OPTIONS_ env variable, for example add:
 
-    --env JVM_OPTIONS="-Xms256m -Xmx2048m"
+    --env "JAVA_TOOL_OPTIONS=-Xms256m -Xmx2048m"
 
 To have log file accessible on a volume, add *-v  $PWD/logs:/logs* option to the above command line, where *$PWD/logs* is your local directory to put files in.
 
 === Instrumentation
-You can use Glowroot to instrumentalize James. The provided guice docker files allow a simple way to do it.
-In order to activate Glowroot you need to run the container with the environment variable _GLOWROOT_ACTIVATED_ set to _true_
-and to expose the glowroot instrumentation ui port.
+You can use link:https://glowroot.org/[Glowroot] to instrumentalize James. It is packaged as part of the docker distribution to easily enable valuable performances insights.
+Disabled by default, its java agent can easily be enabled:
 
-    --env GLOWROOT_ACTIVATED=true -p "4000:4000"
+    --env "JAVA_TOOL_OPTIONS=-javaagent:/root/glowroot.jar" -p "4000:4000"
 
 By default, the Glowroot UI is accessible from every machines in the network as defined in the _destination/admin.json_.
 Which you could configure before building the image, if you want to restrict its accessibility to localhost for example.
@@ -118,5 +118,6 @@ Run tika:
 
 Add a link for the tika container in the above command line:
 
-    $ docker run --hostname HOSTNAME -p "25:25" -p 80:80 -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" --link cassandra:cassandra --link rabbitmq:rabbitmq
-    --link elasticsearch:elasticsearch --link tika:tika --name james_run -t james_run
+    $ docker run --hostname HOSTNAME -p "25:25" -p 80:80 -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" -p "127.0.0.1:8000:8000" --link cassandra:cassandra --link rabbitmq:rabbitmq
+         --link elasticsearch:elasticsearch --link tika:tika --link s3:s3.docker.test --name james_run
+         --link tika:tika -v $PWD/keystore:/root/conf/keystore -t apache/james:distributed-latest

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 07/11: JAMES-3261 README should advise to rely on maven as a build system

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d6df893534c10160f980def22ccf98ac2816088f
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:23:30 2021 +0700

    JAMES-3261 README should advise to rely on maven as a build system
---
 README.adoc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/README.adoc b/README.adoc
index 67af057..9e4baf6 100644
--- a/README.adoc
+++ b/README.adoc
@@ -92,7 +92,20 @@ Follow the 'Useful commands' section for more information about James CLI.
 
 In order to have a standard compilation environment, we introduce Dockerfiles, using java-11.
 
-=== Java 11
+=== Maven
+
+We require maven version 3.6.0 minimum to build the project.
+
+Simply run `mvn clean install` within this directory to compile the project.
+
+Useful options includes:
+
+ - `-DskipTests` to skip the long to execute resource consuming test suite that requires a docker daemon.
+ - `-T 4` to parallelize the build on several CPUs.
+
+=== With the docker wrapper
+
+Alternatively we provide a standard compilation environement bundled in a docker image.
 
 First step, you have to build the Docker image
 

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 05/11: JAMES-3261 Package the JPA SMTP server docker image with JIB

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 648fd34090e45047b3c66138fd1526c42f2cbbe1
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:08:38 2021 +0700

    JAMES-3261 Package the JPA SMTP server docker image with JIB
---
 dockerfiles/run/guice/jpa-smtp/Dockerfile          |  48 --------
 .../run/guice/jpa-smtp/destination/run_james.sh    |  11 --
 server/container/guice/jpa-smtp/README.adoc        |  42 ++++++-
 server/container/guice/jpa-smtp/pom.xml            | 125 ++++++++++++++++++++-
 .../jpa-smtp/src/main}/extensions-jars/README.md   |   2 +-
 .../guice/jpa-smtp/src/main}/glowroot/admin.json   |   0
 .../jpa-smtp/src/main/glowroot/plugins/imap.json   |  19 ++++
 .../jpa-smtp/src/main/glowroot/plugins/jmap.json   |  19 ++++
 .../src/main/glowroot/plugins/mailboxListener.json |  19 ++++
 .../jpa-smtp/src/main}/glowroot/plugins/smtp.json  |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../jpa-smtp/src/main}/glowroot/plugins/task.json  |   0
 .../guice/jpa-smtp/src/main/scripts/james-cli      |   3 +
 13 files changed, 226 insertions(+), 62 deletions(-)

diff --git a/dockerfiles/run/guice/jpa-smtp/Dockerfile b/dockerfiles/run/guice/jpa-smtp/Dockerfile
deleted file mode 100644
index 1f2ce41..0000000
--- a/dockerfiles/run/guice/jpa-smtp/Dockerfile
+++ /dev/null
@@ -1,48 +0,0 @@
-# Run James
-#
-# VERSION	1.0
-
-FROM adoptopenjdk:11-jre-hotspot
-
-# Ports that are used
-#
-# 25   SMTP without authentication
-# 143  IMAP with startTLS enabled
-# 465  SMTP with authentication and socketTLS enabled
-# 587  SMTP with authentication and startTLS enabled
-# 8000 Web Admin interface (unsecured: expose at your own risks)
-
-EXPOSE 25 143 465 587 4000 8000
-
-WORKDIR /root
-RUN apt-get update && apt-get install -y unzip
-
-# Get data we need to run James : build results and configuration
-ADD destination/james-server-jpa-smtp-guice.zip /root
-RUN unzip james-server-jpa-smtp-guice.zip && \
-   cp -r /root/james-server-jpa-smtp-guice/* /root && \
-   rm james-server-jpa-smtp-guice.zip && \
-   rm -r james-server-jpa-smtp-guice
-ADD destination/james-server-cli.jar /root/james-cli.jar
-ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/glowroot/plugins /root/glowroot/plugins
-ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
-ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
-ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
-ADD destination/glowroot/admin.json /root/glowroot/admin.json
-ADD destination/run_james.sh /root/run_james.sh
-
-VOLUME /logs
-VOLUME /root/conf
-VOLUME /root/glowroot/plugins
-VOLUME /root/glowroot/data
-# Data for ActiveMQ mailQueue
-VOLUME /root/var
-# Data for derby database
-VOLUME /var/store
-
-ENV PATH="$PATH:/root/glowroot/lib" \
-    JVM_OPTIONS="" \
-    GLOWROOT_ACTIVATED="false"
-
-ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
deleted file mode 100755
index 4e518fe..0000000
--- a/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
-    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
-fi
-
-
-java -javaagent:james-server-jpa-smtp-guice.lib/openjpa-3.1.2.jar \
-  -Dworking.directory=. \
-  $GLOWROOT_OPTIONS \
-  $JVM_OPTIONS \
-  -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-smtp-guice.jar
\ No newline at end of file
diff --git a/server/container/guice/jpa-smtp/README.adoc b/server/container/guice/jpa-smtp/README.adoc
index bd51c8b..c3bc6d5 100644
--- a/server/container/guice/jpa-smtp/README.adoc
+++ b/server/container/guice/jpa-smtp/README.adoc
@@ -30,4 +30,44 @@ Once everything is set up, you just have to run the jar with:
 $ java -javaagent:james-server-jpa-smtp-guice.lib/openjpa-3.1.2.jar -Dworking.directory=. -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-smtp-guice.jar
 ----
 
-Note that binding ports below 1024 requires administrative rights.
\ No newline at end of file
+Note that binding ports below 1024 requires administrative rights.
+
+== Docker distribution
+
+To import the image locally:
+
+[source]
+----
+docker image load -i target/jib-image.tar
+----
+
+Then run it:
+
+[source]
+----
+docker run apache/james:jpa-smtp-latest
+----
+
+Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
+to pass extra JVM flags. For instance:
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-Xmx500m -Xms500m" apache/james:jpa-smtp-latest
+----
+
+[Glowroot APM](https://glowroot.org/) is packaged as part of the docker distribution to easily enable valuable performances insights.
+Disabled by default, its java agent can easily be enabled:
+
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-javaagent:/root/glowroot.jar" apache/james:jpa-smtp-latest
+----
+The [CLI](https://james.apache.org/server/manage-cli.html) can easily be used:
+
+
+[source]
+----
+docker exec CONTAINER-ID james-cli ListDomains
+----
\ No newline at end of file
diff --git a/server/container/guice/jpa-smtp/pom.xml b/server/container/guice/jpa-smtp/pom.xml
index 52e47d0..145f260 100644
--- a/server/container/guice/jpa-smtp/pom.xml
+++ b/server/container/guice/jpa-smtp/pom.xml
@@ -48,6 +48,11 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-cli</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-common</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
@@ -103,7 +108,125 @@
     </dependencies>
 
     <build>
-        <plugins>
+        <plugins>           <plugin>
+            <groupId>com.googlecode.maven-download-plugin</groupId>
+            <artifactId>download-maven-plugin</artifactId>
+            <executions>
+                <execution>
+                    <id>install-glowroot</id>
+                    <goals>
+                        <goal>wget</goal>
+                    </goals>
+                    <phase>package</phase>
+                    <configuration>
+                        <url>https://github.com/glowroot/glowroot/releases/download/v0.13.4/glowroot-0.13.4-dist.zip</url>
+                        <unpack>true</unpack>
+                        <outputDirectory>${project.build.directory}</outputDirectory>
+                        <md5>93d472281a67ab8404033a88280c23c9</md5>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-glowroot-resources</id>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/glowroot</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/glowroot</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.google.cloud.tools</groupId>
+                <artifactId>jib-maven-plugin</artifactId>
+                <configuration>
+                    <from>
+                        <image>adoptopenjdk:11-jdk-hotspot</image>
+                    </from>
+                    <to>
+                        <image>apache/james</image>
+                        <tags>
+                            <tag>jpa-smtp-latest</tag>
+                        </tags>
+                    </to>
+                    <container>
+                        <mainClass>org.apache.james.JPAJamesServerMain</mainClass>
+                        <ports>
+                            <port>80</port> <!-- JMAP -->
+                            <port>143</port> <!-- IMAP -->
+                            <port>993</port> <!-- IMAPS -->
+                            <port>25</port> <!-- SMTP -->
+                            <port>465</port> <!-- SMTP + STARTTLS -->
+                            <port>587</port> <!-- SMTPS -->
+                            <port>4000</port> <!-- GLOWROOT, if activated -->
+                            <port>8000</port> <!-- WEBADMIN -->
+                        </ports>
+                        <appRoot>/root</appRoot>
+                        <jvmFlags>
+                            <jvmFlag>-Dlogback.configurationFile=/root/conf/logback.xml</jvmFlag>
+                            <jvmFlag>-Dworking.directory=/root/</jvmFlag>
+                        </jvmFlags>
+                        <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+                        <volumes>
+                            <volume>/logs</volume>
+                            <volume>/root/conf</volume>
+                            <!-- Data for ActiveMQ mailQueue -->
+                            <volume>/root/var</volume>
+                            <!-- Data for derby database -->
+                            <volume>/var/store</volume>
+                            <volume>/root/glowroot/plugins</volume>
+                            <volume>/root/glowroot/data</volume>
+                        </volumes>
+                    </container>
+                    <extraDirectories>
+                        <paths>
+                            <path>
+                                <from>sample-configuration</from>
+                                <into>/root/conf</into>
+                            </path>
+                            <path>
+                                <from>src/main/scripts</from>
+                                <into>/usr/bin</into>
+                            </path>
+                            <path>
+                                <from>target/glowroot</from>
+                                <into>/root</into>
+                            </path>
+                            <path>
+                                <from>src/main/extensions-jars</from>
+                                <into>/root/extensions-jars</into>
+                            </path>
+                        </paths>
+                        <permissions>
+                            <permission>
+                                <file>/usr/bin/james-cli</file>
+                                <mode>755</mode> <!-- Read/write/execute for owner, read/execute for group/other -->
+                            </permission>
+                        </permissions>
+                    </extraDirectories>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>buildTar</goal>
+                        </goals>
+                        <phase>package</phase>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/extensions-jars/README.md b/server/container/guice/jpa-smtp/src/main/extensions-jars/README.md
similarity index 74%
rename from dockerfiles/run/guice/jpa-smtp/destination/extensions-jars/README.md
rename to server/container/guice/jpa-smtp/src/main/extensions-jars/README.md
index 00f9d15..dab5c40 100644
--- a/dockerfiles/run/guice/jpa-smtp/destination/extensions-jars/README.md
+++ b/server/container/guice/jpa-smtp/src/main/extensions-jars/README.md
@@ -2,4 +2,4 @@
 
 The jar in this folder will be added to JAMES classpath when mounted under /root/extensions-jars inside the running container.
 
-You can use it to add your customs Mailets/Matchers.
+You can use it to add your custom Mailets/Matchers.
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json b/server/container/guice/jpa-smtp/src/main/glowroot/admin.json
similarity index 100%
rename from dockerfiles/run/guice/jpa-smtp/destination/glowroot/admin.json
rename to server/container/guice/jpa-smtp/src/main/glowroot/admin.json
diff --git a/server/container/guice/jpa-smtp/src/main/glowroot/plugins/imap.json b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/imap.json
new file mode 100644
index 0000000..d27904f
--- /dev/null
+++ b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/imap.json
@@ -0,0 +1,19 @@
+{
+  "name": "IMAP Plugin",
+  "id": "imap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.imap.processor.base.AbstractChainedProcessor",
+      "methodName": "doProcess",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "IMAP",
+      "transactionNameTemplate": "IMAP processor : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "imapProcessor"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/server/container/guice/jpa-smtp/src/main/glowroot/plugins/jmap.json b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/jmap.json
new file mode 100644
index 0000000..9afce4b
--- /dev/null
+++ b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/jmap.json
@@ -0,0 +1,19 @@
+{
+  "name": "JMAP Plugin",
+  "id": "jmap",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.jmap.draft.methods.Method",
+      "methodName": "processToStream",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "JMAP",
+      "transactionNameTemplate": "JMAP method : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "jmapMethod"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/server/container/guice/jpa-smtp/src/main/glowroot/plugins/mailboxListener.json b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/mailboxListener.json
new file mode 100644
index 0000000..54a55ac
--- /dev/null
+++ b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/mailboxListener.json
@@ -0,0 +1,19 @@
+{
+  "name": "MailboxListener Plugin",
+  "id": "mailboxListener",
+  "instrumentation": [
+    {
+      "className": "org.apache.james.mailbox.events.MailboxListener",
+      "methodName": "event",
+      "methodParameterTypes": [
+        ".."
+      ],
+      "captureKind": "transaction",
+      "transactionType": "MailboxListener",
+      "transactionNameTemplate": "MailboxListener : {{this.class.name}}",
+      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
+      "timerName": "mailboxListener"
+    }
+  ]
+}
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/smtp.json b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/smtp.json
similarity index 100%
rename from dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/smtp.json
rename to server/container/guice/jpa-smtp/src/main/glowroot/plugins/smtp.json
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/spooler.json b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/spooler.json
similarity index 100%
rename from dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/spooler.json
rename to server/container/guice/jpa-smtp/src/main/glowroot/plugins/spooler.json
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/task.json b/server/container/guice/jpa-smtp/src/main/glowroot/plugins/task.json
similarity index 100%
rename from dockerfiles/run/guice/jpa-smtp/destination/glowroot/plugins/task.json
rename to server/container/guice/jpa-smtp/src/main/glowroot/plugins/task.json
diff --git a/server/container/guice/jpa-smtp/src/main/scripts/james-cli b/server/container/guice/jpa-smtp/src/main/scripts/james-cli
new file mode 100755
index 0000000..19a73b6
--- /dev/null
+++ b/server/container/guice/jpa-smtp/src/main/scripts/james-cli
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java -cp /root/resources:/root/classes:/root/libs/* org.apache.james.cli.ServerCmd "$@"
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 02/11: JAMES-3261 Package the Distributed server docker image with JIB

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7727c03863465a0a877a1f296203416f60b62717
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 13:28:43 2021 +0700

    JAMES-3261 Package the Distributed server docker image with JIB
---
 .../run/guice/cassandra-rabbitmq/Dockerfile        |  46 --------
 .../cassandra-rabbitmq/destination/run_james.sh    |   9 --
 .../guice/cassandra-rabbitmq-guice/README.adoc     |  42 +++++++-
 .../guice/cassandra-rabbitmq-guice/pom.xml         | 120 +++++++++++++++++++++
 .../src/main}/extensions-jars/README.md            |   2 +-
 .../src/main}/glowroot/admin.json                  |   0
 .../src/main}/glowroot/plugins/blobstore.json      |   0
 .../src/main}/glowroot/plugins/imap.json           |   0
 .../src/main}/glowroot/plugins/jmap.json           |   0
 .../main}/glowroot/plugins/mailboxListener.json    |   0
 .../src/main}/glowroot/plugins/smtp.json           |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../src/main}/glowroot/plugins/task.json           |   0
 .../src/main/scripts/james-cli                     |   3 +
 14 files changed, 165 insertions(+), 57 deletions(-)

diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
deleted file mode 100644
index 90cfe3c..0000000
--- a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
+++ /dev/null
@@ -1,46 +0,0 @@
-# Run James
-#
-# VERSION	1.0
-
-FROM adoptopenjdk:11-jre-hotspot
-
-# Ports that are used
-#
-# 25   SMTP without authentication
-# 110  POP3
-# 143  IMAP with startTLS enabled
-# 465  SMTP with authentication and socketTLS enabled
-# 587  SMTP with authentication and startTLS enabled
-# 993  IMAP with socketTLS enabled
-# 8000 Web Admin interface (unsecured: expose at your own risks)
-
-EXPOSE 25 110 143 465 587 993 4000 8000
-
-WORKDIR /root
-RUN apt-get update && apt-get install -y unzip
-
-# Get data we need to run James : build results and configuration
-ADD destination/james-server-distributed-guice.zip /root
-RUN unzip james-server-distributed-guice.zip && \
-   cp -r /root/james-server-distributed-guice/* /root && \
-   rm james-server-distributed-guice.zip && \
-   rm -r james-server-distributed-guice
-ADD destination/james-server-cli.jar /root/james-cli.jar
-ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/glowroot/plugins /root/glowroot/plugins
-ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
-ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
-ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
-ADD destination/glowroot/admin.json /root/glowroot/admin.json
-ADD destination/run_james.sh /root/run_james.sh
-
-VOLUME /logs
-VOLUME /root/conf
-VOLUME /root/glowroot/plugins
-VOLUME /root/glowroot/data
-
-ENV PATH="$PATH:/root/glowroot/lib" \
-    JVM_OPTIONS="" \
-    GLOWROOT_ACTIVATED="false"
-
-ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
deleted file mode 100755
index 3450399..0000000
--- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
-    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
-fi
-
-java -Dworking.directory=. \
-  $GLOWROOT_OPTIONS \
-  $JVM_OPTIONS \
-  -Dlogback.configurationFile=conf/logback.xml -jar james-server-cassandra-rabbitmq-guice.jar
\ No newline at end of file
diff --git a/server/container/guice/cassandra-rabbitmq-guice/README.adoc b/server/container/guice/cassandra-rabbitmq-guice/README.adoc
index 5f521ff..982334e 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/README.adoc
+++ b/server/container/guice/cassandra-rabbitmq-guice/README.adoc
@@ -43,4 +43,44 @@ Once everything is set up, you just have to run the jar with:
 $ java -Dworking.directory=. -Dlogback.configurationFile=conf/logback.xml -jar james-server-cassandra-rabbitmq-guice.jar
 ----
 
-Note that binding ports below 1024 requires administrative rights.
\ No newline at end of file
+Note that binding ports below 1024 requires administrative rights.
+
+== Docker distribution
+
+To import the image locally:
+
+[source]
+----
+docker image load -i target/jib-image.tar
+----
+
+Then run it:
+
+[source]
+----
+docker run apache/james:distributed-latest
+----
+
+Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
+to pass extra JVM flags. For instance:
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-Xmx500m -Xms500m" apache/james:distributed-latest
+----
+
+[Glowroot APM](https://glowroot.org/) is packaged as part of the docker distribution to easily enable valuable performances insights.
+Disabled by default, its java agent can easily be enabled:
+
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-javaagent:/root/glowroot.jar" apache/james:distributed-latest
+----
+The [CLI](https://james.apache.org/server/manage-cli.html) can easily be used:
+
+
+[source]
+----
+docker exec CONTAINER-ID james-cli ListDomains
+----
\ No newline at end of file
diff --git a/server/container/guice/cassandra-rabbitmq-guice/pom.xml b/server/container/guice/cassandra-rabbitmq-guice/pom.xml
index bf70ac3..ef79eae 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/pom.xml
+++ b/server/container/guice/cassandra-rabbitmq-guice/pom.xml
@@ -123,6 +123,11 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-cli</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-cassandra</artifactId>
         </dependency>
         <dependency>
@@ -322,6 +327,121 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>com.googlecode.maven-download-plugin</groupId>
+                <artifactId>download-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>install-glowroot</id>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <url>https://github.com/glowroot/glowroot/releases/download/v0.13.4/glowroot-0.13.4-dist.zip</url>
+                            <unpack>true</unpack>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <md5>93d472281a67ab8404033a88280c23c9</md5>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-glowroot-resources</id>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/glowroot</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/glowroot</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.google.cloud.tools</groupId>
+                <artifactId>jib-maven-plugin</artifactId>
+                <configuration>
+                    <from>
+                        <image>adoptopenjdk:11-jdk-hotspot</image>
+                    </from>
+                    <to>
+                        <image>apache/james</image>
+                        <tags>
+                            <tag>distributed-latest</tag>
+                        </tags>
+                    </to>
+                    <container>
+                        <mainClass>org.apache.james.CassandraRabbitMQJamesServerMain</mainClass>
+                        <ports>
+                            <port>80</port> <!-- JMAP -->
+                            <port>143</port> <!-- IMAP -->
+                            <port>993</port> <!-- IMAPS -->
+                            <port>25</port> <!-- SMTP -->
+                            <port>465</port> <!-- SMTP + STARTTLS -->
+                            <port>587</port> <!-- SMTPS -->
+                            <port>4000</port> <!-- GLOWROOT, if activated -->
+                            <port>8000</port> <!-- WEBADMIN -->
+                        </ports>
+                        <appRoot>/root</appRoot>
+                        <jvmFlags>
+                            <jvmFlag>-Dlogback.configurationFile=/root/conf/logback.xml</jvmFlag>
+                            <jvmFlag>-Dworking.directory=/root/</jvmFlag>
+                        </jvmFlags>
+                        <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+                        <volumes>
+                            <volume>/logs</volume>
+                            <volume>/root/conf</volume>
+                            <volume>/root/glowroot/plugins</volume>
+                            <volume>/root/glowroot/data</volume>
+                        </volumes>
+                    </container>
+                    <extraDirectories>
+                        <paths>
+                            <path>
+                                <from>sample-configuration</from>
+                                <into>/root/conf</into>
+                            </path>
+                            <path>
+                                <from>src/main/scripts</from>
+                                <into>/usr/bin</into>
+                            </path>
+                            <path>
+                                <from>target/glowroot</from>
+                                <into>/root</into>
+                            </path>
+                            <path>
+                                <from>src/main/extensions-jars</from>
+                                <into>/root/extensions-jars</into>
+                            </path>
+                        </paths>
+                        <permissions>
+                            <permission>
+                                <file>/usr/bin/james-cli</file>
+                                <mode>755</mode> <!-- Read/write/execute for owner, read/execute for group/other -->
+                            </permission>
+                        </permissions>
+                    </extraDirectories>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>buildTar</goal>
+                        </goals>
+                        <phase>package</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/extensions-jars/README.md b/server/container/guice/cassandra-rabbitmq-guice/src/main/extensions-jars/README.md
similarity index 74%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/extensions-jars/README.md
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/extensions-jars/README.md
index 2cea759..dab5c40 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/extensions-jars/README.md
+++ b/server/container/guice/cassandra-rabbitmq-guice/src/main/extensions-jars/README.md
@@ -2,4 +2,4 @@
 
 The jar in this folder will be added to JAMES classpath when mounted under /root/extensions-jars inside the running container.
 
-You can use it to add you customs Mailets/Matchers.
+You can use it to add your custom Mailets/Matchers.
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/admin.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/admin.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/admin.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/blobstore.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/blobstore.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/blobstore.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/blobstore.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/imap.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/imap.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/imap.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/imap.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/jmap.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/jmap.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/jmap.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/jmap.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/mailboxListener.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/mailboxListener.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/mailboxListener.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/mailboxListener.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/smtp.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/smtp.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/smtp.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/smtp.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/spooler.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/spooler.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/spooler.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/spooler.json
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/task.json b/server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/task.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/glowroot/plugins/task.json
rename to server/container/guice/cassandra-rabbitmq-guice/src/main/glowroot/plugins/task.json
diff --git a/server/container/guice/cassandra-rabbitmq-guice/src/main/scripts/james-cli b/server/container/guice/cassandra-rabbitmq-guice/src/main/scripts/james-cli
new file mode 100755
index 0000000..19a73b6
--- /dev/null
+++ b/server/container/guice/cassandra-rabbitmq-guice/src/main/scripts/james-cli
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java -cp /root/resources:/root/classes:/root/libs/* org.apache.james.cli.ServerCmd "$@"
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 03/11: JAMES-3261 Package the Cassandra server docker image with JIB

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4015b6d9c84891fe4f7fb61c47ae7bc2d89e6649
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 13:38:47 2021 +0700

    JAMES-3261 Package the Cassandra server docker image with JIB
---
 dockerfiles/run/guice/cassandra/Dockerfile         |  48 --------
 .../run/guice/cassandra/destination/run_james.sh   |   9 --
 server/container/guice/cassandra-guice/README.adoc |  43 ++++++-
 server/container/guice/cassandra-guice/pom.xml     | 123 +++++++++++++++++++++
 .../src/main}/extensions-jars/README.md            |   2 +-
 .../cassandra-guice/src/main}/glowroot/admin.json  |   0
 .../src/main}/glowroot/plugins/blobstore.json      |   0
 .../src/main}/glowroot/plugins/imap.json           |   0
 .../src/main}/glowroot/plugins/jmap.json           |   2 +-
 .../main}/glowroot/plugins/mailboxListener.json    |   0
 .../src/main}/glowroot/plugins/smtp.json           |   0
 .../src/main}/glowroot/plugins/spooler.json        |   4 +-
 .../src/main}/glowroot/plugins/task.json           |   0
 .../cassandra-guice/src/main/scripts/james-cli     |   3 +
 14 files changed, 172 insertions(+), 62 deletions(-)

diff --git a/dockerfiles/run/guice/cassandra/Dockerfile b/dockerfiles/run/guice/cassandra/Dockerfile
deleted file mode 100644
index c478642..0000000
--- a/dockerfiles/run/guice/cassandra/Dockerfile
+++ /dev/null
@@ -1,48 +0,0 @@
-# Run James
-#
-# VERSION	1.0
-
-FROM adoptopenjdk:11-jre-hotspot
-
-# Ports that are used
-#
-# 25   SMTP without authentication
-# 110  POP3
-# 143  IMAP with startTLS enabled
-# 465  SMTP with authentication and socketTLS enabled
-# 587  SMTP with authentication and startTLS enabled
-# 993  IMAP with socketTLS enabled
-# 8000 Web Admin interface (unsecured: expose at your own risks)
-
-EXPOSE 25 110 143 465 587 993 4000 8000
-
-WORKDIR /root
-RUN apt-get update && apt-get install -y unzip
-
-# Get data we need to run James : build results and configuration
-ADD destination/james-server-cassandra-guice.zip /root
-RUN unzip james-server-cassandra-guice.zip && \
-   cp -r /root/james-server-cassandra-guice/* /root && \
-   rm james-server-cassandra-guice.zip && \
-   rm -r james-server-cassandra-guice
-ADD destination/james-server-cli.jar /root/james-cli.jar
-ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/glowroot/plugins /root/glowroot/plugins
-ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
-ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
-ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
-ADD destination/glowroot/admin.json /root/glowroot/admin.json
-ADD destination/run_james.sh /root/run_james.sh
-
-# Data for ActiveMQ mailQueue
-VOLUME /root/var
-VOLUME /logs
-VOLUME /root/conf
-VOLUME /root/glowroot/plugins
-VOLUME /root/glowroot/data
-
-ENV PATH="$PATH:/root/glowroot/lib" \
-    JVM_OPTIONS="" \
-    GLOWROOT_ACTIVATED="false"
-
-ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/cassandra/destination/run_james.sh b/dockerfiles/run/guice/cassandra/destination/run_james.sh
deleted file mode 100755
index 301fd99..0000000
--- a/dockerfiles/run/guice/cassandra/destination/run_james.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
-    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
-fi
-
-java -Dworking.directory=. \
-  $GLOWROOT_OPTIONS \
-  $JVM_OPTIONS \
-  -Dlogback.configurationFile=conf/logback.xml -jar james-server-cassandra-guice.jar
\ No newline at end of file
diff --git a/server/container/guice/cassandra-guice/README.adoc b/server/container/guice/cassandra-guice/README.adoc
index c4530e3..840728c 100644
--- a/server/container/guice/cassandra-guice/README.adoc
+++ b/server/container/guice/cassandra-guice/README.adoc
@@ -46,4 +46,45 @@ Once everything is set up, you just have to run the jar with:
 $ java -Dworking.directory=. -Dlogback.configurationFile=conf/logback.xml -jar james-server-cassandra-guice.jar
 ----
 
-Note that binding ports below 1024 requires administrative rights.
\ No newline at end of file
+Note that binding ports below 1024 requires administrative rights.
+
+== Docker distribution
+
+To import the image locally:
+
+[source]
+----
+docker image load -i target/jib-image.tar
+----
+
+Then run it:
+
+[source]
+----
+docker run apache/james:cassandra-latest
+----
+
+Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
+to pass extra JVM flags. For instance:
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-Xmx500m -Xms500m" apache/james:cassandra-latest
+----
+
+[Glowroot APM](https://glowroot.org/) is packaged as part of the docker distribution to easily enable valuable performances insights.
+Disabled by default, its java agent can easily be enabled:
+
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-javaagent:/root/glowroot.jar" apache/james:cassandra-latest
+----
+
+The [CLI](https://james.apache.org/server/manage-cli.html) can easily be used:
+
+
+[source]
+----
+docker exec CONTAINER-ID james-cli ListDomains
+----
\ No newline at end of file
diff --git a/server/container/guice/cassandra-guice/pom.xml b/server/container/guice/cassandra-guice/pom.xml
index 23ae773..f3d7d4a 100644
--- a/server/container/guice/cassandra-guice/pom.xml
+++ b/server/container/guice/cassandra-guice/pom.xml
@@ -88,6 +88,11 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-cli</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-guice-cassandra</artifactId>
         </dependency>
         <dependency>
@@ -274,6 +279,124 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>com.googlecode.maven-download-plugin</groupId>
+                <artifactId>download-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>install-glowroot</id>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <url>https://github.com/glowroot/glowroot/releases/download/v0.13.4/glowroot-0.13.4-dist.zip</url>
+                            <unpack>true</unpack>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <md5>93d472281a67ab8404033a88280c23c9</md5>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-glowroot-resources</id>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/glowroot</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/glowroot</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.google.cloud.tools</groupId>
+                <artifactId>jib-maven-plugin</artifactId>
+                <configuration>
+                    <from>
+                        <image>adoptopenjdk:11-jdk-hotspot</image>
+                    </from>
+                    <to>
+                        <image>apache/james</image>
+                        <tags>
+                            <tag>cassandra-latest</tag>
+                        </tags>
+                    </to>
+                    <container>
+                        <mainClass>org.apache.james.CassandraJamesServerMain</mainClass>
+                        <ports>
+                            <port>80</port> <!-- JMAP -->
+                            <port>143</port> <!-- IMAP -->
+                            <port>993</port> <!-- IMAPS -->
+                            <port>25</port> <!-- SMTP -->
+                            <port>465</port> <!-- SMTP + STARTTLS -->
+                            <port>587</port> <!-- SMTPS -->
+                            <port>4000</port> <!-- GLOWROOT, if activated -->
+                            <port>8000</port> <!-- WEBADMIN -->
+                        </ports>
+                        <appRoot>/root</appRoot>
+                        <jvmFlags>
+                            <jvmFlag>-Dlogback.configurationFile=/root/conf/logback.xml</jvmFlag>
+                            <jvmFlag>-Dworking.directory=/root/</jvmFlag>
+                        </jvmFlags>
+                        <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+
+                        <volumes>
+                            <volume>/logs</volume>
+                            <volume>/root/conf</volume>
+                            <!-- Data for ActiveMQ mailQueue -->
+                            <volume>/root/var</volume>
+                            <volume>/root/glowroot/plugins</volume>
+                            <volume>/root/glowroot/data</volume>
+                        </volumes>
+                    </container>
+                    <extraDirectories>
+                        <paths>
+                            <path>
+                                <from>sample-configuration</from>
+                                <into>/root/conf</into>
+                            </path>
+                            <path>
+                                <from>src/main/scripts</from>
+                                <into>/usr/bin</into>
+                            </path>
+                            <path>
+                                <from>target/glowroot</from>
+                                <into>/root</into>
+                            </path>
+                            <path>
+                                <from>src/main/extensions-jars</from>
+                                <into>/root/extensions-jars</into>
+                            </path>
+                        </paths>
+                        <permissions>
+                            <permission>
+                                <file>/usr/bin/james-cli</file>
+                                <mode>755</mode> <!-- Read/write/execute for owner, read/execute for group/other -->
+                            </permission>
+                        </permissions>
+                    </extraDirectories>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>buildTar</goal>
+                        </goals>
+                        <phase>package</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
diff --git a/dockerfiles/run/guice/cassandra/destination/extensions-jars/README.md b/server/container/guice/cassandra-guice/src/main/extensions-jars/README.md
similarity index 74%
rename from dockerfiles/run/guice/cassandra/destination/extensions-jars/README.md
rename to server/container/guice/cassandra-guice/src/main/extensions-jars/README.md
index 2cea759..dab5c40 100644
--- a/dockerfiles/run/guice/cassandra/destination/extensions-jars/README.md
+++ b/server/container/guice/cassandra-guice/src/main/extensions-jars/README.md
@@ -2,4 +2,4 @@
 
 The jar in this folder will be added to JAMES classpath when mounted under /root/extensions-jars inside the running container.
 
-You can use it to add you customs Mailets/Matchers.
+You can use it to add your custom Mailets/Matchers.
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/admin.json b/server/container/guice/cassandra-guice/src/main/glowroot/admin.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/admin.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/admin.json
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/blobstore.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/blobstore.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/blobstore.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/blobstore.json
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/imap.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/imap.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/imap.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/imap.json
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/jmap.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/jmap.json
similarity index 88%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/jmap.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/jmap.json
index 9afce4b..b5a0ea1 100644
--- a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/jmap.json
+++ b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/jmap.json
@@ -11,7 +11,7 @@
       "captureKind": "transaction",
       "transactionType": "JMAP",
       "transactionNameTemplate": "JMAP method : {{this.class.name}}",
-      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "alreadyInTransactionBehavior": "capture-new-transaction",
       "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
       "timerName": "jmapMethod"
     }
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/mailboxListener.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/mailboxListener.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/mailboxListener.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/mailboxListener.json
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/smtp.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/smtp.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/smtp.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/smtp.json
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/spooler.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/spooler.json
similarity index 91%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/spooler.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/spooler.json
index fd7732d..5937ca5 100644
--- a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/spooler.json
+++ b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/spooler.json
@@ -24,7 +24,7 @@
       "captureKind": "transaction",
       "transactionType": "Mailet",
       "transactionNameTemplate": "Mailet : {{this.class.name}}",
-      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "alreadyInTransactionBehavior": "capture-new-transaction",
       "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
       "timerName": "mailet"
     },
@@ -37,7 +37,7 @@
       "captureKind": "transaction",
       "transactionType": "Matcher",
       "transactionNameTemplate": "Mailet processor : {{this.class.name}}",
-      "alreadyInTransactionBehavior": "capture-trace-entry",
+      "alreadyInTransactionBehavior": "capture-new-transaction",
       "traceEntryMessageTemplate": "{{this.class.name}}.{{methodName}}",
       "timerName": "matcher"
     }
diff --git a/dockerfiles/run/guice/cassandra/destination/glowroot/plugins/task.json b/server/container/guice/cassandra-guice/src/main/glowroot/plugins/task.json
similarity index 100%
rename from dockerfiles/run/guice/cassandra/destination/glowroot/plugins/task.json
rename to server/container/guice/cassandra-guice/src/main/glowroot/plugins/task.json
diff --git a/server/container/guice/cassandra-guice/src/main/scripts/james-cli b/server/container/guice/cassandra-guice/src/main/scripts/james-cli
new file mode 100755
index 0000000..19a73b6
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/main/scripts/james-cli
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java -cp /root/resources:/root/classes:/root/libs/* org.apache.james.cli.ServerCmd "$@"
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 01/11: JAMES-3261 Expose volumes for the memory image with JIB

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 00025866dc9dbccc694d2c26f33dbee2bd59196a
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:01:57 2021 +0700

    JAMES-3261 Expose volumes for the memory image with JIB
---
 server/container/guice/memory-guice/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server/container/guice/memory-guice/pom.xml b/server/container/guice/memory-guice/pom.xml
index 0f55647..85bfcdf 100644
--- a/server/container/guice/memory-guice/pom.xml
+++ b/server/container/guice/memory-guice/pom.xml
@@ -318,6 +318,12 @@
                             <jvmFlag>-Dworking.directory=/root/</jvmFlag>
                         </jvmFlags>
                         <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+                        <volumes>
+                            <volume>/logs</volume>
+                            <volume>/root/conf</volume>
+                            <volume>/root/glowroot/plugins</volume>
+                            <volume>/root/glowroot/data</volume>
+                        </volumes>
                     </container>
                     <extraDirectories>
                         <paths>

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 06/11: JAMES-3261 Indicate in READMEs how to set up custom keystore

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ba66d12ed9647e5a442a48877807ae4d709f8f64
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:17:58 2021 +0700

    JAMES-3261 Indicate in READMEs how to set up custom keystore
---
 server/container/guice/cassandra-guice/README.adoc          | 8 ++++++++
 server/container/guice/cassandra-rabbitmq-guice/README.adoc | 8 ++++++++
 server/container/guice/jpa-guice/README.adoc                | 8 ++++++++
 server/container/guice/jpa-smtp/README.adoc                 | 9 +++++++++
 server/container/guice/memory-guice/README.md               | 8 ++++++++
 5 files changed, 41 insertions(+)

diff --git a/server/container/guice/cassandra-guice/README.adoc b/server/container/guice/cassandra-guice/README.adoc
index 840728c..24d6ec9 100644
--- a/server/container/guice/cassandra-guice/README.adoc
+++ b/server/container/guice/cassandra-guice/README.adoc
@@ -64,6 +64,14 @@ Then run it:
 docker run apache/james:cassandra-latest
 ----
 
+For security reasons you are required to generate your own keystore, that you can mount into the container via a volume:
+
+[source]
+----
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+docker run -v $PWD/keystore:/root/conf/keystore docker run apache/james:cassandra-latest
+----
+
 Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
 to pass extra JVM flags. For instance:
 
diff --git a/server/container/guice/cassandra-rabbitmq-guice/README.adoc b/server/container/guice/cassandra-rabbitmq-guice/README.adoc
index 982334e..8c4905e 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/README.adoc
+++ b/server/container/guice/cassandra-rabbitmq-guice/README.adoc
@@ -61,6 +61,14 @@ Then run it:
 docker run apache/james:distributed-latest
 ----
 
+For security reasons you are required to generate your own keystore, that you can mount into the container via a volume:
+
+[source]
+----
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+docker run -v $PWD/keystore:/root/conf/keystore docker run apache/james:distributed-latest
+----
+
 Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
 to pass extra JVM flags. For instance:
 
diff --git a/server/container/guice/jpa-guice/README.adoc b/server/container/guice/jpa-guice/README.adoc
index 5f9b170..ed72deb 100644
--- a/server/container/guice/jpa-guice/README.adoc
+++ b/server/container/guice/jpa-guice/README.adoc
@@ -54,6 +54,14 @@ to pass extra JVM flags. For instance:
 docker run -e "JAVA_TOOL_OPTIONS=-Xmx500m -Xms500m" apache/james:jpa-latest
 ----
 
+For security reasons you are required to generate your own keystore, that you can mount into the container via a volume:
+
+[source]
+----
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+docker run -v $PWD/keystore:/root/conf/keystore docker run apache/james:jpa-latest
+----
+
 [Glowroot APM](https://glowroot.org/) is packaged as part of the docker distribution to easily enable valuable performances insights.
 Disabled by default, its java agent can easily be enabled:
 
diff --git a/server/container/guice/jpa-smtp/README.adoc b/server/container/guice/jpa-smtp/README.adoc
index c3bc6d5..f950870 100644
--- a/server/container/guice/jpa-smtp/README.adoc
+++ b/server/container/guice/jpa-smtp/README.adoc
@@ -48,6 +48,15 @@ Then run it:
 docker run apache/james:jpa-smtp-latest
 ----
 
+
+For security reasons you are required to generate your own keystore, that you can mount into the container via a volume:
+
+[source]
+----
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+docker run -v $PWD/keystore:/root/conf/keystore docker run apache/james:jpa-smtp-latest
+----
+
 Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
 to pass extra JVM flags. For instance:
 
diff --git a/server/container/guice/memory-guice/README.md b/server/container/guice/memory-guice/README.md
index 78c6534..91e48db 100644
--- a/server/container/guice/memory-guice/README.md
+++ b/server/container/guice/memory-guice/README.md
@@ -24,6 +24,14 @@ Then run it:
 docker run apache/james:memory-latest
 ```
 
+
+For security reasons you are required to generate your own keystore, that you can mount into the container via a volume:
+
+```
+keytool -genkey -alias james -keyalg RSA -keystore keystore
+docker run -v $PWD/keystore:/root/conf/keystore docker run apache/james:cassandra-latest
+```
+
 Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags) 
 to pass extra JVM flags. For instance:
 

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 04/11: JAMES-3261 Package the JPA server docker image with JIB

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1180ca66484ff3d3555b08408eb7a7661aeda7b2
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 13:52:57 2021 +0700

    JAMES-3261 Package the JPA server docker image with JIB
---
 dockerfiles/run/guice/jpa/Dockerfile               |  50 ---------
 dockerfiles/run/guice/jpa/destination/run_james.sh |  10 --
 server/container/guice/jpa-guice/README.adoc       |  43 +++++++-
 server/container/guice/jpa-guice/pom.xml           | 114 +++++++++++++++++++++
 .../jpa-guice/src/main}/extensions-jars/README.md  |   2 +-
 .../guice/jpa-guice/src/main}/glowroot/admin.json  |   0
 .../jpa-guice/src/main}/glowroot/plugins/imap.json |   0
 .../jpa-guice/src/main}/glowroot/plugins/jmap.json |   0
 .../main}/glowroot/plugins/mailboxListener.json    |   0
 .../jpa-guice/src/main}/glowroot/plugins/smtp.json |   0
 .../src/main}/glowroot/plugins/spooler.json        |   0
 .../jpa-guice/src/main}/glowroot/plugins/task.json |   0
 .../guice/jpa-guice/src/main/scripts/james-cli     |   3 +
 13 files changed, 160 insertions(+), 62 deletions(-)

diff --git a/dockerfiles/run/guice/jpa/Dockerfile b/dockerfiles/run/guice/jpa/Dockerfile
deleted file mode 100644
index 32fe284..0000000
--- a/dockerfiles/run/guice/jpa/Dockerfile
+++ /dev/null
@@ -1,50 +0,0 @@
-# Run James
-#
-# VERSION	1.0
-
-FROM adoptopenjdk:11-jre-hotspot
-
-# Ports that are used
-#
-# 25   SMTP without authentication
-# 110  POP3
-# 143  IMAP with startTLS enabled
-# 465  SMTP with authentication and socketTLS enabled
-# 587  SMTP with authentication and startTLS enabled
-# 993  IMAP with socketTLS enabled
-# 8000 Web Admin interface (unsecured: expose at your own risks)
-
-EXPOSE 25 110 143 465 587 993 4000 8000
-
-WORKDIR /root
-RUN apt-get update && apt-get install -y unzip
-
-# Get data we need to run James : build results and configuration
-ADD destination/james-server-jpa-guice.zip /root
-RUN unzip james-server-jpa-guice.zip && \
-   cp -r /root/james-server-jpa-guice/* /root && \
-   rm james-server-jpa-guice.zip && \
-   rm -r james-server-jpa-guice
-ADD destination/james-server-cli.jar /root/james-cli.jar
-ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/glowroot/plugins /root/glowroot/plugins
-ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
-ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
-ADD destination/glowroot/lib/glowroot-logging-logstash.jar /root/glowroot/lib/glowroot-logging-logstash.jar
-ADD destination/glowroot/admin.json /root/glowroot/admin.json
-ADD destination/run_james.sh /root/run_james.sh
-
-VOLUME /logs
-VOLUME /root/conf
-VOLUME /root/glowroot/plugins
-VOLUME /root/glowroot/data
-# Data for ActiveMQ mailQueue
-VOLUME /root/var
-# Data for derby database
-VOLUME /var/store
-
-ENV PATH="$PATH:/root/glowroot/lib" \
-    JVM_OPTIONS="" \
-    GLOWROOT_ACTIVATED="false"
-
-ENTRYPOINT ./run_james.sh
diff --git a/dockerfiles/run/guice/jpa/destination/run_james.sh b/dockerfiles/run/guice/jpa/destination/run_james.sh
deleted file mode 100755
index ec4cc1a..0000000
--- a/dockerfiles/run/guice/jpa/destination/run_james.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
-    GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
-fi
-
-java -Dworking.directory=. \
-  $GLOWROOT_OPTIONS \
-  $JVM_OPTIONS \
-  -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-guice.jar
-
diff --git a/server/container/guice/jpa-guice/README.adoc b/server/container/guice/jpa-guice/README.adoc
index 091a607..5f9b170 100644
--- a/server/container/guice/jpa-guice/README.adoc
+++ b/server/container/guice/jpa-guice/README.adoc
@@ -28,4 +28,45 @@ Once everything is set up, you just have to run the jar with:
 $ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar -Dworking.directory=. -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-guice.jar
 ----
 
-Note that binding ports below 1024 requires administrative rights.
\ No newline at end of file
+Note that binding ports below 1024 requires administrative rights.
+
+== Docker distribution
+
+To import the image locally:
+
+[source]
+----
+docker image load -i target/jib-image.tar
+----
+
+Then run it:
+
+[source]
+----
+docker run apache/james:jpa-latest
+----
+
+Use the [JAVA_TOOL_OPTIONS environment option](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#jvm-flags)
+to pass extra JVM flags. For instance:
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-Xmx500m -Xms500m" apache/james:jpa-latest
+----
+
+[Glowroot APM](https://glowroot.org/) is packaged as part of the docker distribution to easily enable valuable performances insights.
+Disabled by default, its java agent can easily be enabled:
+
+
+[source]
+----
+docker run -e "JAVA_TOOL_OPTIONS=-javaagent:/root/glowroot.jar" apache/james:jpa-latest
+----
+
+The [CLI](https://james.apache.org/server/manage-cli.html) can easily be used:
+
+
+[source]
+----
+docker exec CONTAINER-ID james-cli ListDomains
+----
\ No newline at end of file
diff --git a/server/container/guice/jpa-guice/pom.xml b/server/container/guice/jpa-guice/pom.xml
index a1951f7..4a7f09f 100644
--- a/server/container/guice/jpa-guice/pom.xml
+++ b/server/container/guice/jpa-guice/pom.xml
@@ -59,6 +59,11 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-cli</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>james-server-data-jpa</artifactId>
         </dependency>
         <dependency>
@@ -206,6 +211,115 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>com.googlecode.maven-download-plugin</groupId>
+                <artifactId>download-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>install-glowroot</id>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <url>https://github.com/glowroot/glowroot/releases/download/v0.13.4/glowroot-0.13.4-dist.zip</url>
+                            <unpack>true</unpack>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                            <md5>93d472281a67ab8404033a88280c23c9</md5>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-glowroot-resources</id>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <phase>package</phase>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/glowroot</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/glowroot</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.google.cloud.tools</groupId>
+                <artifactId>jib-maven-plugin</artifactId>
+                <configuration>
+                    <from>
+                        <image>adoptopenjdk:11-jdk-hotspot</image>
+                    </from>
+                    <to>
+                        <image>apache/james</image>
+                        <tags>
+                            <tag>jpa-latest</tag>
+                        </tags>
+                    </to>
+                    <container>
+                        <mainClass>org.apache.james.JPAJamesServerMain</mainClass>
+                        <ports>
+                            <port>80</port> <!-- JMAP -->
+                            <port>143</port> <!-- IMAP -->
+                            <port>993</port> <!-- IMAPS -->
+                            <port>25</port> <!-- SMTP -->
+                            <port>465</port> <!-- SMTP + STARTTLS -->
+                            <port>587</port> <!-- SMTPS -->
+                            <port>4000</port> <!-- GLOWROOT, if activated -->
+                            <port>8000</port> <!-- WEBADMIN -->
+                        </ports>
+                        <appRoot>/root</appRoot>
+                        <jvmFlags>
+                            <jvmFlag>-Dlogback.configurationFile=/root/conf/logback.xml</jvmFlag>
+                            <jvmFlag>-Dworking.directory=/root/</jvmFlag>
+                        </jvmFlags>
+                        <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+                    </container>
+                    <extraDirectories>
+                        <paths>
+                            <path>
+                                <from>sample-configuration</from>
+                                <into>/root/conf</into>
+                            </path>
+                            <path>
+                                <from>src/main/scripts</from>
+                                <into>/usr/bin</into>
+                            </path>
+                            <path>
+                                <from>target/glowroot</from>
+                                <into>/root</into>
+                            </path>
+                            <path>
+                                <from>src/main/extensions-jars</from>
+                                <into>/root/extensions-jars</into>
+                            </path>
+                        </paths>
+                        <permissions>
+                            <permission>
+                                <file>/usr/bin/james-cli</file>
+                                <mode>755</mode> <!-- Read/write/execute for owner, read/execute for group/other -->
+                            </permission>
+                        </permissions>
+                    </extraDirectories>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>buildTar</goal>
+                        </goals>
+                        <phase>package</phase>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
diff --git a/dockerfiles/run/guice/jpa/destination/extensions-jars/README.md b/server/container/guice/jpa-guice/src/main/extensions-jars/README.md
similarity index 74%
rename from dockerfiles/run/guice/jpa/destination/extensions-jars/README.md
rename to server/container/guice/jpa-guice/src/main/extensions-jars/README.md
index 2cea759..dab5c40 100644
--- a/dockerfiles/run/guice/jpa/destination/extensions-jars/README.md
+++ b/server/container/guice/jpa-guice/src/main/extensions-jars/README.md
@@ -2,4 +2,4 @@
 
 The jar in this folder will be added to JAMES classpath when mounted under /root/extensions-jars inside the running container.
 
-You can use it to add you customs Mailets/Matchers.
+You can use it to add your custom Mailets/Matchers.
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/admin.json b/server/container/guice/jpa-guice/src/main/glowroot/admin.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/admin.json
rename to server/container/guice/jpa-guice/src/main/glowroot/admin.json
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/imap.json b/server/container/guice/jpa-guice/src/main/glowroot/plugins/imap.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/plugins/imap.json
rename to server/container/guice/jpa-guice/src/main/glowroot/plugins/imap.json
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/jmap.json b/server/container/guice/jpa-guice/src/main/glowroot/plugins/jmap.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/plugins/jmap.json
rename to server/container/guice/jpa-guice/src/main/glowroot/plugins/jmap.json
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/mailboxListener.json b/server/container/guice/jpa-guice/src/main/glowroot/plugins/mailboxListener.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/plugins/mailboxListener.json
rename to server/container/guice/jpa-guice/src/main/glowroot/plugins/mailboxListener.json
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/smtp.json b/server/container/guice/jpa-guice/src/main/glowroot/plugins/smtp.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/plugins/smtp.json
rename to server/container/guice/jpa-guice/src/main/glowroot/plugins/smtp.json
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/spooler.json b/server/container/guice/jpa-guice/src/main/glowroot/plugins/spooler.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/plugins/spooler.json
rename to server/container/guice/jpa-guice/src/main/glowroot/plugins/spooler.json
diff --git a/dockerfiles/run/guice/jpa/destination/glowroot/plugins/task.json b/server/container/guice/jpa-guice/src/main/glowroot/plugins/task.json
similarity index 100%
rename from dockerfiles/run/guice/jpa/destination/glowroot/plugins/task.json
rename to server/container/guice/jpa-guice/src/main/glowroot/plugins/task.json
diff --git a/server/container/guice/jpa-guice/src/main/scripts/james-cli b/server/container/guice/jpa-guice/src/main/scripts/james-cli
new file mode 100755
index 0000000..19a73b6
--- /dev/null
+++ b/server/container/guice/jpa-guice/src/main/scripts/james-cli
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java -cp /root/resources:/root/classes:/root/libs/* org.apache.james.cli.ServerCmd "$@"
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 09/11: JAMES-3261 Useful commands: use embedded cli script for embedded images

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a402635008f6859f5fd717a9d659efd8084a1713
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:29:04 2021 +0700

    JAMES-3261 Useful commands: use embedded cli script for embedded images
---
 README.adoc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/README.adoc b/README.adoc
index 1de2bee..f69b533 100644
--- a/README.adoc
+++ b/README.adoc
@@ -185,12 +185,11 @@ To run this container :
 
 Where HOSTNAME is the hostname you want to give to your James container. This DNS entry will be used to send mail to your James server.
 
-
 == Other Useful commands
 
 The base command is different whether you choose guice flavor or spring :
 
-  * guice use : `docker exec james_run java -jar /root/james-cli.jar`
+  * guice use : `docker exec james_run java james-cli`
   * spring use : `docker exec james_run /root/james-server-app-3.0.0-beta6-SNAPSHOT/bin/james-cli.sh`
 
 See https://james.apache.org/server/manage-cli.html[Manage James via the Command Line] for more info.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[james-project] 08/11: JAMES-3261 Link projects specific READMEs within the main README.

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit dd030ff8047fe14f8e4c21b9463c31f3bc5e136c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat May 29 14:28:11 2021 +0700

    JAMES-3261 Link projects specific READMEs within the main README.
    
    This reduces noise.
---
 README.adoc | 176 ++----------------------------------------------------------
 1 file changed, 4 insertions(+), 172 deletions(-)

diff --git a/README.adoc b/README.adoc
index 9e4baf6..1de2bee 100644
--- a/README.adoc
+++ b/README.adoc
@@ -144,180 +144,12 @@ If you are using a a fresh installation of Docker, your DOCKER_HOST should be un
 
 This feature is available for three configurations :
 
- * link:#run-james-with-guice-%2Dcassandra-%2Drabbitmq-%2Ds3-%2Delasticsearch[Guice + Cassandra + RabbitMQ + S3 + ElasticSearch]
- * link:#run-james-with-guice-%2Dcassandra-%2Delasticsearch[Guice + Cassandra + ElasticSearch]
- * link:#run-james-with-guice-%2Djpa-%2Dlucene[Guice + JPA + Lucene]
+ * link:https://github.com/apache/james-project/blob/master/server/container/guice/cassandra-rabbitmq-guice/README.adoc[Guice + Cassandra + RabbitMQ + S3 + ElasticSearch (distributed)]
+ * link:https://github.com/apache/james-project/blob/master/server/container/guice/cassandra-guice/README.adoc[Guice + Cassandra + ElasticSearch]
+ * link:https://github.com/apache/james-project/blob/master/server/container/guice/jpa-guice/README.adoc[Guice + JPA + Lucene]
+ * link:https://github.com/apache/james-project/blob/master/server/container/guice/memory-guice/README.adoc[Guice + Memory (testing)]
  * link:#run-james-with-spring-%2Djpa[Spring + JPA]
 
-
-=== Run James with Guice + Cassandra + RabbitMQ + S3 + ElasticSearch
-
-
-==== Requirements
-Built artifacts should be in ./dockerfiles/run/guice/cassandra-rabbitmq/destination folder for cassandra.
-If you haven't already:
-
-    $ docker build -t james/project dockerfiles/compilation/java-11
-    $ docker run -v $HOME/.m2:/root/.m2 -v $PWD:/origin \
-  -v $PWD/dockerfiles/run/guice/cassandra-rabbitmq/destination:/cassandra-rabbitmq/destination \
-  -t james/project -s HEAD
-
-
-==== How to ?
-You need a running *cassandra* in docker. To achieve this run:
-
-    $ docker run -d --name=cassandra cassandra:3.11.10
-
-You need a running *rabbitmq* in docker. To achieve this run:
-
-    $ docker run -d --name=rabbitmq rabbitmq:3.8.1-management
-
-You need a running *s3* compatible objectstorage in docker. To achieve this run:
-
-    $ docker run -d --env 'REMOTE_MANAGEMENT_DISABLE=1' --env 'SCALITY_ACCESS_KEY_ID=accessKey1' --env 'SCALITY_SECRET_ACCESS_KEY=secretKey1' --name=s3 zenko/cloudserver:8.2.6
-
-You need a running *ElasticSearch* in docker. To achieve this run:
-
-    $ docker run -d --name=elasticsearch --env 'discovery.type=single-node' docker.elastic.co/elasticsearch/elasticsearch:7.10.2
-
-If you want to handle attachment text extraction before indexing in ElasticSearch (this makes attachments searchable)
-and if you want to use all the JMAP search capabilities, you also need to start *Tika*.
-See http://james.apache.org/server/config-elasticsearch.html#Tika_Configuration[Tika configuration documentation] for more info.
-
-    $ docker run -d --name=tika apache/tika:1.26
-
-We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.
-
-Copy your TLS keys to `run/guice/cassandra-rabbitmq/destination/conf/keystore` or generate it using the following command. The password must be `james72laBalle` to match default configuration.
-
-    $ keytool -genkey -alias james -keyalg RSA -keystore dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/keystore
-
-Then we need to build james container :
-
-    $ docker build -t james_run dockerfiles/run/guice/cassandra-rabbitmq
-
-To run this container :
-
-    $ docker run --hostname HOSTNAME -p "25:25" -p 80:80 -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" -p "127.0.0.1:8000:8000" --link cassandra:cassandra --link rabbitmq:rabbitmq
-   --link elasticsearch:elasticsearch --link tika:tika --link s3:s3.docker.test --name james_run -t james_run
-
-Where :
-
-- HOSTNAME is the hostname you want to give to your James container. This DNS entry will be used to send mail to your James server.
-- link to tika is only needed if you started tika earlier.
-
-Webadmin port binding is restricted to loopback as users are not authenticated by default on webadmin server. Thus you should avoid exposing it in production.
-Note that the above example assumes `127.0.0.1` is your loopback interface for convenience but you should change it if this is not the case on your machine.
-
-If you want to pass additional options to the underlying java command, you can configure a _JVM_OPTIONS_ env variable, for example add:
-
-    --env JVM_OPTIONS="-Xms256m -Xmx2048m"
-
-To have log file accessible on a volume, add *-v  $PWD/logs:/logs* option to the above command line, where *$PWD/logs* is your local directory to put files in.
-
-==== Instrumentation
-You can use Glowroot to instrumentalize James. The provided guice docker files allow a simple way to do it.
-In order to activate Glowroot you need to run the container with the environment variable _GLOWROOT_ACTIVATED_ set to _true_
-and to expose the glowroot instrumentation ui port.
-
-    --env GLOWROOT_ACTIVATED=true -p "4000:4000"
-
-By default, the Glowroot UI is accessible from every machines in the network as defined in the _destination/admin.json_.
-Which you could configure before building the image, if you want to restrict its accessibility to localhost for example.
-See the https://github.com/glowroot/glowroot/wiki/Agent-Installation-(with-Embedded-Collector)#user-content-optional-post-installation-steps[Glowroot post installation steps]  for more details.
-
-Or by mapping the 4000 port to the IP of the desired network interface, for example `-p 127.0.0.1:4000:4000`.
-
-
-
-=== Run James with Guice + Cassandra + ElasticSearch
-
-
-==== Requirements
-Built artifacts should be in ./dockerfiles/run/guice/cassandra/destination folder for cassandra.
-If you haven't already:
-
-    $ docker build -t james/project dockerfiles/compilation/java-11
-    $ docker run -v $HOME/.m2:/root/.m2 -v $PWD:/origin \
-  -v $PWD/dockerfiles/run/guice/cassandra/destination:/cassandra/destination \
-  -t james/project -s HEAD
-
-
-==== How to ?
-You need a running *cassandra* in docker. To achieve this run:
-
-    $ docker run -d --name=cassandra cassandra:3.11.10
-
-You need a running *ElasticSearch* in docker. To achieve this run:
-
-    $ docker run -d --name=elasticsearch --env 'discovery.type=single-node' docker.elastic.co/elasticsearch/elasticsearch:7.10.2
-
-If you want to handle attachment text extraction before indexing in ElasticSearch (this makes attachments searchable)
-and if you want to use all the JMAP search capabilities, you also need to start *Tika*.
-See http://james.apache.org/server/config-elasticsearch.html#Tika_Configuration[Tika configuration documentation] for more info.
-
-    $ docker run -d --name=tika apache/tika:1.24
-
-We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.
-
-Copy your TLS keys to `run/guice/cassandra/destination/conf/keystore` or generate it using the following command. The password must be `james72laBalle` to match default configuration.
-
-    $ keytool -genkey -alias james -keyalg RSA -keystore dockerfiles/run/guice/cassandra/destination/conf/keystore
-
-Then we need to build james container :
-
-    $ docker build -t james_run dockerfiles/run/guice/cassandra
-
-To run this container :
-
-    $ docker run --hostname HOSTNAME -p "25:25" -p 80:80 -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" -p "127.0.0.1:8000:8000" --link cassandra:cassandra --link elasticsearch:elasticsearch --link tika:tika --name james_run -t james_run
-
-Where :
-
-- HOSTNAME is the hostname you want to give to your James container. This DNS entry will be used to send mail to your James server.
-- link to tika is only needed if you started tika earlier.
-
-Webadmin port binding is restricted to loopback as users are not authenticated by default on webadmin server. Thus you should avoid exposing it in production.
-Note that the above example assumes `127.0.0.1` is your loopback interface for convenience but you should change it if this is not the case on your machine.
-
-To have log file accessible on a volume, add *-v  $PWD/logs:/logs* option to the above command line, where *$PWD/logs* is your local directory to put files in.
-
-=== Run James with Guice + JPA + Lucene
-
-==== Requirements
-Built artifacts should be in ./dockerfiles/run/guice/jpa/destination folder for jpa.
-If you haven't already:
-
-    $ docker build -t james/project dockerfiles/compilation/java-11
-    $ docker run -v $HOME/.m2:/root/.m2 -v $PWD:/origin \
-  -v $PWD/dockerfiles/run/guice/jpa/destination:/jpa/destination \
-  -t james/project -s HEAD
-
-
-==== How to ?
-We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.
-
-Copy your TLS keys to `run/guice/jpa/destination/conf/keystore` or generate it using the following command. The password must be `james72laBalle` to match default configuration.
-
-    $ keytool -genkey -alias james -keyalg RSA -keystore dockerfiles/run/guice/jpa/destination/conf/keystore
-
-
-Then we need to build james container :
-
-    $ docker build -t james_run dockerfiles/run/guice/jpa
-
-To run this container :
-
-    $ docker run --hostname HOSTNAME -p "25:25" -p 80:80 -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" -p "127.0.0.1:8000:8000" --name james_run -t james_run
-
-HOSTNAME is the hostname you want to give to your James container. This DNS entry will be used to send mail to your James server.
-
-Webadmin port binding is restricted to loopback as users are not authenticated by default on webadmin server. Thus you should avoid exposing it in production.
-Note that the above example assumes `127.0.0.1` is your loopback interface for convenience but you should change it if this is not the case on your machine.
-
-To have log file accessible on a volume, add *-v  $PWD/logs:/logs* option to the above command line, where *$PWD/logs* is your local directory to put files in.
-
-
 === Run James with Spring + JPA
 
 ==== Requirements

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org