Skip to content

Commit

Permalink
fix #488 (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
NyakudyaA authored Feb 19, 2023
1 parent 34128c6 commit 7869201
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build_data/context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
/>
<!--<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"/>
<!--<Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>-->
</Context>
18 changes: 14 additions & 4 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,14 @@ if [[ ${POSTGRES_JNDI} =~ [Tt][Rr][Uu][Ee] ]];then
if [ "$POSTGRES_JAR_COUNT" != 0 ]; then
rm "${CATALINA_HOME}"/webapps/geoserver/WEB-INF/lib/postgresql-*
fi
cp "${CATALINA_HOME}"/postgres_config/postgresql-* "${CATALINA_HOME}"/lib/ &&
envsubst < /build_data/context.xml > "${CATALINA_HOME}"/conf/context.xml
cp "${CATALINA_HOME}"/postgres_config/postgresql-* "${CATALINA_HOME}"/lib/
if [[ -f ${EXTRA_CONFIG_DIR}/context.xml ]]; then
envsubst < "${EXTRA_CONFIG_DIR}"/context.xml > "${CATALINA_HOME}"/conf/context.xml
else
# default values
envsubst < /build_data/context.xml > "${CATALINA_HOME}"/conf/context.xml
fi

else
cp "${CATALINA_HOME}"/postgres_config/postgresql-* "${CATALINA_HOME}"/webapps/geoserver/WEB-INF/lib/
fi
Expand All @@ -216,8 +222,12 @@ if [[ "${TOMCAT_EXTRAS}" =~ [Tt][Rr][Uu][Ee] ]]; then
cp -r /tmp/tomcat_apps/webapps.dist/* "${CATALINA_HOME}"/webapps/ &&
rm -r /tmp/tomcat_apps
if [[ ${POSTGRES_JNDI} =~ [Ff][Aa][Ll][Ss][Ee] ]]; then
cp /build_data/context.xml "${CATALINA_HOME}"/webapps/manager/META-INF/
sed -i -e '19,36d' "${CATALINA_HOME}"/webapps/manager/META-INF/context.xml
if [[ -f ${EXTRA_CONFIG_DIR}/context.xml ]]; then
envsubst < ${EXTRA_CONFIG_DIR}/context.xml > "${CATALINA_HOME}"/webapps/manager/META-INF/context.xml
else
cp /build_data/context.xml "${CATALINA_HOME}"/webapps/manager/META-INF/
sed -i -e '19,36d' "${CATALINA_HOME}"/webapps/manager/META-INF/context.xml
fi
fi
if [[ -z ${TOMCAT_PASSWORD} ]]; then
generate_random_string 18
Expand Down

0 comments on commit 7869201

Please sign in to comment.