Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 74e98839 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

Merge branch 'development' of...

Merge branch 'development' of https://ec.europa.eu/cefdigital/code/scm/edelivery/smp into feature/EDELIVERY-8880-use-eu-login-for-smp-console-implementation-part-2

 Conflicts:
	smp-docker/compose/tomcat-mysql-smp-sml/runCompose.sh
	smp-docker/compose/tomcat-mysql/runCompose.sh
parents 48127fa2 0438007d
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 707 deletions
......@@ -8,6 +8,8 @@ PREFIX="smp-sml-tomcat-mysql"
# clear volume and containers - to run restart from scratch
function clearOldContainers {
echo "Save docker log to docker-file"
docker logs ${PREFIX} > smp-container.log 2>&1
echo "Clear containers and volumes"
docker-compose -p "${PREFIX}" rm -s -f -v
}
......
......@@ -2,8 +2,8 @@
WORKING_DIR="$(dirname $0)"
SML_INIT_DATABASE="../../../smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb.ddl"
#SML_INIT_DATABASE_DATA="../../../smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql"
SML_INIT_DATABASE_DATA="../../../smp-soapui-tests/groovy/mysql-4.1_integration_test_data.sql"
#SML_INIT_DATABASE_DATA="../../../smp-soapui-tests/groovy/mysql-4.1_integration_test_data.sql"
SML_INIT_DATABASE_DATA="../../../smp-webapp/src/main/smp-setup/database-scripts/mysql5innodb-data.sql"
# soap ui data
PREFIX="smp-tomcat-mysql"
SMP_VERSION=
......
......@@ -8,6 +8,8 @@ PREFIX="smp-tomcat-mysql"
# clear volume and containers - to run restart from scratch
function clearOldContainers {
echo "Save docker log to docker-file"
docker logs ${PREFIX} > smp-container.log 2>&1
echo "Clear containers and volumes"
docker-compose -p "${PREFIX}" rm -s -f -v
}
......
......@@ -12,6 +12,10 @@ PREFIX="smp-wls-orcl"
function clearOldContainers {
echo "Database stopped" > ./status-folder/database.status
echo "Save docker log to docker-file"
docker logs ${PREFIX} > smp-container.log 2>&1
echo "Clear containers and volumes"
docker-compose -p "${PREFIX}" rm -s -f -v
}
......
......@@ -9,8 +9,10 @@ ENV SMP_HOME=/opt/smp \
MYSQL_DRV_VERSION=5.1.46 \
MYSQL_DRV_SHA1=9a3e63b387e376364211e96827bc27db8d7a92e9 \
TOMCAT_MAJOR=8 \
TOMCAT_VERSION=8.5.31 \
TOMCAT_SHA512=51d8877782bc975b8c566263df7e55f383e617aa3c81ea2c219fed18e1f5d9e8233a92100de95b9a8df69ce5c0ad89a195d5b7e5647fcf9df26231870073a9cb \
TOMCAT_VERSION=8.5.73 \
#native version is dependant from tomcat version!
TOMCAT_NAVITVE_VERSION=1.2.31 \
TOMCAT_SHA512=bc39e4545c779326803bc2574592d72dfea1b56e4cb95d7ac5264c1b91f3da8b1b94f53c53390d1c8348ebe1dad2c10719cc2746b179e1085719d964aa60a779 \
SMP_DB_SCHEMA=smp \
SMP_DB_USER=smp \
SMP_INIT_PROPERTY_DELIMITER="||" \
......@@ -97,7 +99,7 @@ RUN apt-get update \
RUN export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") \
&& cd $SMP_HOME/apache-tomcat-$TOMCAT_VERSION/bin \
&& tar xfz tomcat-native.tar.gz \
&& cd tomcat-native-1.2.16-src/native \
&& cd tomcat-native-${TOMCAT_NAVITVE_VERSION}-src/native \
&& ./configure && make && make install
# dowload and deploy sml
......
......@@ -7,10 +7,10 @@ ENV SMP_HOME=/opt/smp \
MYSQL_DRV_VERSION=5.1.46 \
MYSQL_DRV_SHA1=9a3e63b387e376364211e96827bc27db8d7a92e9 \
TOMCAT_MAJOR=8 \
TOMCAT_VERSION=8.5.31 \
TOMCAT_SHA512=51d8877782bc975b8c566263df7e55f383e617aa3c81ea2c219fed18e1f5d9e8233a92100de95b9a8df69ce5c0ad89a195d5b7e5647fcf9df26231870073a9cb \
DB_SCHEMA=smp \
DB_USER=smp \
TOMCAT_VERSION=8.5.73 \
TOMCAT_SHA512=bc39e4545c779326803bc2574592d72dfea1b56e4cb95d7ac5264c1b91f3da8b1b94f53c53390d1c8348ebe1dad2c10719cc2746b179e1085719d964aa60a779 \
DB_SCHEMA=smp \
DB_USER=smp \
DB_USER_PASSWORD=smp \
MYSQL_ROOT_PASSWORD=root
......
FROM centos
MAINTAINER jrc
ENV SML_VERSION=3.1.2 \
SML_DISTRIBUTION_URL=https://ec.europa.eu/cefdigital/artifact/content/repositories/eDelivery/eu/europa/ec/bdmsl/bdmsl-webapp \
SML_SHA1=2000b1db9739e04559b7bf47faffed9abded137e \
SMP_VERSION=4.0.0 \
SMP_DISTRIBUTION_URL=https://ec.europa.eu/cefdigital/artifact/content/repositories/eDelivery/eu/europa/ec/edelivery/smp \
SMP_SHA1=52ba09257948233e920638f7a90f9bfa120910ca \
SMP_CONF_SHA1=af40537d2874775f2ab34c538682ef7ac50efdb3 \
TOMCAT_MAJOR=8 \
TOMCAT_VERSION=8.5.31 \
TOMCAT_SHA512=51d8877782bc975b8c566263df7e55f383e617aa3c81ea2c219fed18e1f5d9e8233a92100de95b9a8df69ce5c0ad89a195d5b7e5647fcf9df26231870073a9cb \
MYSQL_DRV_VERSION=5.1.46 \
MYSQL_DRV_SHA1=9a3e63b387e376364211e96827bc27db8d7a92e9 \
DATA_DIR=/data \
USER_BIND=named \
USER_TOMCAT=tomcat \
DB_SML_SCHEMA=bdmsl \
DB_SML_USER=sml \
DB_SML_PASSWORD=sml \
DB_SMP_SCHEMA=smp \
DB_SMP_USER=smp \
DB_SMP_PASSWORD=smp \
MYSQL_ROOT_PASSWORD=root
ENV TOMCAT_HOME=/opt/apache-tomcat-$TOMCAT_VERSION
# add mysql repo to install mysql instead mariadb
RUN rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm \
# && yum update -y \
&& yum install -y wget \
which \
unzip \
# MySQL server and client will be used by Domibus to Create MySQL users/schemas
mysql-community-server \
# add bind server
bind \
bind-utils \
java-1.8.0-openjdk-devel \
# clean yum to decrease image size
&& yum clean all \
# get tomcat, mysql driver, bdmsl
&& cd /opt \
&& wget -O /opt/tomcat.zip "https://archive.apache.org/dist/tomcat/tomcat-$TOMCAT_MAJOR/v$TOMCAT_VERSION/bin/apache-tomcat-$TOMCAT_VERSION.zip" \
&& sha512sum /opt/tomcat.zip | grep $TOMCAT_SHA512 \
&& wget -O mysql-connector-java-$MYSQL_DRV_VERSION.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/$MYSQL_DRV_VERSION/mysql-connector-java-$MYSQL_DRV_VERSION.jar \
&& sha1sum mysql-connector-java-$MYSQL_DRV_VERSION.jar | grep $MYSQL_DRV_SHA1 \
&& wget -O "edelivery-sml.war" "$SML_DISTRIBUTION_URL/$SML_VERSION/bdmsl-webapp-$SML_VERSION-tomcat-mysql.war" \
&& sha1sum edelivery-sml.war | grep $SML_SHA1 \
&& wget -O smp.war "$SMP_DISTRIBUTION_URL/$SMP_VERSION/smp-$SMP_VERSION.war" \
&& sha1sum smp.war | grep $SMP_SHA1 \
&& wget -O smp-setup.zip "$SMP_DISTRIBUTION_URL/$SMP_VERSION/smp-$SMP_VERSION-setup.zip" \
&& sha1sum smp-setup.zip | grep $SMP_CONF_SHA1 \
&& unzip tomcat.zip \
&& rm -rf $TOMCAT_HOME/webapps/* \
&& mv /opt/mysql-connector-java-$MYSQL_DRV_VERSION.jar $TOMCAT_HOME/lib/ \
&& mv /opt/edelivery-sml.war $TOMCAT_HOME/webapps/edelivery-sml.war \
&& mv /opt/smp.war $TOMCAT_HOME/webapps/smp.war \
&& unzip smp-setup.zip \
&& rm *.zip \
# create user
&& groupadd "$USER_TOMCAT" \
&& useradd -s /sbin/nologin -g $USER_TOMCAT -M $USER_TOMCAT \
&& cd $TOMCAT_HOME \
# install SML, set database param. and init data
&& mkdir -p $TOMCAT_HOME/sml/conf/ \
&& sed -i -e "s/<\/Context>/<Resource name=\"jdbc\/edelivery\" auth=\"Container\" type=\"javax.sql.DataSource\" maxTotal=\"100\" maxIdle=\"30\" maxWaitMillis=\"10000\" username=\"$DB_SML_USER\" password=\"$DB_SML_PASSWORD\" driverClassName=\"com.mysql.jdbc.Driver\" url=\"jdbc:mysql:\/\/localhost:3306\/$DB_SML_SCHEMA\"\/><\/Context>/g" "$TOMCAT_HOME/conf/context.xml" \
# install SMP, set database bugfix for version 3.1.2
&& mkdir -p $TOMCAT_HOME/smp/conf/ \
&& echo "export CLASSPATH=$TOMCAT_HOME/smp/conf" > $TOMCAT_HOME/bin/setenv.sh \
&& cp /opt/smp-$SMP_VERSION/smp.config.properties $TOMCAT_HOME/smp/conf/ \
&& cp /opt/smp-$SMP_VERSION/sample_signatures_keystore.jks $TOMCAT_HOME/smp/conf/ \
&& sed -i -e "s#jdbc:mysql://localhost:3306/smp#jdbc:mysql://localhost:3306/$DB_SMP_SCHEMA#g" "$TOMCAT_HOME/smp/conf/smp.config.properties" \
&& sed -i -e "s#jdbc.user\s*=\s*smp#jdbc.user=$DB_SMP_USER#g" "$TOMCAT_HOME/smp/conf/smp.config.properties" \
&& sed -i -e "s#jdbc.password\s*=\s*secret123#jdbc.password=$DB_SMP_PASSWORD#g" "$TOMCAT_HOME/smp/conf/smp.config.properties" \
&& sed -i -e "s#/keystores/sample_signatures_keystore.jks#$TOMCAT_HOME/smp/conf/sample_signatures_keystore.jks#g" "$TOMCAT_HOME/smp/conf/smp.config.properties" \
# configure SMP, SML integration
&& sed -i -e "s#bdmsl.integration.enabled=false#bdmsl.integration.enabled=true#g" "$TOMCAT_HOME/smp/conf/smp.config.properties" \
&& sed -i -e "s#bdmsl.integration.url=http://localhost:8080/manageparticipantidentifier#bdmsl.integration.url=http://localhost:8080/edelivery-sml/manageparticipantidentifier#g" "$TOMCAT_HOME/smp/conf/smp.config.properties" \
&& awk '/\[mysqld\]/ { print; print "lower_case_table_names = 1\nbind-address=0.0.0.0"; next }1' /etc/my.cnf >> /etc/my.cnf \
# set tomcat user
&& chown -R $USER_TOMCAT:$USER_TOMCAT bin/ webapps/ work/ temp/ logs/ \
&& chmod ug+x bin/*.sh \
# set bind
&& mkdir -p /var/named/data/log \
&& chown -R $USER_BIND:$USER_BIND /var/named \
&& mkdir -p /var/named/data/log \
# set init mysqld
&& mysqld --initialize-insecure --user=mysql \
&& chown -R mysql:mysql /var/lib/mysql
# set init data for SML
COPY bdmsl/db.* /temp/
RUN mkdir -p $TOMCAT_HOME/webapps/WEB-INF/classes/liquibase/ \
&& cp /temp/db.* $TOMCAT_HOME/webapps/WEB-INF/classes/liquibase/ \
&& jar -uf $TOMCAT_HOME/webapps/edelivery-sml.war -C $TOMCAT_HOME/webapps/ WEB-INF/classes/liquibase/db.changelog-master.xml \
&& jar -uf $TOMCAT_HOME/webapps/edelivery-sml.war -C $TOMCAT_HOME/webapps/ WEB-INF/classes/liquibase/db.init-data-inserts.xml \
# bugfix for mysql: fixed in 3.1.3
&& jar -uf $TOMCAT_HOME/webapps/edelivery-sml.war -C $TOMCAT_HOME/webapps/ WEB-INF/classes/liquibase/db.changelog-update-3.1.RC1.xml \
&& rm -rf $TOMCAT_HOME/webapps/WEB-INF
COPY bind/named.conf /etc/named.conf
COPY bind/named.conf.local /etc/named.conf.local
COPY bind/zones /var/named/zones
COPY bdmsl/keystore.jks $TOMCAT_HOME/sml/conf/keystore.jks
COPY bdmsl/encriptionPrivateKey.private $TOMCAT_HOME/sml/conf/encriptionPrivateKey.private
COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
EXPOSE 53/udp 53/tcp 3306 8080
ENTRYPOINT ["/sbin/entrypoint.sh"]
CMD ["bash"]
<?xml version="1.0" encoding="UTF-8"?>
<!--
(C) Copyright 2018 - European Commission | CEF eDelivery
Licensed under the EUPL, Version 1.2 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
\BDMSL\bdmsl-parent-pom\LICENSE-EUPL-v1.2.pdf or https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/eupl_v1.2_en.pdf
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.
-->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
<property name="now" value="sysdate" dbms="oracle"/>
<property name="now" value="CURRENT_TIMESTAMP" dbms="mysql,h2"/>
<!-- Initial creation script -->
<include file="db.changelog-create.xml" relativeToChangelogFile="true"/>
<!-- Inserts of the properties with default values -->
<include file="db.changelog-default-data-inserts.xml" relativeToChangelogFile="true"/>
<!-- Initial update script -->
<include file="db.changelog-update-3.0.1.xml" relativeToChangelogFile="true"/>
<include file="db.changelog-update-3.1.RC1.xml" relativeToChangelogFile="true"/>
<include file="db.changelog-update-3.1.RC2.xml" relativeToChangelogFile="true"/>
<include file="db.changelog-update-3.1.2.xml" relativeToChangelogFile="true"/>
<!-- env specific update script -->
<include file="db.init-data-inserts.xml" relativeToChangelogFile="true"/>
<!-- Increments BDMSL version -->
<include file="db.changelog-version.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
<!-- CREATE TABLE AND COLUMNS -->
<changeSet author="eDelivery" id="39" logicalFilePath="path-independent">
<insert tableName="bdmsl_configuration">
<column name="property" value="dataInconsistencyCheckerCronExpression"/>
<column name="value" value="0 0 3 ? * *"/>
<column name="description"
value="Cron expression for dataInconsistencyChecker job. Example: 0 0 3 ? * * (everyday at 3:00 am)"/>
</insert>
<insert tableName="bdmsl_configuration">
<column name="property" value="dataInconsistencyCheckerEmail"/>
<column name="value" value="email@domain.com"/>
<column name="description" value="Email address to receive Data Inconsistency Checker results"/>
</insert>
</changeSet>
<changeSet id="40" author="eDelivery" logicalFilePath="path-independent">
<createTable tableName="bdmsl_subdomain">
<column autoIncrement="${autoIncrement}" name="subdomain_id" remarks="Subdomain ID" type="INT">
<constraints primaryKey="true" primaryKeyName="PRIMARY_SUBDOM" nullable="false"/>
</column>
<column name="subdomain_name" remarks="Subdomain Name" type="VARCHAR(255)">
<constraints nullable="false" unique="true"/>
</column>
<column defaultValueComputed="${now}" name="created_on" remarks="Date of creation"
type="datetime">
<constraints nullable="false"/>
</column>
<column defaultValueComputed="${now}" name="last_updated_on" remarks="Date of the last update"
type="datetime">
<constraints nullable="false"/>
</column>
</createTable>
<!--<dropColumn tableName="bdmsl_certificate_domain" columnName="subdomain"/>-->
<addColumn tableName="bdmsl_certificate_domain">
<column name="fk_subdomain_id" type="INT"/>
</addColumn>
<addColumn tableName="bdmsl_smp">
<column name="fk_subdomain_id" type="INT"/>
</addColumn>
<addForeignKeyConstraint baseColumnNames="fk_subdomain_id" baseTableName="bdmsl_certificate_domain"
constraintName="FK_certdom_subdom_subdomid" deferrable="false"
initiallyDeferred="false"
onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="subdomain_id"
referencedTableName="bdmsl_subdomain"/>
<addForeignKeyConstraint baseColumnNames="fk_subdomain_id" baseTableName="bdmsl_smp"
constraintName="FK_smp_subdom_subdomid" deferrable="false" initiallyDeferred="false"
onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="subdomain_id"
referencedTableName="bdmsl_subdomain"/>
</changeSet>
<!-- MIGRATION SCRIPT -->
<changeSet id="41" author="eDelivery" logicalFilePath="path-independent">
<validCheckSum>7:c0759dbf9933e866bace1aac5a5fc589</validCheckSum>
<sql dbms="oracle,h2">
insert into bdmsl_subdomain(subdomain_id, subdomain_name)
select rownum, dom from (select distinct domain dom from bdmsl_certificate_domain);
</sql>
<sql dbms="mysql">
set @row_number = 0;
insert into bdmsl_subdomain(subdomain_id, subdomain_name) (
select
(@row_number:=@row_number + 1) as num,domain from (select distinct domain from
bdmsl_certificate_domain) domaintable);
</sql>
<sql>
update bdmsl_certificate_domain set fk_subdomain_id = (select distinct subdomain_id from bdmsl_subdomain
where subdomain_name=domain) where fk_subdomain_id is null;
</sql>
</changeSet>
<changeSet id="42" author="eDelivery" logicalFilePath="path-independent">
<validCheckSum>7:c60b9400817faa59fcf753eb5264bc93</validCheckSum>
<preConditions onFail="MARK_RAN">
<not>
<tableIsEmpty tableName="bdmsl_subdomain"/>
</not>
</preConditions>
<!-- MIGRATE SMP TABLE -->
<sql>
update bdmsl_smp set fk_subdomain_id = 1;
</sql>
</changeSet>
<!-- DROP OLD COLUMNS AND ADD CONSTRAINTS -->
<changeSet id="43" author="eDelivery" logicalFilePath="path-independent">
<preConditions onFail="HALT">
<columnExists tableName="bdmsl_certificate_domain" columnName="domain"/>
</preConditions>
<!-- DROP COLUMN DOMAIN FROM CERTIFICATEDOMAIN TABLE -->
<dropColumn tableName="bdmsl_certificate_domain" columnName="domain"/>
</changeSet>
<changeSet id="44" author="eDelivery" logicalFilePath="path-independent">
<!-- ADD NOT NULL CONSTRAINTS -->
<addNotNullConstraint tableName="bdmsl_certificate_domain" columnName="fk_subdomain_id" columnDataType="INT"/>
<addNotNullConstraint tableName="bdmsl_smp" columnName="fk_subdomain_id" columnDataType="INT"/>
</changeSet>
<changeSet id="46" author="eDelivery" logicalFilePath="path-independent">
<delete tableName="bdmsl_configuration">
<where>property = 'isAliveDNSChecking'</where>
</delete>
</changeSet>
<changeSet id="47" author="eDelivery" logicalFilePath="path-independent">
<update tableName="bdmsl_configuration">
<column name="property" value='dataInconsistencyAnalyzer.cronJobExpression' type="LONGTEXT"/>
<where>property='dataInconsistencyCheckerCronExpression'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="property" value='dataInconsistencyAnalyzer.recipientEmail' type="LONGTEXT"/>
<where>property='dataInconsistencyCheckerEmail'</where>
</update>
<insert tableName="bdmsl_configuration">
<column name="property" value="dataInconsistencyAnalyzer.senderEmail" type="LONGTEXT"/>
<column name="value" value="automated-notifications@nomail.ec.europa.eu"/>
<column name="description" value="Sender email address for reporting Data Inconsistency Analyzer."/>
</insert>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
(C) Copyright 2018 - European Commission | CEF eDelivery
Licensed under the EUPL, Version 1.2 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
\BDMSL\bdmsl-parent-pom\LICENSE-EUPL-v1.2.pdf or https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/eupl_v1.2_en.pdf
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.
-->
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">
<!-- Environment Specific -->
<changeSet author="eDelivery" id="999990" logicalFilePath="path-independent">
<update tableName="bdmsl_configuration">
<column name="value" value='false' type="LONGTEXT"/>
<where>property='dnsClient.SIG0Enabled'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='false' type="LONGTEXT"/>
<where>property='signResponse'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='true' type="LONGTEXT"/>
<where>property='dnsClient.enabled'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='sml/conf/' type="LONGTEXT"/>
<where>property='configurationDir'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='127.0.0.1' type="LONGTEXT"/>
<where>property='dnsClient.server'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='true' type="LONGTEXT"/>
<where>property='unsecureLoginAllowed'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='false' type="LONGTEXT"/>
<where>property='useProxy'</where>
</update>
<update tableName="bdmsl_configuration">
<column name="value" value='false' type="LONGTEXT"/>
<where>property='authentication.bluecoat.enabled'</where>
</update>
</changeSet>
<!-- Set new domain -->
<changeSet author="eDelivery" id="999991" logicalFilePath="path-independent">
<delete tableName="bdmsl_configuration">
<where>property like '%.ec.europa.eu'</where>
</delete>
<update tableName="bdmsl_subdomain">
<column name="subdomain_name" value='acc.edelivery.tech.local' type="LONGTEXT"/>
<where>subdomain_id='1'</where>
</update>
<insert tableName="bdmsl_configuration">
<column name="property" value="dnsClient.domain.acc.edelivery.tech.local"/>
<column name="value" value="acc.edelivery.tech.local"/>
<column name="description"
value="Test domain"/>
</insert>
<insert tableName="bdmsl_configuration">
<column name="property"
value="subdomain.validation.participantIdRegex.acc.edelivery.tech.local"/>
<column name="value"
value="^.*$"/>
<column name="description"
value="Regex allows specific and described ids only or '*' instead for having wildcards."/>
</insert>
<insert tableName="bdmsl_configuration">
<column name="property"
value="subdomain.validation.smpLogicalAddressProtocolRestriction.acc.edelivery.tech.local"
type="LONGTEXT"/>
<column name="value" value="all"/>
<column name="description"
value="Protocol that MUST be used for LogicalAddress when registering new SMP, 'all' means both protocols are accepted possible values: [ http, https, all]."/>
</insert>
<insert tableName="bdmsl_configuration">
<column name="property"
value="dnsClient.recordTypes.acc.edelivery.tech.local"/>
<column name="value" value="all"/>
<column name="description"
value="Type of DNS Record when registering/updating participant, 'all' means that both DNS record types are accepted as possible values: [cname, naptr, all]."/>
</insert>
</changeSet>
</databaseChangeLog>
yȥNv@ j<,)V
\ No newline at end of file
File deleted
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion no;
//========================================================================
// JRC: allow-transfer defines a match list e.g. IP address(es) that are
// allowed to transfer (copy) the zone information from the server (master
// or slave for the zone).
//========================================================================
allow-transfer { none; };
dnssec-enable false;
dnssec-validation false;
/* Path to ISC DLV key
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";*/
};
logging {
channel log_default {
file "/var/named/data/log/named.log" versions 3 size 10m;
print-category yes;
print-severity yes;
print-time yes;
};
channel log_queries {
file "/var/named/data/log/named_queries.log" versions 3 size 20m;
print-category yes;
print-severity yes;
print-time yes;
};
category default { log_default; };
category general { log_default; };
category queries { log_queries; };
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named.conf.local";
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "acc.edelivery.tech.local" {
type master;
file "/var/named/zones/db.acc.edelivery.tech.local";
allow-update { 127.0.0.1;172/8; } ;
allow-query { any; };
allow-transfer {127.0.0.1; 172/8;};
};
zone "20.172.in-addr.arpa" {
type master;
notify no;
file "/var/named/zones/db.172.20";
allow-update {127.0.0.1;172/8; } ;
allow-query { any; };
allow-transfer {127.0.0.1;172/8; };
};
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.acc.edelivery.tech.local. root.acc.edelivery.tech.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
0.1 IN PTR ns.acc.edelivery.tech.local.
; also list other computers
0.101 IN PTR test.acc.edelivery.tech.local.
$ORIGIN .
$TTL 604800 ; 1 week
acc.edelivery.tech.local IN SOA ns.acc.edelivery.tech.local. root.acc.edelivery.tech.local. (
1 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
604800 ; minimum (1 week)
)
NS ns.acc.edelivery.tech.local.
$ORIGIN acc.edelivery.tech.local.
$TTL 60 ; 1 minute
ns A 172.20.0.1
test A 172.20.0.101
#!/bin/bash
set -e
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
export JAVA_HOME=`type -p javac|xargs readlink -f|xargs dirname|xargs dirname`
BIND_DATA_DIR=${DATA_DIR}/bind
MYSQL_DATA_DIR=${DATA_DIR}/mysql
TOMCAT_DIR=${DATA_DIR}/tomcat
if [ ! -d ${DATA_DIR} ]; then
mkdir -p ${DATA_DIR}
fi
if [ ! -d ${BIND_DATA_DIR}/etc ]; then
mkdir -p ${BIND_DATA_DIR}/etc
fi
if [ ! -d ${BIND_DATA_DIR}/var ]; then
mkdir -p ${BIND_DATA_DIR}/var
fi
init_bind() {
# move configuration if it does not exist
if [ ! -d ${BIND_DATA_DIR}/etc/named ]; then
mv /etc/named.conf.local ${BIND_DATA_DIR}/etc/named.conf.local
mv /etc/named.conf ${BIND_DATA_DIR}/etc/named.conf
fi
rm -rf /etc/named.conf.local
rm -rf /etc/named.conf
ln -sf ${BIND_DATA_DIR}/etc/named.conf.local /etc/named.conf.local
ln -sf ${BIND_DATA_DIR}/etc/named.conf /etc/named.conf
# move data dir if it does not exist
if [ ! -d ${BIND_DATA_DIR}/var/named ]; then
mv /var/named ${BIND_DATA_DIR}/var/named
fi
rm -rf /var/named
ln -sf ${BIND_DATA_DIR}/var/named /var/named
chmod -R 0775 ${BIND_DATA_DIR}
chown -R named:named ${BIND_DATA_DIR}
}
init_mysql() {
if [ ! -d ${MYSQL_DATA_DIR} ]; then
mv /var/lib/mysql ${MYSQL_DATA_DIR}
fi
rm -rf /var/lib/mysql
ln -sf ${MYSQL_DATA_DIR} /var/lib/mysql
chmod -R 0775 ${MYSQL_DATA_DIR}
usermod -d ${MYSQL_DATA_DIR} mysql
# Start the MySQL daemon in the background.
mysqld --user=mysql &
# wait until db is up.
until mysqladmin ping >/dev/null 2>&1; do
echo -n "."; sleep 0.2
done
echo "SET ROOT PASSWORD"
# set root password
mysql -h localhost -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '$MYSQL_ROOT_PASSWORD';"
#mysqladmin -u root password $MYSQL_ROOT_PASSWORD
#--------------------------------------------------
# INIT SML
#--------------------------------------------------
# check if DB_SML_SCHEMA exists
if [ ! -d ${MYSQL_DATA_DIR}/${DB_SML_SCHEMA} ]; then
# create database
echo "create SML schema"
mysql -h localhost --user=root --password=$MYSQL_ROOT_PASSWORD -e "create schema $DB_SML_SCHEMA;alter database $DB_SML_SCHEMA charset=utf8; create user $DB_SML_USER identified by '$DB_SML_PASSWORD';grant all on $DB_SML_SCHEMA.* to $DB_SML_USER;"
# change db init file
fi
# change db init file alway else at new run (not start container) liquibase will return error
if [ -f ${DATA_DIR}/init/db.init.xml ]; then
mkdir -p $TOMCAT_HOME/webapps/WEB-INF/classes/liquibase/
cp ${DATA_DIR}/init/db.init.xml $TOMCAT_HOME/webapps/WEB-INF/classes/liquibase/db.init-data-inserts.xml
jar -uf $TOMCAT_HOME/webapps/edelivery-sml.war -C $TOMCAT_HOME/webapps/ WEB-INF/classes/liquibase/db.init-data-inserts.xml
rm -rf $TOMCAT_HOME/webapps/WEB-INF
fi
#--------------------------------------------------
# INIT SMP
#--------------------------------------------------
if [ ! -d ${MYSQL_DATA_DIR}/${DB_SMP_SCHEMA} ]; then
# create database
echo "create SMP schema"
mysql -h localhost -u root --password=$MYSQL_ROOT_PASSWORD -e "create schema $DB_SMP_SCHEMA;alter database $DB_SMP_SCHEMA charset=utf8; create user $DB_SMP_USER identified by '$DB_SMP_PASSWORD';grant all on $DB_SMP_SCHEMA.* to $DB_SMP_USER;"
# update domain client cert for default domain - SMP-SML connection. SML does not require authetication but SMP does. At this moment value bdmslClientCertHeader is not important as log it is not null
echo "" >> /opt/smp-$SMP_VERSION/database-scripts/create-Mysql.sql
echo "update smp_domain set bdmslClientCertHeader='sno=123456&subject=CN=SMP_CEF_SUPPORT, OU=B4, O=DIGIT, L=Brussels, ST=BE, C=BE&validfrom=Jun 1 10:00:00 2015 CEST&validto=Jun 1 10:00:00 2035 CEST&issuer=EMAILADDRESS=root@test.be,CN=TEST Root CN, OU=B4,O=DIGIT,L=Brussels,ST=BE,C=BE'" >> /opt/smp-$SMP_VERSION/database-scripts/create-Mysql.sql
mysql -h localhost -u root --password=$MYSQL_ROOT_PASSWORD $DB_SMP_SCHEMA < "/opt/smp-$SMP_VERSION/database-scripts/create-Mysql.sql"
fi
}
init_tomcat() {
echo "[INFO] init tomcat folders: $tfile"
if [ ! -d ${TOMCAT_DIR} ]; then
mkdir -p ${TOMCAT_DIR}
fi
# move tomcat log folder to data folder
if [ ! -d ${TOMCAT_DIR}/logs ]; then
if [ ! -d ${TOMCAT_HOME}/logs ]; then
mkdir -p ${TOMCAT_DIR}/logs
else
mv ${TOMCAT_HOME}/logs ${TOMCAT_DIR}/
rm -rf ${TOMCAT_HOME}/logs
fi
fi
rm -rf ${TOMCAT_HOME}/logs
ln -sf ${TOMCAT_DIR}/logs ${TOMCAT_HOME}/logs
# move domibus conf folder to data folder
if [ ! -d ${TOMCAT_DIR}/conf ]; then
mv ${TOMCAT_HOME}/conf ${TOMCAT_DIR}/
fi
rm -rf ${TOMCAT_HOME}/conf
ln -sf ${TOMCAT_DIR}/conf ${TOMCAT_HOME}/conf
chown -R tomcat:tomcat ${TOMCAT_DIR}
chmod u+x $TOMCAT_HOME/bin/*.sh
# start tomcat
cd ${TOMCAT_HOME}/bin/
su -c ./startup.sh -s /bin/sh tomcat
}
init_bind
init_mysql
init_tomcat
echo "Starting named..."
exec $(which named) -u ${USER_BIND} -g --
......@@ -9,7 +9,7 @@ SMP_SETUP_SHA256=faede91a13ca8e464c8703b3074c7307058633eb5c969dd1a495bf17fdaa02e
MYSQL_DRV_VERSION=5.1.46
MYSQL_DRV_SHA1=9a3e63b387e376364211e96827bc27db8d7a92e9
TOMCAT_MAJOR=8
TOMCAT_VERSION=8.5.31
TOMCAT_VERSION=8.5.73
TOMCAT_SHA512=51d8877782bc975b8c566263df7e55f383e617aa3c81ea2c219fed18e1f5d9e8233a92100de95b9a8df69ce5c0ad89a195d5b7e5647fcf9df26231870073a9cb
SMP_DB_SCHEMA=supportsmp
SMP_DB_USER=smp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment