CONTAINER_NAME, name of the container, default value is akraino-validation-mysql
MYSQL_ROOT_PASSWORD, the desired mysql root user password, this variable is required
-MYSQL_AKRAINO_PASSWORD, the desired mysql akraino user password, this variable is required
+MYSQL_USER, the desired mysql user, the default value is 'akraino'
+MYSQL_PASSWORD, the desired mysql user password, this variable is required
REGISTRY, registry of the mysql image, default value is akraino
NAME, name of the mysql image, default value is validation
TAG_PRE, first part of the image version, default value is mysql
.. code-block:: console
cd validation/docker/mysql
- ./deploy.sh MYSQL_ROOT_PASSWORD=root_password MYSQL_AKRAINO_PASSWORD=akraino_password
+ ./deploy.sh --MYSQL_ROOT_PASSWORD root_password --MYSQL_PASSWORD akraino_password
Also, in order to re-deploy the database (it is assumed that the corresponding mysql container has been stopped and deleted) while the persistent storage already exists (currently, the 'akraino-validation-mysql' docker volume is used), a different approach should be used after the image building process.
CONTAINER_NAME, the name of the contaner, default value is akraino-validation-ui
DB_IP_PORT, the IP and port of the mysql instance, this variable is required
-MYSQL_AKRAINO_PASSWORD, the mysql akraino user password, this variable is required
+MYSQL_USER, the mysql user, the default value is 'akraino'
+MYSQL_PASSWORD, the mysql user password, this variable is required
REGISTRY, the registry of the mysql image, default value is akraino
NAME, the name of the mysql image, default value is validation
TAG_PRE, the first part of the image version, default value is ui
CERTDIR, the directory where the SSL certificates can be found, default value is the working directory where self signed certificates exist only for demo purposes
ENCRYPTION_KEY, the key that should be used by the AES algorithm for encrypting passwords stored in database, this variable is required
UI_ADMIN_PASSWORD, the desired Blueprint Validation UI password for the admin user, this variable is required
+TRUST_ALL, the variable that defines whether the UI should trust all certificates or not, default value is false
Note that, for a functional UI, the following prerequisites are needed:
.. code-block:: console
cd validation/docker/ui
- ./deploy.sh DB_IP_PORT=172.17.0.3:3306 MYSQL_AKRAINO_PASSWORD=akraino_password ENCRYPTION_KEY=AGADdG4D04BKm2IxIWEr8o== UI_ADMIN_PASSWORD=admin
+ ./deploy.sh --DB_IP_PORT 172.17.0.3:3306 --MYSQL_PASSWORD akraino_password --ENCRYPTION_KEY AGADdG4D04BKm2IxIWEr8o== --UI_ADMIN_PASSWORD admin
The kube-conformance container
==============================
CONTAINER_NAME="akraino-validation-mysql"
# Container input variables
MYSQL_ROOT_PASSWORD=""
-MYSQL_AKRAINO_PASSWORD=""
+MYSQL_USER="akraino"
+MYSQL_PASSWORD=""
# Image data
REGISTRY=akraino
NAME=validation
TAG_VER=latest
MYSQL_HOST_PORT=3307
-for ARGUMENT in "$@"
-do
- KEY=$(echo $ARGUMENT | cut -f1 -d=)
- VALUE=$(echo $ARGUMENT | cut -f2 -d=)
- case "$KEY" in
- REGISTRY) REGISTRY=${VALUE} ;;
- NAME) NAME=${VALUE} ;;
- TAG_VER) TAG_VER=${VALUE} ;;
- TAG_PRE) TAG_PRE=${VALUE} ;;
- MYSQL_ROOT_PASSWORD) MYSQL_ROOT_PASSWORD=${VALUE} ;;
- MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;;
- CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;;
- MYSQL_HOST_PORT) MYSQL_HOST_PORT=${VALUE} ;;
- *)
- esac
+while [ $# -gt 0 ]; do
+ if [[ $1 == *"--"* ]]; then
+ v="${1/--/}"
+ declare $v="$2"
+ fi
+ shift
done
if [ -z "$MYSQL_ROOT_PASSWORD" ]
exit 1
fi
-if [ -z "$MYSQL_AKRAINO_PASSWORD" ]
+if [ -z "$MYSQL_PASSWORD" ]
then
- echo "ERROR: You must specify the mysql database akraino user password"
+ echo "ERROR: You must specify the mysql database user password"
exit 1
fi
IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
chmod 0444 "/$(pwd)/mysql.conf"
-docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" -e MYSQL_ROOT_PASSWORD="$MYSQL_ROOT_PASSWORD" -e MYSQL_DATABASE="akraino_bluvalui" -e MYSQL_USER="akraino" -e MYSQL_PASSWORD="$MYSQL_AKRAINO_PASSWORD" $IMAGE
+docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" -e MYSQL_ROOT_PASSWORD="$MYSQL_ROOT_PASSWORD" -e MYSQL_DATABASE="akraino_bluvalui" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" $IMAGE
sleep 10
TAG_VER=latest
MYSQL_HOST_PORT=3307
-for ARGUMENT in "$@"
-do
- KEY=$(echo $ARGUMENT | cut -f1 -d=)
- VALUE=$(echo $ARGUMENT | cut -f2 -d=)
- case "$KEY" in
- REGISTRY) REGISTRY=${VALUE} ;;
- NAME) NAME=${VALUE} ;;
- TAG_VER) TAG_VER=${VALUE} ;;
- TAG_PRE) TAG_PRE=${VALUE} ;;
- CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;;
- MYSQL_HOST_PORT) MYSQL_HOST_PORT=${VALUE} ;;
- *)
- esac
+while [ $# -gt 0 ]; do
+ if [[ $1 == *"--"* ]]; then
+ v="${1/--/}"
+ declare $v="$2"
+ fi
+ shift
done
IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
-docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "/$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" $IMAGE
+docker run --detach --name $CONTAINER_NAME --publish $MYSQL_HOST_PORT:3306 -v $DOCKER_VOLUME_NAME:/var/lib/mysql -v "$(pwd)/mysql.conf:/etc/mysql/conf.d/my.cnf" $IMAGE
sleep 10
TAG_PRE=ui
TAG_VER=latest
# Container input parameters
-MYSQL_AKRAINO_PASSWORD=""
+MYSQL_USER="akraino"
+MYSQL_PASSWORD=""
JENKINS_URL="https://jenkins.akraino.org/"
JENKINS_USERNAME="demo"
JENKINS_USER_PASSWORD="demo"
CERTDIR=$(pwd)
ENCRYPTION_KEY=""
UI_ADMIN_PASSWORD=""
+TRUST_ALL="false"
-for ARGUMENT in "$@"
-do
- KEY=$(echo $ARGUMENT | cut -f1 -d=)
- VALUE=$(echo $ARGUMENT | cut -f2 -d=)
- case "$KEY" in
- REGISTRY) REGISTRY=${VALUE} ;;
- NAME) NAME=${VALUE} ;;
- TAG_PRE) TAG_PRE=${VALUE} ;;
- TAG_VER) TAG_VER=${VALUE} ;;
- MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;;
- JENKINS_URL) JENKINS_URL=${VALUE} ;;
- JENKINS_USERNAME) JENKINS_USERNAME=${VALUE} ;;
- JENKINS_USER_PASSWORD) JENKINS_USER_PASSWORD=${VALUE} ;;
- JENKINS_JOB_NAME) JENKINS_JOB_NAME=${VALUE} ;;
- DB_IP_PORT) DB_IP_PORT=${VALUE} ;;
- CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;;
- NEXUS_PROXY) NEXUS_PROXY=${VALUE} ;;
- JENKINS_PROXY) JENKINS_PROXY=${VALUE} ;;
- CERTDIR) CERTDIR=${VALUE} ;;
- ENCRYPTION_KEY) ENCRYPTION_KEY=${VALUE} ;;
- UI_ADMIN_PASSWORD) UI_ADMIN_PASSWORD=${VALUE} ;;
- *)
- esac
+while [ $# -gt 0 ]; do
+ if [[ $1 == *"--"* ]]; then
+ v="${1/--/}"
+ declare $v="$2"
+ fi
+ shift
done
if [ -z "$DB_IP_PORT" ]
exit 1
fi
-if [ -z "$MYSQL_AKRAINO_PASSWORD" ]
+if [ -z "$MYSQL_PASSWORD" ]
then
- echo "ERROR: You must specify the mysql akraino user password"
+ echo "ERROR: You must specify the mysql user password"
exit 1
fi
echo "Note: If there is a password already stored in database, the supplied UI_ADMIN_PASSWORD will be ignored."
IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
-docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_AKRAINO_PASSWORD="$MYSQL_AKRAINO_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" $IMAGE
+docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
sleep 10
- 'akraino' database has been renamed to 'akraino_bluvalui'
### Removed
+
+## [0.4.4-SNAPSHOT] - 4 October 2019
+### Added
+- The user can define whether the UI can trust all SSL certificates or not.
+- The mysql user name can be configured.
+
+### Changed
+- New approach is used for interpreting shell script input variables. Now, all symbols are recognized.
+
+### Removed
CONTAINER_NAME, name of the container, default value is akraino-validation-mysql
MYSQL_ROOT_PASSWORD, the desired mysql root user password, this variable is required
-MYSQL_AKRAINO_PASSWORD, the desired mysql akraino user password, this variable is required
+MYSQL_USER, the mysql user, the default value is 'akraino'
+MYSQL_PASSWORD, the desired mysql user password, this variable is required
REGISTRY, registry of the mysql image, default value is akraino
NAME, name of the mysql image, default value is validation
TAG_PRE, first part of the image version, default value is mysql
TAG_VER, last part of the image version, default value is latest
MYSQL_HOST_PORT, port on which mysql is exposed on host, default value is 3307
-Currently, one user is supported by the UI, namely admin (full privileges). Its password is initialized during UI deployment (refer to UI deployment section). This password can be modified using the UI. Furthermore, more users can be created/modified using the UI.
-
In order to build and deploy the image using only the required parameters, the below instructions should be followed:
The mysql root password, mysql akraino user password (currently the UI connects to the database using the akraino user), the UI admin password and the UI akraino password should be configured using the appropriate variables and the following commands should be executed:
cd validation/ui
mvn docker:build -Ddocker.filter=akraino/validation:dev-mysql-latest
cd ../docker/mysql
- ./deploy.sh TAG_PRE=dev-mysql MYSQL_ROOT_PASSWORD=<mysql root user password> MYSQL_AKRAINO_PASSWORD=<mysql akraino user password>
+ ./deploy.sh --TAG_PRE dev-mysql --MYSQL_ROOT_PASSWORD <mysql root user password> --MYSQL_PASSWORD <mysql akraino user password>
mysql -p<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mysql container> < ../../ui/db-scripts/examples/initialize_db_example.sql
In order to retrieve the IP of the mysql container, the following command should be executed:
.. code-block:: console
cd validation/docker/mysql
- ./deploy_with_existing_persistent_storage.sh TAG_PRE=dev-mysql
+ ./deploy_with_existing_persistent_storage.sh --TAG_PRE dev-mysql
Finally, if the database must be re-deployed (it is assumed that the corresponding mysql container has been stopped and deleted) and the old persistent storage must be deleted, the used docker volume should be first deleted (note that all database's data will be lost).
docker volume rm akraino-validation-mysql
cd validation/docker/mysql
- ./deploy.sh TAG_PRE=dev-mysql MYSQL_ROOT_PASSWORD=<root user password> MYSQL_AKRAINO_PASSWORD=<mysql akraino user password>
+ ./deploy.sh --TAG_PRE dev-mysql --MYSQL_ROOT_PASSWORD <root user password> --MYSQL_PASSWORD <mysql akraino user password>
mysql -p<MYSQL_AKRAINO_PASSWORD> -uakraino -h <IP of the mysql container> < ../../ui/db-scripts/examples/initialize_db_example.sql
In the context of the UI application, the following tables exist in the database:
CONTAINER_NAME, the name of the container, default value is akraino-validation-ui
DB_IP_PORT, the IP and port of the mysql instance, this variable is required
-MYSQL_AKRAINO_PASSWORD, the mysql akraino user password, this variable is required
+MYSQL_USER, the mysql user, the default value is 'akraino'
+MYSQL_PASSWORD, the mysql user password, this variable is required
REGISTRY, the registry of the ui image, default value is akraino
NAME, the name of the ui image, default value is validation
TAG_PRE, the first part of the image version, default value is ui
CERTDIR, the directory where the SSL certificates can be found, default value is the working directory where self signed certificates exist only for demo purposes
ENCRYPTION_KEY, the key that should be used by the AES algorithm for encrypting passwords stored in database, this variable is required
UI_ADMIN_PASSWORD, the desired Blueprint Validation UI password for the admin user, this variable is required
+TRUST_ALL, the variable that defines whether the UI should trust all certificates or not, default value is false
So, for a functional UI, the following prerequisites are needed:
.. code-block:: console
cd ../docker/ui
- ./deploy.sh TAG_PRE=dev-ui DB_IP_PORT=<IP and port of the mysql> MYSQL_AKRAINO_PASSWORD=<mysql akraino password> ENCRYPTION_KEY=<encryption key> UI_ADMIN_PASSWORD=<UI admin user password>
+ ./deploy.sh --TAG_PRE dev-ui --DB_IP_PORT <IP and port of the mysql> --MYSQL_PASSWORD <mysql akraino password> --ENCRYPTION_KEY <encryption key> --UI_ADMIN_PASSWORD <UI admin user password>
+
+The content of the DB_IP_PORT can be for example '172.17.0.3:3306'. Also, the value of the encryption key can be for example 'AGADdG4D04BKm2IxIWEr8o=='.
-The content of the DB_IP_PORT can be for example '172.17.0.3:3306'. Also, the value of the encryption key can be for example 'AGADdG4D04BKm2IxIWEr8o'. Note that the symbol '=' is not recognized.
+Currently, one user is supported by the UI, namely admin (full privileges). Its password is initialized during UI deployment. This password can be modified using the UI. Furthermore, more users can be created/modified using the UI.
Furthermore, the TAG_PRE variable should be defined as the default value is 'ui' (note that the 'dev-ui' is used for development purposes - look at pom.xml file).
<groupId>org.akraino.validation</groupId>
<artifactId>ui</artifactId>
- <version>0.4.3-SNAPSHOT</version>
+ <version>0.4.4-SNAPSHOT</version>
<name>Bluval UI Maven Webapp</name>
<packaging>war</packaging>
dataSource.setDriverClass(SystemProperties.getProperty(SystemProperties.DB_DRIVER));
dataSource.setJdbcUrl("jdbc:mysql://" + System.getenv("DB_IP_PORT") + "/"
+ PortalApiProperties.getProperty("akraino_database_name"));
- dataSource.setUser(SystemProperties.getProperty(SystemProperties.DB_USERNAME));
- String password = System.getenv("MYSQL_AKRAINO_PASSWORD");
+ dataSource.setUser(System.getenv("MYSQL_USER"));
+ String password = System.getenv("MYSQL_PASSWORD");
if (SystemProperties.containsProperty(SystemProperties.DB_ENCRYPT_FLAG)) {
String encryptFlag = SystemProperties.getProperty(SystemProperties.DB_ENCRYPT_FLAG);
if (encryptFlag != null && encryptFlag.equalsIgnoreCase("true")) {
@EventListener(ContextRefreshedEvent.class)
public void setHttpProperties() throws NoSuchAlgorithmException, KeyManagementException {
- SSLContext sslContext = SSLContext.getInstance("SSL");
- sslContext.init(null, this.trustAll, new java.security.SecureRandom());
- HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
- // Install the all-trusting host verifier
- HttpsURLConnection.setDefaultHostnameVerifier(this.hostnameVerifier);
- DefaultClientConfig config = new DefaultClientConfig();
- Map<String, Object> properties = config.getProperties();
- HTTPSProperties httpsProperties = new HTTPSProperties((str, sslSession) -> true, sslContext);
- properties.put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpsProperties);
+ if (System.getenv("TRUST_ALL") != null && System.getenv("TRUST_ALL").equals("true")) {
+ SSLContext sslContext = SSLContext.getInstance("SSL");
+ sslContext.init(null, this.trustAll, new java.security.SecureRandom());
+ HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
+ // Install the all-trusting host verifier
+ HttpsURLConnection.setDefaultHostnameVerifier(this.hostnameVerifier);
+ DefaultClientConfig config = new DefaultClientConfig();
+ Map<String, Object> properties = config.getProperties();
+ HTTPSProperties httpsProperties = new HTTPSProperties((str, sslSession) -> true, sslContext);
+ properties.put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpsProperties);
+ }
}
@EventListener(ContextRefreshedEvent.class)