Skip to content

Commit

Permalink
feat: update oba version to 2.5.12-cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Altonhe committed Jul 16, 2024
1 parent e3d4786 commit 82e8bbb
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 115 deletions.
2 changes: 1 addition & 1 deletion bundler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM tomcat:8.5.98-jdk11-temurin

ARG OBA_VERSION=2.4.18-cs
ARG OBA_VERSION=2.5.12-cs
ENV OBA_VERSION_ENV=$OBA_VERSION

# Start configuring OBA
Expand Down
4 changes: 3 additions & 1 deletion oba/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM tomcat:8.5.98-jdk11-temurin

ENV CATALINA_HOME /usr/local/tomcat
ENV TZ=America/New_York
ARG OBA_VERSION=2.4.18-cs
ARG OBA_VERSION=2.5.12-cs
ENV OBA_VERSION=$OBA_VERSION

ARG GID=1000
Expand Down Expand Up @@ -54,6 +54,8 @@ WORKDIR /oba/tools
RUN wget "https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-transit-data-federation-builder/${OBA_VERSION}/onebusaway-transit-data-federation-builder-${OBA_VERSION}-withAllDependencies.jar"

# Tomcat Configuration
COPY ./config/context.xml $CATALINA_HOME/conf/context.xml

WORKDIR /oba/webapps/onebusaway-transit-data-federation-webapp
RUN cp /oba/libs/onebusaway-transit-data-federation-webapp-${OBA_VERSION}.war .
RUN jar xvf onebusaway-transit-data-federation-webapp-${OBA_VERSION}.war
Expand Down
17 changes: 16 additions & 1 deletion oba/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ -n "$GTFS_URL" ]; then
.
fi

# For users who want to configure the data-sources.xml file themselves
# For users who want to configure the data-sources.xml file and database themselves
if [ -n "$USER_CONFIGURED" ]; then
echo "USER_CONFIGURED is set, you should create your own configuration file, Aborting..."
exit 0
Expand Down Expand Up @@ -152,3 +152,18 @@ else
mv "$TMP_JSON_FILE" "$LOCAL_JSON_FILE"
fi
fi

CONTEXT_XML_FILE="$CATALINA_HOME/conf/context.xml"
# only update the parameters, therefore is impotent
if [ -n "$JDBC_URL" ]; then
echo "JDBC_URL set to $JDBC_URL, setting in context.xml"
xmlstarlet ed -L -u "//Resource[@name='jdbc/appDB']/@url" -v "$JDBC_URL" ${CONTEXT_XML_FILE}
fi
if [ -n "$JDBC_USER" ]; then
echo "JDBC_URL set to $JDBC_USER, setting in context.xml"
xmlstarlet ed -L -u "//Resource[@name='jdbc/appDB']/@username" -v "$JDBC_USER" ${CONTEXT_XML_FILE}
fi
if [ -n "$JDBC_PASSWORD" ]; then
echo "JDBC_URL set to $JDBC_PASSWORD, setting in context.xml"
xmlstarlet ed -L -u "//Resource[@name='jdbc/appDB']/@password" -v "$JDBC_PASSWORD" ${CONTEXT_XML_FILE}
fi
40 changes: 40 additions & 0 deletions oba/config/context.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<Resource name="jdbc/appDB"
auth="Container"
type="javax.sql.DataSource"
maxTotal="100"
maxIdle="30"
maxWaitMillis="10000"
username="${JDBC_USER}"
password="${JDBC_PASSWORD}"
driverClassName="com.mysql.cj.jdbc.Driver"
url="${JDBC_URL}"/>
</Context>
135 changes: 75 additions & 60 deletions oba/config/onebusaway-api-webapp-data-sources.xml
Original file line number Diff line number Diff line change
@@ -1,62 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">

<!-- Specify our transit data source -->
<bean id="transitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
<property name="serviceInterface" value="org.onebusaway.transit_data.services.TransitDataService" />
</bean>

<bean id="apiKeyValidationService" class="org.onebusaway.users.impl.validation.KeyValidationServiceImpl" />

<!-- Database Configuration -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver" />
<property name="url" value="${JDBC_URL}" />
<property name="username" value="${JDBC_USER}" />
<property name="password" value="${JDBC_PASSWORD}" />
</bean>
<!-- Specify our transit data source -->
<bean id="transitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
<property name="serviceInterface" value="org.onebusaway.transit_data.services.TransitDataService" />
</bean>

<bean id="agencyMetadataDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver" />
<property name="url" value="${JDBC_URL}" />
<property name="username" value="${JDBC_USER}" />
<property name="password" value="${JDBC_PASSWORD}" />
</bean>
<bean id="apiKeyValidationService" class="org.onebusaway.users.impl.validation.KeyValidationServiceImpl"/>
<bean class="org.onebusaway.api.services.ApiIntervalFactory" />
<!-- Database Configuration -->
<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<bean id="agencyMetadataDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>
<bean id="agencyMetadataSessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="agencyMetadataDataSource" />
<property name="annotatedClasses">
<list>
<value>org.onebusaway.agency_metadata.model.AgencyMetadata</value>
<value>org.onebusaway.agency_metadata.service.AgencyMetadataDaoImpl</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.connection.pool_size">1</prop>
<!--<prop key="hibernate.current_session_context_class">thread</prop>-->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.jdbc.batch_size">1000</prop>
</props>
</property>
</bean>

<bean id="agencyMetadataSessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="agencyMetadataDataSource" />
<property name="annotatedClasses">
<list>
<value>org.onebusaway.agency_metadata.model.AgencyMetadata</value>
<value>org.onebusaway.agency_metadata.service.AgencyMetadataDaoImpl</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.pool_size">1</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
</props>
</property>
</bean>
<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
<property name="properties">
<props>
<prop key="cacheManager.cacheManagerName">org.onebusaway.api_webapp.cacheManager</prop>
</props>
</property>
</bean>
<bean id="customRouteSort" class="org.onebusaway.transit_data.model.RouteSort">
<constructor-arg name="agencySortConfiguration" >
<map>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="" />
</bean>

<bean id="customRouteSort" class="org.onebusaway.transit_data.model.RouteSort">
<constructor-arg name="agencySortConfiguration" >
<map>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="" />
</bean>

<!-- iOS Client key -->
<!-- iOS Client key -->
<bean class="org.onebusaway.users.impl.CreateApiKeyAction">
<property name="key" value="org.onebusaway.iphone"/>
</bean>
Expand All @@ -70,11 +92,4 @@
<bean id="testAPIKey" class="org.onebusaway.users.impl.CreateApiKeyAction">
</bean>

<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
<property name="properties">
<props>
<prop key="cacheManager.cacheManagerName">org.onebusaway.api_webapp.cacheManager</prop>
</props>
</property>
</bean>
</beans>
97 changes: 60 additions & 37 deletions oba/config/onebusaway-enterprise-acta-webapp-data-sources.xml
Original file line number Diff line number Diff line change
@@ -1,59 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
<!--
Copyright (c) 2011 Metropolitan Transportation Authority
Licensed 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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">


<!-- Transit Data Service -->

<bean id="transitDataService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property
name="serviceUrl"
value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
<property
name="serviceInterface"
value="org.onebusaway.transit_data.services.TransitDataService" />
<property name="serviceUrl" value="http://localhost:8080/onebusaway-transit-data-federation-webapp/remoting/transit-data-service" />
<property name="serviceInterface" value="org.onebusaway.transit_data.services.TransitDataService" />
</bean>

<!-- Google map related beans, automatically generated by the `bootstrap.sh`-->
<bean id="configurationServiceClient" class="org.onebusaway.util.impl.configuration.ConfigurationServiceClientFileImpl">
</bean>
<bean class="org.onebusaway.transit_data_federation.services.WebIntervalFactory" />

<!-- Database Configuration -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver" />
<property name="url" value="${JDBC_URL}" />
<property name="username" value="${JDBC_USER}" />
<property name="password" value="${JDBC_PASSWORD}" />

<bean id="dataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"
value="java:comp/env/jdbc/appDB"/>
<property name="lookupOnStartup"
value="true"/>
<property name="cache"
value="true"/>
<property name="proxyInterface"
value="javax.sql.DataSource"/>
<property name="resourceRef"
value="true" />
</bean>

<alias name="dataSource" alias="mutableDataSource" />

<bean id="serviceAreaServiceImpl" class="org.onebusaway.presentation.impl.ServiceAreaServiceImpl">
<property name="calculateDefaultBoundsFromAgencyCoverage" value="true" />


<!-- Other Stuff: -->
<bean id="serviceAreaServiceImpl" class="org.onebusaway.presentation.impl.ServiceAreaServiceImpl" />
<bean id="externalGeocoderImpl"
class="org.onebusaway.geocoder.enterprise.impl.EnterpriseGoogleGeocoderImpl" depends-on="serviceAreaServiceImpl">
</bean>

<bean class="org.onebusaway.container.spring.PropertyOverrideConfigurer">
<property name="properties">
<props>
<prop key="cacheManager.cacheManagerName">org.onebusaway.nyc_webapp.cacheManager</prop>
<prop key="cacheManager.cacheManagerName">org.onebusaway.onebusaway-enterprise-acta-webapp.cacheManager</prop>
</props>
</property>
</bean>

<!-- Google map related beans, automatically generated by the `bootstrap.sh`-->
<bean id="configurationServiceClient" class="org.onebusaway.util.impl.configuration.ConfigurationServiceClientFileImpl">
</bean>

<bean id="siriCacheService" class="org.onebusaway.presentation.services.cachecontrol.SiriCacheServiceImpl">
<bean id="siriCacheService"
class="org.onebusaway.presentation.services.cachecontrol.SiriCacheServiceImpl">
<property name="disabled" value="true" />
</bean>

<bean id="searchServiceImpl" class="org.onebusaway.presentation.impl.search.SearchServiceImpl" />
<bean id="enterpriseGeocoderImpl" class="org.onebusaway.geocoder.enterprise.impl.EnterpriseGoogleGeocoderImpl" />
</beans>

</beans>
Loading

0 comments on commit 82e8bbb

Please sign in to comment.