Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
36018ed
JAMES-1626 Update maven-bundle-plugin to 2.4.0
mbaechler Oct 22, 2015
8b69508
JAMES-1626 Use javax.inject in Cassandra mailbox
mbaechler Oct 22, 2015
95948fb
JAMES-1626 Use javax.inject in ElasticSearch mailbox
mbaechler Oct 22, 2015
cd54d8a
JAMES-1626 All ProtocolHandler should be lifeCycle aware
chibenwa Sep 3, 2015
b8d7ec8
JAMES-1626 cleanup injection annotations to conform to javax.inject u…
mbaechler Oct 22, 2015
dab20ac
JAMES-1626 cassandra-guice project creation
chibenwa Aug 27, 2015
8c55733
JAMES-1626 bootstrap guice-based application with Cassandra IMAP server
chibenwa Aug 27, 2015
81279a6
JAMES-1626 ConfigurationPerformer will take care of push configuratio…
mbaechler Oct 21, 2015
88c9347
JAMES-1626 Use Onami for lifecycle management (JSR 250 @PreDestroy @P…
chibenwa Aug 24, 2015
4f62953
JAMES-1626 Add ElasticSearch support to cassandra-guice application
chibenwa Aug 17, 2015
d62e249
JAMES-1626 Add ActiveMQ support to cassandra-guice application
chibenwa Aug 18, 2015
671bf2a
JAMES-1626 Implement an HierarchicalConfiguration reader for guice use
chibenwa Aug 27, 2015
2b1e16f
JAMES-1626 support IMAP, SMTP, POP and LMTP protocols in cassandra-gu…
mbaechler Oct 22, 2015
91caf38
JAMES-1626 Implement a guice MailboxManagerResolver
chibenwa Aug 31, 2015
8fd3700
JAMES-1626 Add JMX support to cassandra-guice application
chibenwa Aug 25, 2015
4170732
JAMES-1626 Implement an InMemory MailRepository
chibenwa Aug 27, 2015
57ddc66
JAMES-1626 Add mailet support in cassandra-guice module
chibenwa Aug 27, 2015
fdfbb82
JAMES-1626 Add DNSService support in cassandra-guice application
chibenwa Sep 2, 2015
d04ba06
JAMES-1626 Add interface ConfigurationProvider to allow multiple impl…
mbaechler Sep 11, 2015
cc70056
JAMES-1626 Implement a packaging policy for the cassandra-guice appli…
mbaechler Sep 11, 2015
16d8202
JAMES-1626 use Filesystem to resolve configuration properties files
mbaechler Sep 11, 2015
0ad4453
JAMES-1626 Fix a typo on the site in the server index file
aduprat Sep 9, 2015
6d2364f
JAMES-1626 Add configuration documentation
aduprat Sep 10, 2015
7fe035c
JAMES-1626 sample configuration and readme
mbaechler Sep 15, 2015
7fc1d15
JAMES-1626 use FileSystem to find configuration files
mbaechler Oct 22, 2015
6fe829d
JAMES-1626 move everything needed to run spring james under dockerfil…
mbaechler Oct 28, 2015
4f9277f
JAMES-1626 bundle cli into a runnable jar
mbaechler Oct 28, 2015
cc2c320
JAMES-1626 cassandra-guice docker support
mbaechler Oct 28, 2015
e352f77
fixup! JAMES-1626 Implement an HierarchicalConfiguration reader for g…
mbaechler Nov 3, 2015
70372f9
fixup! JAMES-1626 Implement an HierarchicalConfiguration reader for g…
mbaechler Nov 3, 2015
694292c
fixup! JAMES-1626 bootstrap guice-based application with Cassandra IM…
mbaechler Nov 3, 2015
b73fdd6
fixup! JAMES-1626 sample configuration and readme
mbaechler Nov 3, 2015
3012e2e
fixup! JAMES-1626 Use javax.inject in Cassandra mailbox
mbaechler Nov 3, 2015
794b982
fixup! JAMES-1626 support IMAP, SMTP, POP and LMTP protocols in cassa…
mbaechler Nov 3, 2015
4d9f37a
fixup! JAMES-1626 Add JMX support to cassandra-guice application
mbaechler Nov 3, 2015
e3ff938
fixup! JAMES-1626 cassandra-guice project creation
mbaechler Nov 3, 2015
1065203
fixup! JAMES-1626 bootstrap guice-based application with Cassandra IM…
mbaechler Nov 3, 2015
ff9aa86
fixup! JAMES-1626 Add configuration documentation
mbaechler Nov 3, 2015
7ec6d77
fixup! JAMES-1626 Add configuration documentation
mbaechler Nov 3, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,29 @@ First step, you have to build the Docker image
$ docker build -t james/project dockerfiles/compilation/java-6

In order to run the build, you have to launch the following command:
$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/destination:/destination -t james/project -s SHA1
$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/run/spring/destination:/destination -t james/project -s SHA1

Where:

- $PWD/.m2:/root/.m2: is the first volume used to share the maven repository,
as we don't want to download all dependencies on each build
- $PWD/dockerfiles/destination:/destination: is the third volume used to get the compiled elements,
- $PWD/dockerfiles/run/spring/destination:/destination: is the third volume used to get the compiled elements,
as it is needed by the container that will run James.
- SHA1 (optional): is the given git SHA1 of the james-project repository to build or trunk if none.
- -s option: given tests will not be played while building. Not specifying means play tests.


* Java 8
First step, you have to build the Docker image
$ docker build -t james/project dockerfiles/compilation/java-8

In order to run the build, you have to launch the following command:
$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/destination:/destination -t james/project -s SHA1
$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/run/spring/destination:/destination -t james/project -s SHA1

Where:

- $PWD/.m2:/root/.m2: is the first volume used to share the maven repository,
as we don't want to download all dependencies on each build
- $PWD/dockerfiles/destination:/destination: is the third volume used to get the compiled elements,
- $PWD/dockerfiles/run/spring/destination:/destination: is the third volume used to get the compiled elements,
as it is needed by the container that will run James.
- SHA1 (optional): is the given git SHA1 of the james-project repository to build or trunk if none.
- -s option: given tests will not be played while building. Not specifying means play tests.
Expand All @@ -92,7 +91,7 @@ This feature is only available for Java 8 / Cassandra mailbox backend yet.


* Requirements
You should have the zip resulting of the build in the ./dockerfiles/destination folder.
You should have the zip resulting of the build in the ./dockerfiles/run/spring/destination folder.


* Howto ?
Expand All @@ -104,11 +103,11 @@ $ docker run -d --name=elasticsearch elasticsearch:1.5.2

We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.

Copy your TSL keys to 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/destination/conf/keystore
Copy your TSL keys to destination/run/spring/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/spring/destination/conf/keystore

Then we need to build james container :
$ docker build -t james_run dockerfiles
$ docker build -t james_run dockerfiles/run/spring/

To run this container :
$ docker run --hostname HOSTNAME -p "25:25" -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" --link cassandra:cassandra --link elasticsearch:elasticsearch --name james_run -t james_run
Expand Down Expand Up @@ -160,6 +159,16 @@ Where :
Beware : you will have concurrency issues if multiple containers are running on this single volume.


How to run James in Docker using guice container
================================================

You have to follow above documentation and replace spring by guice in paths.

Once you run the container, you have to use the following command to launch the cli :

$ docker exec james_run java -jar /root/james-cli.jar -h localhost <command>


Running deployement Tests
=========================

Expand Down
4 changes: 4 additions & 0 deletions backends-common/cassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

import java.util.Optional;

import javax.inject.Inject;

import com.datastax.driver.core.Session;
import com.datastax.driver.core.UserType;
import com.google.common.collect.ImmutableMap;
Expand All @@ -31,6 +33,7 @@
public class CassandraTypesProvider {
private final ImmutableMap<String, UserType> userTypes;

@Inject
public CassandraTypesProvider(CassandraModule module, Session session) {
userTypes = module.moduleTypes()
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ public void clearAllTables() {

private Optional<Session> tryInitializeSession() {
try {
Cluster cluster = ClusterFactory.createClusterForSingleServerWithoutPassWord(CLUSTER_IP, CLUSTER_PORT_TEST);
Cluster clusterWithInitializedKeyspace = ClusterWithKeyspaceCreatedFactory
.clusterWithInitializedKeyspace(cluster, KEYSPACE_NAME, REPLICATION_FACTOR);
.clusterWithInitializedKeyspace(getCluster(), KEYSPACE_NAME, REPLICATION_FACTOR);
return Optional.of(new SessionWithInitializedTablesFactory(module).createSession(clusterWithInitializedKeyspace, KEYSPACE_NAME));
} catch (NoHostAvailableException exception) {
sleep(SLEEP_BEFORE_RETRY);
return Optional.empty();
}
}

public Cluster getCluster() {
return ClusterFactory.createClusterForSingleServerWithoutPassWord(CLUSTER_IP, CLUSTER_PORT_TEST);
}

private void sleep(long sleepMs) {
try {
Thread.sleep(sleepMs);
Expand Down
5 changes: 5 additions & 0 deletions backends-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
<artifactId>guava</artifactId>
<version>16.0</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions dockerfiles/compilation/java-8/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ fi

if [ $? -eq 0 ]; then
cp server/app/target/james-server-app-*-app.zip $DESTINATION
cp server/container/cassandra-guice/target/james-server-cassandra-guice-*-SNAPSHOT.jar $DESTINATION
cp -r server/container/cassandra-guice/target/james-server-cassandra-guice-*-SNAPSHOT.lib $DESTINATION
cp server/container/cli/target/james-server-cli-*.jar $DESTINATION
cp -r server/container/cli/target/james-server-cli-*.lib $DESTINATION
fi
27 changes: 27 additions & 0 deletions dockerfiles/run/guice/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Run James
#
# VERSION 1.0

FROM java:openjdk-8-jdk

# 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

EXPOSE 25 110 143 465 587 993

WORKDIR /root

# Get data we need to run James : build results and configuration
ADD destination/james-server-cassandra-guice-*.jar /root/james-server.jar
ADD destination/james-server-cassandra-guice-3.0.0-beta5-SNAPSHOT.lib /root/james-server-cassandra-guice-3.0.0-beta5-SNAPSHOT.lib
ADD destination/james-server-cli-3.0.0-beta5-SNAPSHOT.jar /root/james-cli.jar
ADD destination/james-server-cli-3.0.0-beta5-SNAPSHOT.lib /root/james-server-cli-3.0.0-beta5-SNAPSHOT.lib
ADD destination/conf /root/conf

ENTRYPOINT java -Dworking.directory=/root/ -jar james-server.jar
28 changes: 28 additions & 0 deletions dockerfiles/run/guice/destination/conf/domainlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
<domainnames>
<domainname>james.linagora.com</domainname>
</domainnames>
<autodetect>true</autodetect>
<autodetectIP>true</autodetectIP>
<defaultDomain>localhost</defaultDomain>
</domainlist>
26 changes: 26 additions & 0 deletions dockerfiles/run/guice/destination/conf/elasticsearch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# This template file can be used as example for James Server configuration
# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS

# Configuration file for ElasticSearch

elasticsearch.masterHost=elasticsearch
elasticsearch.port=9300
elasticsearch.nb.shards=1
elasticsearch.nb.replica=0
26 changes: 26 additions & 0 deletions dockerfiles/run/guice/destination/conf/recipientrewritetable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<!-- The default table for storing James' RecipientRewriteTable mappings. -->
<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
<recursiveMapping>true</recursiveMapping>
<mappingLimit>10</mappingLimit>
</recipientrewritetable>

25 changes: 25 additions & 0 deletions dockerfiles/run/guice/destination/conf/usersrepository.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<usersrepository name="LocalUsers">
<algorithm>MD5</algorithm>
<enableVirtualHosting>true</enableVirtualHosting>
</usersrepository>

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<!-- Use this file to overwriting the annotations defined in the JPA domain classes -->

<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">

<entity class="org.apache.james.mailbox.jpa.mail.model.JPAHeader">

<table name="JAMES_MAIL_HEADER"/>

<attributes>
<basic name="value">
<column name="HEADER_VALUE" length="8000" />
</basic>
</attributes>

</entity>

</entity-mappings>
Loading