Skip to content

Commit

Permalink
Merge pull request #2835 from SCADA-LTS/release/2.7.7.1
Browse files Browse the repository at this point in the history
Release/2.7.7.1
  • Loading branch information
Limraj authored Apr 28, 2024
2 parents ed3ced7 + 99638dd commit 4964307
Show file tree
Hide file tree
Showing 214 changed files with 4,675 additions and 1,604 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Compile and Test Scada-LTS application
runs-on: ubuntu-latest
env:
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.53
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.86
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -26,7 +26,7 @@ jobs:
restore-keys: |
${{ runner.os }}-tomcat-
- name: Install Tomcat
run: mkdir -p /home/runner/tomcat; cd /home/runner/tomcat; wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.53/bin/apache-tomcat-9.0.53.tar.gz; tar xvzf apache-tomcat-9.0.53.tar.gz
run: mkdir -p /home/runner/tomcat; cd /home/runner/tomcat; wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.86/bin/apache-tomcat-9.0.86.tar.gz; tar xvzf apache-tomcat-9.0.86.tar.gz
- name: Show Tomcat
run: ls $CATALINA_HOME
- name: Test JUnit Scada Application
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
needs: [compile, buildui]
runs-on: ubuntu-latest
env:
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.53
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.86
steps:
- uses: actions/checkout@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Compile and Test Scada-LTS application
runs-on: ubuntu-latest
env:
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.53
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.86
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -33,7 +33,7 @@ jobs:
restore-keys: |
${{ runner.os }}-tomcat-
- name: Install Tomcat
run: mkdir -p /home/runner/tomcat; cd /home/runner/tomcat; wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.53/bin/apache-tomcat-9.0.53.tar.gz; tar xvzf apache-tomcat-9.0.53.tar.gz
run: mkdir -p /home/runner/tomcat; cd /home/runner/tomcat; wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.86/bin/apache-tomcat-9.0.86.tar.gz; tar xvzf apache-tomcat-9.0.86.tar.gz
- name: Show Tomcat
run: ls $CATALINA_HOME
- name: Test JUnit Scada Application
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
needs: [compile, buildui]
runs-on: ubuntu-latest
env:
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.53
CATALINA_HOME: /home/runner/tomcat/apache-tomcat-9.0.86
steps:
- uses: actions/checkout@v3
with:
Expand Down
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#Create an Scada-LTS.war file and deploy it into Docker Tomcat Image.
FROM tomcat:9.0.53
FROM tomcat:9.0.86-jre11
LABEL maintainer="[email protected]"
COPY WebContent/WEB-INF/lib/mysql-connector-java-5.1.49.jar /usr/local/tomcat/lib/mysql-connector-java-5.1.49.jar
COPY tomcat/lib/mysql-connector-java-5.1.49.jar /usr/local/tomcat/lib/mysql-connector-java-5.1.49.jar
COPY tomcat/lib/activation.jar /usr/local/tomcat/lib/activation.jar
COPY tomcat/lib/jaxb-api-2.4.0-b180830.0359.jar /usr/local/tomcat/lib/jaxb-api-2.4.0-b180830.0359.jar
COPY tomcat/lib/jaxb-core-3.0.2.jar /usr/local/tomcat/lib/jaxb-core-3.0.2.jar
COPY tomcat/lib/jaxb-runtime-2.4.0-b180830.0438.jar /usr/local/tomcat/lib/jaxb-runtime-2.4.0-b180830.0438.jar

COPY build/libs/Scada-LTS.war /usr/local/tomcat/webapps/
RUN cd /usr/local/tomcat/webapps/ && mkdir Scada-LTS && unzip Scada-LTS.war -d Scada-LTS
COPY docker/config/context.xml /usr/local/tomcat/webapps/Scada-LTS/META-INF/context.xml

RUN apt update && apt install wait-for-it && apt clean && rm -rf /var/lib/apt/lists/*
RUN apt update;
RUN apt install -y unzip;
RUN apt install -y wait-for-it;
RUN apt clean;
RUN rm -rf /var/lib/apt/lists/*;
RUN ls -l;
RUN cd /usr/local/tomcat/webapps/ && ls -l && mkdir Scada-LTS && unzip Scada-LTS.war -d Scada-LTS;
COPY docker/config/context.xml /usr/local/tomcat/webapps/Scada-LTS/META-INF/context.xml
108 changes: 88 additions & 20 deletions WebContent/WEB-INF/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,25 +156,6 @@
<constructor-arg ref="highestAlarmLevelDAO"/>
</bean>

<bean id="schedulerFactory" class="org.quartz.impl.StdSchedulerFactory"/>

<bean id="resetHighestAlarmLevelTrigger" class="org.quartz.CronTrigger">
<constructor-arg value="Quartz - trigger-ResetCacheHighestAlarmLevel"/>
<constructor-arg value="DEFAULT"/>
</bean>

<bean id="resetHighestAlarmLevelJob" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-ResetCacheHighestAlarmLevel"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.quartz.ResetCacheHighestAlarmLevel" type="java.lang.Class"/>
</bean>

<bean id="resetHighestAlarmLevelScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="schedulerFactory"/>
<constructor-arg ref="resetHighestAlarmLevelTrigger"/>
<constructor-arg ref="resetHighestAlarmLevelJob"/>
</bean>

<bean id="highestAlarmLevelServiceWithCache" class="org.scada_lts.service.HighestAlarmLevelServiceWithCache">
<constructor-arg ref="highestAlarmLevelCache"/>
<constructor-arg ref="highestAlarmLevelDAO"/>
Expand Down Expand Up @@ -250,6 +231,36 @@

<bean id="loggedUsers" class="org.scada_lts.login.LoggedUsers" />

<!-- Quartz -->

<bean id="schedulerFactory" class="org.quartz.impl.StdSchedulerFactory"/>
<bean id="scheduler" class="org.quartz.Scheduler" factory-method="getScheduler" factory-bean="schedulerFactory"/>

<bean id="scadaScheduler" class="org.scada_lts.quartz.ScadaScheduler" destroy-method="destroy" init-method="init">
<constructor-arg ref="scheduler"/>
</bean>

<!-- Quartz HighestAlarmLevel -->

<bean id="resetHighestAlarmLevelTrigger" class="org.quartz.CronTrigger">
<constructor-arg value="Quartz - trigger-ResetCacheHighestAlarmLevel"/>
<constructor-arg value="DEFAULT"/>
</bean>

<bean id="resetHighestAlarmLevelJob" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-ResetCacheHighestAlarmLevel"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.quartz.ResetCacheHighestAlarmLevel" type="java.lang.Class"/>
</bean>

<bean id="resetHighestAlarmLevelScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="scadaScheduler"/>
<constructor-arg ref="resetHighestAlarmLevelTrigger"/>
<constructor-arg ref="resetHighestAlarmLevelJob"/>
</bean>

<!-- Quartz EverySecond -->

<bean id="everySecondTrigger" class="org.quartz.CronTrigger">
<constructor-arg value="Quartz - trigger-EverySecondTrigger"/>
<constructor-arg value="DEFAULT"/>
Expand All @@ -263,8 +274,65 @@
</bean>

<bean id="everySecondScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="schedulerFactory"/>
<constructor-arg ref="scadaScheduler"/>
<constructor-arg ref="everySecondTrigger"/>
<constructor-arg ref="everySecondJobDetail"/>
</bean>

<!-- Quartz DataSourcePointsCache -->

<bean id="updateDataSourcesPointsTrigger" class="org.quartz.CronTrigger">
<constructor-arg value="Quartz - trigger-DataSourcePointsCache"/>
<constructor-arg value="DEFAULT"/>
</bean>

<bean id="updateDataSourcesPointsJobDetail" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-DataSourcePointsCache"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.cache.UpdateDataSourcesPoints" type="java.lang.Class"/>
</bean>

<bean id="updateDataSourcesPointsScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="scadaScheduler"/>
<constructor-arg ref="updateDataSourcesPointsTrigger"/>
<constructor-arg ref="updateDataSourcesPointsJobDetail"/>
</bean>

<!-- Quartz UpdatePointHierarchyCache -->

<bean id="updatePointHierarchyTrigger" class="org.quartz.CronTrigger">
<constructor-arg value="Quartz - trigger-UpdatePointHierarchyCache"/>
<constructor-arg value="DEFAULT"/>
</bean>

<bean id="updatePointHierarchyJobDetail" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-UpdatePointHierarchyCache"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.quartz.UpdatePointHierarchyCache" type="java.lang.Class"/>
</bean>

<bean id="updatePointHierarchyScheduler" class="org.scada_lts.quartz.CronTriggerScheduler" destroy-method="stop">
<constructor-arg ref="scadaScheduler"/>
<constructor-arg ref="updatePointHierarchyTrigger"/>
<constructor-arg ref="updatePointHierarchyJobDetail"/>
</bean>

<!-- Quartz UpdatePendingEvents -->

<bean id="updatePendingEventsTrigger" class="org.quartz.SimpleTrigger">
<constructor-arg value="Quartz - trigger-UpdatePendingEvents"/>
<constructor-arg value="DEFAULT"/>
</bean>

<bean id="updatePendingEventsJobDetail" class="org.quartz.JobDetail">
<constructor-arg value="Quartz - job-UpdatePendingEvents"/>
<constructor-arg value="DEFAULT"/>
<constructor-arg value="org.scada_lts.quartz.UpdatePointHierarchyCache" type="java.lang.Class"/>
</bean>

<bean id="updatePendingEventsScheduler" class="org.scada_lts.quartz.SimpleTriggerScheduler" destroy-method="stop">
<constructor-arg ref="scadaScheduler"/>
<constructor-arg ref="updatePendingEventsTrigger"/>
<constructor-arg ref="updatePendingEventsJobDetail"/>
</bean>
</beans>
8 changes: 7 additions & 1 deletion WebContent/WEB-INF/jsp/dataSourceEdit/editAmqp.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
dataSourceToSave.protocolVersion=$get("protocolVersion");
dataSourceToSave.brokerMode=$get("brokerMode");
DataSourceEditDwr.saveAmqpDataSource(dataSourceToSave, saveDataSourceCB);
if(isValid(dataSourceToSave.updateAttempts)) {
DataSourceEditDwr.saveAmqpDataSource(dataSourceToSave, saveDataSourceCB);
} else {
let message = createValidationMessage("updateAttempts","<fmt:message key="badIntegerFormat"/>");
showDwrMessages([message]);
stopImageFader("dsSaveImg");
}
}
function editPointCBImpl(locator) {
$set("settable", locator.settable);
Expand Down
14 changes: 10 additions & 4 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editMqtt.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@
dataSourceToSave.cleanSession=$get("cleanSession");
dataSourceToSave.brokerMode=$get("brokerMode");
DataSourceEditDwr.saveMqttDataSource(dataSourceToSave, saveDataSourceCB);
}
if(isValid(dataSourceToSave.updateAttempts)) {
DataSourceEditDwr.saveMqttDataSource(dataSourceToSave, saveDataSourceCB);
} else {
let message = createValidationMessage("updateAttempts","<fmt:message key="badIntegerFormat"/>");
showDwrMessages([message]);
stopImageFader("dsSaveImg");
}
}
function editPointCBImpl(locator) {
$set("settable", locator.settable);
$set("writable", locator.writable);
Expand All @@ -45,7 +51,7 @@
$set("retained", locator.retained);
$set("qos", locator.qos);
$set("clientId", locator.clientId);
}
}
function savePointImpl(locator) {
delete locator.relinquishable;
locator.settable = $get("settable");
Expand All @@ -59,7 +65,7 @@
DataSourceEditDwr.saveMqttPointLocator(
currentPoint.id, $get("xid"), $get("name"), locator, savePointCB);
}
}
</script>


Expand Down
38 changes: 32 additions & 6 deletions WebContent/WEB-INF/jsp/dataSourceEdit/editSql.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
dwr.util.removeAllRows("sqlTestResults");
DataSourceEditDwr.sqlTestStatement($get("driverClassname"), $get("connectionUrl"), $get("username"),
$get("password"), $get("selectStatement"), $get("rowBasedQuery"), $get("jndiResource"),
$get("jndiResourceName"), sqlTestCB);
$get("jndiResourceName"), $get("statementLimit"), sqlTestCB);
}
function sqlTestCB() {
Expand Down Expand Up @@ -85,10 +85,27 @@
}
function saveDataSourceImpl() {
DataSourceEditDwr.saveSqlDataSource($get("dataSourceName"), $get("dataSourceXid"), $get("updatePeriods"),
$get("updatePeriodType"), $get("driverClassname"), $get("connectionUrl"), $get("username"),
$get("password"), $get("selectStatement"), $get("rowBasedQuery"), $get("jndiResource"),
$get("jndiResourceName"), saveDataSourceCB);
let statementLimit = $get("statementLimit");
let selectStatement = $get("selectStatement");
let selectStatementLowerCase = selectStatement.toLowerCase();
let selectWithLimitLowerCaseRegex = new RegExp("${selectWithLimitLowerCaseRegex}");
if(statementLimit == 0 && !selectWithLimitLowerCaseRegex.test(selectStatementLowerCase)) {
let result = confirm('<fmt:message key="dsEdit.sql.statementLimit.warning"/>');
if(!result) {
stopImageFader("dsSaveImg");
return;
}
}
if(isValid(statementLimit)) {
DataSourceEditDwr.saveSqlDataSource($get("dataSourceName"), $get("dataSourceXid"), $get("updatePeriods"),
$get("updatePeriodType"), $get("driverClassname"), $get("connectionUrl"), $get("username"),
$get("password"), selectStatement, $get("rowBasedQuery"), $get("jndiResource"),
$get("jndiResourceName"), statementLimit, saveDataSourceCB);
} else {
let message = createValidationMessage("statementLimit","<fmt:message key="badIntegerFormat"/>");
showDwrMessages([message]);
stopImageFader("dsSaveImg");
}
}
function writePointListImpl(points) {
Expand Down Expand Up @@ -148,6 +165,10 @@
show("isNotJndiResource");
}
}
function isValid(value) {
return value == "" || (isInt32(value) && value >= 0);
}
</script>

<c:set var="dsDesc"><fmt:message key="dsEdit.sql.desc"/></c:set>
Expand Down Expand Up @@ -201,9 +222,14 @@
<tr>
<td class="formLabelRequired"><fmt:message key="dsEdit.sql.select"/></td>
<td class="formField">
<textarea id="selectStatement" rows="10" cols="45">${dataSource.selectStatement}</textarea>
<textarea id="selectStatement" rows="10" cols="45"><c:out value="${dataSource.selectStatement}"/></textarea>
</td>
</tr>

<tr>
<td class="formLabelRequired"><fmt:message key="dsEdit.sql.statementLimit"/></td>
<td class="formField"><input id="statementLimit" type="number" value="${dataSource.statementLimit}"/></td>
</tr>

<tr>
<td class="formLabelRequired"><fmt:message key="dsEdit.sql.rowQuery"/></td>
Expand Down
8 changes: 0 additions & 8 deletions WebContent/WEB-INF/jsp/events.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@
}
}
function isValid(value) {
return value == "" || isPositiveInt(value);
}
function isPositiveInt(value) {
return isInt32(value) && value >= 0;
}
function silenceAll() {
MiscDwr.silenceAll(function(result) {
var silenced = result.data.silenced;
Expand Down
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/jsp/systemSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$set("<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_PORT %>"/>", settings.<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_PORT %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_USERNAME %>"/>", settings.<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_USERNAME %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_PASSWORD %>"/>", settings.<c:out value="<%= SystemSettingsDAO.HTTP_CLIENT_PROXY_PASSWORD %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.HTTP_RESPONSE_HEADERS %>"/>", settings.<c:out value="<%= SystemSettingsDAO.HTTP_RESPONSE_HEADERS %>"/>);
$set("<c:out value="<%= SystemSettingsDAO.HTTP_RESPONSE_HEADERS %>"/>", JSON.stringify(settings.<c:out value="<%= SystemSettingsDAO.HTTP_RESPONSE_HEADERS %>"/>, null, 2));
httpUseProxyChange();
$set("<c:out value="<%= SystemSettingsDAO.EVENT_PURGE_PERIOD_TYPE %>"/>", settings.<c:out value="<%= SystemSettingsDAO.EVENT_PURGE_PERIOD_TYPE %>"/>);
Expand Down
Binary file removed WebContent/WEB-INF/lib/log4j-1.2-api-2.15.0.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/log4j-api-2.15.0.jar
Binary file not shown.
Binary file removed WebContent/WEB-INF/lib/log4j-core-2.15.0.jar
Binary file not shown.
Binary file added WebContent/WEB-INF/lib/log4j-web-2.16.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion WebContent/WEB-INF/tags/pointList.tag
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</td>

<td>
<div id="pointDetails" class="borderDiv marB" style="display: none; width: 100%;position: relative;">
<div id="pointDetails" class="borderDiv marB" style="display: none; width: 100%;position: sticky;">
<table width="100%">
<tr>
<td>
Expand Down
24 changes: 24 additions & 0 deletions WebContent/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@
<param-name>com.serotonin.web.taglib.ListSortTag.downImage.altKey</param-name>
<param-value>pagination.descending</param-value>
</context-param>

<!-- Log4j2 -->
<context-param>
<param-name>isLog4jAutoInitializationDisabled</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
</listener>
<filter>
<filter-name>log4jServletFilter</filter-name>
<filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>log4jServletFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
<dispatcher>ASYNC</dispatcher>
</filter-mapping>
<!-- END Log4j2 -->

<!-- secure javamelody -->
<login-config>
<auth-method>DIGEST</auth-method>
Expand Down
Loading

0 comments on commit 4964307

Please sign in to comment.