Skip to content

Commit

Permalink
Merge pull request #2335 from hongwei1/develop
Browse files Browse the repository at this point in the history
bugfix/separate the web.xml for production and develop mode
  • Loading branch information
simonredfern authored Nov 23, 2023
2 parents 373aabc + fd1ac5b commit 83edd9a
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
echo ResetPasswordUrlEnabled=true >> obp-api/src/main/resources/props/test.default.props
echo consents.allowed=true >> obp-api/src/main/resources/props/test.default.props
MAVEN_OPTS="-Xmx3G -Xss2m" mvn package
MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod
- name: Build the Docker image
run: |
echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io
Expand Down
15 changes: 14 additions & 1 deletion obp-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@
<artifactId>obp-api</artifactId>
<packaging>war</packaging>
<name>Open Bank Project API</name>

<properties>
<webXmlPath>src/main/webapp/WEB-INF/web.xml</webXmlPath>
</properties>
<profiles>
<profile>
<id>prod</id>
<properties>
<webXmlPath>src/main/resources/web.xml</webXmlPath>
</properties>
</profile>
</profiles>
<pluginRepositories>
<pluginRepository>
<id>org.sonatype.oss.groups.public</id>
Expand Down Expand Up @@ -563,6 +573,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webXml>${webXmlPath}</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
42 changes: 42 additions & 0 deletions obp-api/src/main/resources/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"web-app_2_3.dtd">

<web-app>
<filter>
<filter-name>LiftFilter</filter-name>
<display-name>Lift Filter</display-name>
<description>The Filter that intercepts lift calls</description>
<filter-class>net.liftweb.http.LiftFilter</filter-class>
</filter>


<filter-mapping>
<filter-name>LiftFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!--set the status of HttpOnly and Secure cookie flags-->
<session-config>
<cookie-config>
<secure>true</secure>
<http-only>true</http-only>
</cookie-config>
</session-config>


<!-- H2 web console
<servlet>
<servlet-name>H2Console</servlet-name>
<servlet-class>org.h2.server.web.WebServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>H2Console</servlet-name>
<url-pattern>/console/*</url-pattern>
</servlet-mapping>
-->

</web-app>
72 changes: 36 additions & 36 deletions obp-api/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"web-app_2_3.dtd">
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"web-app_2_3.dtd">

<web-app>
<filter>
<filter-name>LiftFilter</filter-name>
<display-name>Lift Filter</display-name>
<description>The Filter that intercepts lift calls</description>
<filter-class>net.liftweb.http.LiftFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>LiftFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!--set the status of HttpOnly and Secure cookie flags-->
<session-config>
<cookie-config>
<secure>true</secure>
<http-only>true</http-only>
</cookie-config>
</session-config>

<!-- H2 web console
<servlet>
<servlet-name>H2Console</servlet-name>
<servlet-class>org.h2.server.web.WebServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>H2Console</servlet-name>
<url-pattern>/console/*</url-pattern>
</servlet-mapping>
-->
<filter>
<filter-name>LiftFilter</filter-name>
<display-name>Lift Filter</display-name>
<description>The Filter that intercepts lift calls</description>
<filter-class>net.liftweb.http.LiftFilter</filter-class>
</filter>


<filter-mapping>
<filter-name>LiftFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!--set the status of HttpOnly and Secure cookie flags-->
<!--<session-config>-->
<!-- <cookie-config>-->
<!-- <secure>true</secure>-->
<!-- <http-only>true</http-only>-->
<!-- </cookie-config>-->
<!--</session-config>-->


<!-- H2 web console
<servlet>
<servlet-name>H2Console</servlet-name>
<servlet-class>org.h2.server.web.WebServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>H2Console</servlet-name>
<url-pattern>/console/*</url-pattern>
</servlet-mapping>
-->

</web-app>

0 comments on commit 83edd9a

Please sign in to comment.