Commit 3254c490 authored by Vasek Sraier's avatar Vasek Sraier

changed JRE version for compatibility, reconfigured Tomcat, recreated initialization

sql scripts from dumps of real database
parent 7a50ab37
......@@ -41,6 +41,9 @@ processResources << {
if (project.hasProperty('RMBT_DB_PASSWORD')) {
contextXmlContent = contextXmlContent.replaceAll(/DB_PASSWORD/, RMBT_DB_PASSWORD)
}
if (project.hasProperty('RMBT_DB_HOST')) {
contextXmlContent = contextXmlContent.replaceAll(/localhost/, RMBT_DB_HOST)
}
generatedContextXmlFile.write(contextXmlContent, 'UTF-8')
String revisionProperties = "git.describe=" + getVersionNameFromGit() + "\n"
......
......@@ -51,6 +51,9 @@ processResources << {
if (project.hasProperty('RMBT_DB_PASSWORD')) {
contextXmlContent = contextXmlContent.replaceAll(/DB_PASSWORD/, RMBT_DB_PASSWORD)
}
if (project.hasProperty('RMBT_DB_HOST')) {
contextXmlContent = contextXmlContent.replaceAll(/localhost/, RMBT_DB_HOST)
}
generatedContextXmlFile.write(contextXmlContent, 'UTF-8')
String revisionProperties = "git.describe=" + getVersionNameFromGit() + "\n"
......
......@@ -198,7 +198,7 @@ var RMBTWebsocketTestConfig = (function () {
this.product = "Chrome";
this.client = "RMBTws";
this.timezone = 'Europe/Vienna'; // TODO:
this.controlServerURL = "https://netmetr-new.labs.nic.cz/RMBTControlServer";
this.controlServerURL = "https://localhost:8080/RMBTControlServer";
this.controlServerRegistrationResource = "/testRequest";
this.controlServerResultResource = "/result";
this.controlServerDataCollectorResource = "/requestDataCollector";
......
#!/bin/bash
cd $(git rev-parse --show-toplevel)
# environment definition
......@@ -9,12 +10,14 @@ source docker/.env
build() {
cd $1
shift
set -x
gradle clean build $@
set +x
cd ..
}
build RMBTControlServer -PRMBT_SECRET_KEY="$RMBT_SECRET_KEY" -PRMBT_DB_USERNAME="$RMBT_DB_USER" -PRMBT_DB_PASSWORD="$RBMT_DB_PASSWORD" -PRMBT_DB_HOST="$RMBT_DB_HOST"
build RMBTStatisticServer
build RMBTMapServer
build RMBTControlServer -PRMBT_SECRET_KEY="$RMBT_SECRET_KEY" -PRMBT_DB_USERNAME="$RMBT_DB_USER" -PRMBT_DB_PASSWORD="$RMBT_DB_PASSWORD" -PRMBT_DB_HOST="$RMBT_DB_HOST"
build RMBTStatisticServer -PRMBT_DB_USERNAME="$RMBT_DB_USER" -PRMBT_DB_PASSWORD="$RMBT_DB_PASSWORD" -PRMBT_DB_HOST="$RMBT_DB_HOST"
build RMBTMapServer -PRMBT_DB_USERNAME="$RMBT_DB_USER" -PRMBT_DB_PASSWORD="$RMBT_DB_PASSWORD" -PRMBT_DB_HOST="$RMBT_DB_HOST"
build RMBTQoSServer
......
FROM tomcat:8.0
FROM tomcat:8-jre8
ARG TOMCAT_USER
ARG TOMCAT_PASSWORD
......@@ -7,10 +7,12 @@ ARG TOMCAT_PASSWORD
RUN ln -s /dev/stdout /usr/local/tomcat/logs/catalina.out
RUN ln -s /dev/stdout /usr/local/tomcat/logs/catalina.err
COPY docker/control/tomcat-users.xml /etc/tomcat8/tomcat-users.xml
RUN sed -i 's/%%USER%%/'$TOMCAT_USER'/g; s/%%PASSWORD%%/'$TOMCAT_PASSWORD'/g' /etc/tomcat8/tomcat-users.xml
# Reconfigure Tomcat to allow access to the manager app
COPY docker/control/tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml
RUN sed -i 's/%%USER%%/'$TOMCAT_USER'/g; s/%%PASSWORD%%/'$TOMCAT_PASSWORD'/g' /usr/local/tomcat/conf/tomcat-users.xml
COPY docker/control/manager-context.xml /usr/local/tomcat/webapps/manager/META-INF/context.xml
# Install web apps
RUN rm -r /usr/local/tomcat/webapps/ROOT /usr/local/tomcat/webapps/docs /usr/local/tomcat/webapps/examples
COPY RMBTStatisticServer/build/libs/RMBTStatisticServer.war /usr/local/tomcat/webapps/
COPY RMBTMapServer/build/libs/RMBTMapServer.war /usr/local/tomcat/webapps/
......
<?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.
-->
<Context antiResourceLocking="false" privileged="true" >
<!--
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
-->
<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>
\ No newline at end of file
......@@ -40,6 +40,9 @@
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
<user username="%%USER%%" password="%%PASSWORD%%" roles="manager-gui,manager-script" />
-->
<role rolename="manager-gui" />
<role rolename="manager-script" />
<role rolename="admin-gui" />
<user username="%%USER%%" password="%%PASSWORD%%" roles="manager-gui,manager-script,admin-gui" />
</tomcat-users>
......@@ -5,16 +5,16 @@ RUN apt-get update && apt-get install -y pgxnclient make gcc postgresql-server-d
#RUN apt-get install -y --no-install-recommends postgresql-9.5-postgis-2.5
RUN mv /docker-entrypoint-initdb.d/postgis.sh /docker-entrypoint-initdb.d/00_postgis.sh
#ADD docker/postgres/init_roles.sh /docker-entrypoint-initdb.d/05_init_roles.sh
ADD docker/postgres/init_roles.sh /docker-entrypoint-initdb.d/05_init_roles.sh
ADD docker/postgres/init_tables.sh /docker-entrypoint-initdb.d/06_init_tables.sh
RUN mkdir /init_sql
ADD docker/postgres/rmbt.sql /init_sql/10_rmbt.sql
ADD docker/postgres/rmbt_schema.sql /init_sql/10_rmbt.sql
ADD docker/postgres/rmbt_init.sql /init_sql/11_rmbt_init.sql
RUN sed -i 's/<TEST_SERVER_URL>/'"$TEST_SERVER_URL"'/g' /init_sql/11_rmbt_init.sql
ADD RMBTControlServer/qos_texts-en.sql /init_sql/12_qos_texts-en.sql
ADD RMBTControlServer/qos_texts-cs.sql /init_sql/13_qos_texts-cs.sql
ADD RMBTControlServer/qos_tests.sql /init_sql/14_qos_tests.sql
ADD docker/postgres/qos_tests.sql /init_sql/14_qos_tests.sql
ADD RMBTControlServer/rmbt_settings.sql /init_sql/15_rmbt_settings.sql
......@@ -2,7 +2,22 @@
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER rmbt;
CREATE DATABASE rmbt;
GRANT ALL PRIVILEGES ON DATABASE rmbt TO rmbt;
EOSQL
\ No newline at end of file
-- CREATE USER rmbt;
-- CREATE DATABASE rmbt;
-- GRANT ALL PRIVILEGES ON DATABASE rmbt TO rmbt;
CREATE ROLE rmbt_group_read_only WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE rmbt_web_admin WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE ROLE rmbt_group_control WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
GRANT rmbt_group_read_only TO rmbt_group_control;
CREATE USER qosadmin WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE USER rmbt_control WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
CREATE USER rmbt_read_only WITH LOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
GRANT rmbt_group_read_only TO rmbt_read_only;
GRANT rmbt_web_admin TO qosadmin;
GRANT rmbt_group_control TO rmbt_control;
EOSQL
......@@ -7,7 +7,8 @@ psql_rmbt() {
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB"
}
echo "CREATE EXTENSION hstore;" | psql_rmbt
echo "CREATE EXTENSION IF NOT EXISTS hstore;" | psql_rmbt
echo 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' | psql_rmbt
for f in /init_sql/*; do
echo "Processing file $f"
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment