FC-283 - Remove property files from quickstart doc
diff --git a/README-QUICKSTART-DOCKER-APACHEDS.md b/README-QUICKSTART-DOCKER-APACHEDS.md
index 129e513..103ac69 100644
--- a/README-QUICKSTART-DOCKER-APACHEDS.md
+++ b/README-QUICKSTART-DOCKER-APACHEDS.md
@@ -52,14 +52,23 @@
cd directory-fortress-core
```
-b. or download package:
+b. or from Apache:
```
wget http://www.apache.org/dist/directory/fortress/dist/2.0.5/fortress-core-2.0.5-source-release.zip
unzip fortress-core-2.0.5-source-release.zip
cd fortress-core-2.0.5
```
-2. Now build the apache directory fortress docker image (trailing dot matters):
+2. Prepare the package:
+
+```
+cp build.properties.example build.properties
+```
+
+ * [build.properties.example](build.properties.example) contains the default config for the apacheds docker image.
+ * Learn how the fortress config subsystem works: [README-CONFIG](README-CONFIG.md).
+
+3. Now build the apachedirectory apacheds docker image (trailing dot matters):
```
docker build -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
@@ -71,7 +80,7 @@
docker pull apachedirectory/apacheds-for-apache-fortress-tests
```
-3. Run the docker container:
+4. Run the docker container:
```
CONTAINER_ID=$(docker run -d -P apachedirectory/apacheds-for-apache-fortress-tests)
@@ -82,7 +91,7 @@
* The '$CONTAINER_PORT' value required for next step.
* Depending on your Docker setup, may need to run this step as root or sudo priv's.
-4. Prepare your terminal for execution of maven commands.
+5. Prepare your terminal for execution of maven commands.
```
#!/bin/sh
@@ -90,19 +99,16 @@
export JAVA_HOME=...
export PATH=$PATH:$M2_HOME/bin
export MAVEN_OPTS="
- -Dfortress.admin.user=uid=admin,ou=system
- -Dfortress.admin.pw=secret
- -Dfortress.suffix=dc=example,dc=com
- -Dfortress.config.realm=default
- -Dfortress.ldap.server.type=apacheds
+ -Dfortress.host=localhost
-Dfortress.port=32768"
```
More about 'MAVEN_OPTS':
* Provides the coordinates to the ldap server running inside Docker container.
- * replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
+ * Replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
+ * if Docker image running on a different machine, replace fortress.host to point to it.
-5. Run the maven install to build fortress:
+6. Run the maven install to build fortress:
```
mvn clean install
@@ -121,10 +127,14 @@
2. Next, enter the following command:
```
-mvn -Dtest=FortressJUnitTest test
+mvn -Dtest=FortressJUnitTest test -Dfortress.host=localhost -Dfortress.port=32768
```
- *Tests the APIs against your LDAP server.*
+ More about this step:
+ * Provides the coordinates to the ldap server running inside Docker container.
+ * Replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
+ * if Docker image running on a different machine, replace fortress.host to point to it.
+ * Tests the APIs against your LDAP server.*
3. Verify the tests worked:
@@ -147,9 +157,12 @@
4. Rerun the tests to verify teardown APIs work:
```
-mvn -Dtest=FortressJUnitTest test
+mvn -Dtest=FortressJUnitTest test -Dfortress.host=localhost -Dfortress.port=32768
```
+ More about this step:
+ * Again verify fortress.host and fortress.port match your environment.
+
5. Verify that worked also:
```
diff --git a/README-QUICKSTART-DOCKER-SLAPD.md b/README-QUICKSTART-DOCKER-SLAPD.md
index c6488df..1e78935 100644
--- a/README-QUICKSTART-DOCKER-SLAPD.md
+++ b/README-QUICKSTART-DOCKER-SLAPD.md
@@ -47,42 +47,52 @@
1. Download the package:
a. from git:
- ```
- git clone --branch 2.0.5 https://gitbox.apache.org/repos/asf/directory-fortress-core.git
- cd directory-fortress-core
- ```
+```
+git clone --branch 2.0.5 https://gitbox.apache.org/repos/asf/directory-fortress-core.git
+cd directory-fortress-core
+```
- b. or download package:
- ```
- wget http://www.apache.org/dist/directory/fortress/dist/2.0.5/fortress-core-2.0.5-source-release.zip
- unzip fortress-core-2.0.5-source-release.zip
- cd fortress-core-2.0.5
- ```
+b. or from Apache:
+```
+wget http://www.apache.org/dist/directory/fortress/dist/2.0.5/fortress-core-2.0.5-source-release.zip
+unzip fortress-core-2.0.5-source-release.zip
+cd fortress-core-2.0.5
+```
-2. Now build the apache directory fortress docker image (trailing dot matters):
+2. Prepare the package:
- ```
- docker build -t apachedirectory/openldap-for-apache-fortress-tests -f src/docker/openldap-for-apache-fortress-tests/Dockerfile .
- ```
+```
+cp build.properties.example build.properties
+cp slapd.properties.example slapd.properties
+```
+
+ * [slapd.properties.example](slapd.properties.example) contains the default config for openldap docker image.
+ * Learn how the fortress config subsystem works: [README-CONFIG](README-CONFIG.md).
+
+3. Now build the apachedirectory openldap docker image (trailing dot matters):
+
+```
+docker build -t apachedirectory/openldap-for-apache-fortress-tests -f src/docker/openldap-for-apache-fortress-tests/Dockerfile .
+```
Or just pull the prebuilt image:
- ```
- docker pull apachedirectory/openldap-for-apache-fortress-tests
- ```
+```
+docker pull apachedirectory/openldap-for-apache-fortress-tests
+```
-3. Run the docker container:
+4. Run the docker container:
- ```
+```
CONTAINER_ID=$(docker run -d -P apachedirectory/openldap-for-apache-fortress-tests)
CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "389/tcp") 0).HostPort}}' $CONTAINER_ID)
echo $CONTAINER_PORT
- ```
+```
* The '$CONTAINER_PORT' value required for next step.
* Depending on your Docker setup, may need to run this step as root or sudo priv's.
-4. Prepare your terminal for execution of maven commands.
+5. Prepare your terminal for execution of maven commands.
```
#!/bin/sh
@@ -90,19 +100,16 @@
export JAVA_HOME=...
export PATH=$PATH:$M2_HOME/bin
export MAVEN_OPTS="
- -Dfortress.admin.user=cn=manager,dc=example,dc=com
- -Dfortress.admin.pw=secret
- -Dfortress.suffix=dc=example,dc=com
- -Dfortress.config.realm=default
- -Dfortress.ldap.server.type=openldap
+ -Dfortress.host=localhost
-Dfortress.port=32768"
```
More about 'MAVEN_OPTS':
* Provides the coordinates to the ldap server running inside Docker container.
* replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
+ * if Docker image running on a different machine, replace fortress.host to point to it.
-5. Run the maven install to build fortress:
+6. Run the maven install to build fortress:
```
mvn clean install
@@ -121,10 +128,14 @@
2. Next, enter the following command:
```
-mvn -Dtest=FortressJUnitTest test
+mvn -Dtest=FortressJUnitTest test -Dfortress.host=localhost -Dfortress.port=32768
```
- *Tests the APIs against your LDAP server.*
+ More about this step:
+ * Provides the coordinates to the ldap server running inside Docker container.
+ * Replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
+ * if Docker image running on a different machine, replace fortress.host to point to it.
+ * Tests the APIs against your LDAP server.*
3. Verify the tests worked:
@@ -153,9 +164,12 @@
4. Rerun the tests to verify teardown APIs work:
```
-mvn -Dtest=FortressJUnitTest test
+mvn -Dtest=FortressJUnitTest test -Dfortress.host=localhost -Dfortress.port=32768
```
+ More about this step:
+ * Again verify fortress.host and fortress.port match your environment.
+
5. Verify that worked also:
```
diff --git a/pom.xml b/pom.xml
index 83ae4fd..c78d2bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -711,7 +711,7 @@
<!--<target name="stop-slapd-win-if-present" depends="slapd.dir.check" if="slapd.dir.exists">-->
<target name="fortress-load" if="load.file" description="Loads fortress policy into ldap">
<echo message="############### Run Fortress Ant script to load policy ###############" />
- <java classname="org.apache.tools.ant.launch.Launcher" fork="true" clonevm="true" failonerror="true" dir="${basedir}" timeout="120000" taskname="startAnt">
+ <java classname="org.apache.tools.ant.launch.Launcher" fork="true" clonevm="true" failonerror="true" dir="${basedir}" timeout="600000" taskname="startAnt">
<classpath>
<!-- use config/bootstrap folder for config because the config ldap node isn't (might not be) inserted: -->
<pathelement location="./config/bootstrap/" />
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java
index 8db1272..9a049af 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java
@@ -83,11 +83,9 @@
{
private static final String CLS_NM = ConfigDAO.class.getName();
private static final Logger LOG = LoggerFactory.getLogger( CLS_NM );
- private String CONFIG_ROOT_DN;
public static final String GID_NUMBER_SEQUENCE = "ftGidNumber";
public static final String UID_NUMBER_SEQUENCE = "ftUidNumber";
-
private final String[] CONFIG_OBJ_CLASS =
{
SchemaConstants.DEVICE_OC, GlobalIds.PROPS_AUX_OBJECT_CLASS_NAME, GlobalIds.FT_CONFIG_AUX_OBJECT_CLASS_NAME
@@ -101,14 +99,12 @@
SchemaConstants.CN_AT, GlobalIds.PROPS, GID_NUMBER_SEQUENCE, UID_NUMBER_SEQUENCE
};
-
/**
* Package private default constructor.
*/
ConfigDAO()
{
super();
- CONFIG_ROOT_DN = Config.getInstance().getProperty( GlobalIds.CONFIG_ROOT_PARAM );
}
/**
@@ -404,6 +400,6 @@
*/
private String getDn( String name )
{
- return SchemaConstants.CN_AT + "=" + name + "," + CONFIG_ROOT_DN;
+ return SchemaConstants.CN_AT + "=" + name + "," + Config.getInstance().getProperty( GlobalIds.CONFIG_ROOT_PARAM );
}
}
\ No newline at end of file
diff --git a/src/main/java/org/apache/directory/fortress/core/util/Config.java b/src/main/java/org/apache/directory/fortress/core/util/Config.java
index bd5a0f6..3b64e89 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/Config.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/Config.java
@@ -701,7 +701,6 @@
{
config.setProperty( GlobalIds.CONFIG_ROOT_PARAM, szValue );
LOG.info( PREFIX, GlobalIds.CONFIG_ROOT_PARAM, szValue );
-
}
// Check to see if the ldap server type has been overridden by a system property:
@@ -716,7 +715,7 @@
szValue = System.getProperty( EXT_IS_ARBAC02 );
if( StringUtils.isNotEmpty( szValue ))
{
- Boolean isArbac02 = new Boolean(szValue);
+ Boolean isArbac02 = Boolean. valueOf( szValue );
config.setProperty( GlobalIds.IS_ARBAC02, isArbac02.booleanValue() );
LOG.info( PREFIX, GlobalIds.IS_ARBAC02, isArbac02.booleanValue() );
}