Skip to content

Commit ca95f64

Browse files
author
Vladimir Kotal
committed
no need to patch web.xml anymore with web app config address
1 parent d0718a4 commit ca95f64

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

OpenGrok

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Supported Environment Variables for configuring the default setup:
131131
- OPENGROK_SCAN_REPOS Disable Scan for repositories (*)
132132
- OPENGROK_SCAN_DEPTH How deep should scanning for repos go
133133
(by default 3 directories from SRC_ROOT)
134-
- OPENGROK_WEBAPP_CFGADDR Web app address to send configuration to
134+
- OPENGROK_WEBAPP_CFGADDR Web application URI to send configuration to
135135
(use "none" to avoid sending it to web app)
136136
- OPENGROK_WEBAPP_CONTEXT Context URL of the OpenGrok webapp
137137
(by default /source).
@@ -368,7 +368,6 @@ DefaultInstanceConfiguration()
368368
#SKIN='--style default'
369369

370370
# OPTIONAL: Configuration Address (host:port)
371-
# (conf/web.xml default is localhost:2424)
372371
WEBAPP_CONFIG=""
373372
if [ -n "${OPENGROK_WEBAPP_CFGADDR}" ]; then
374373
WEBAPP_CONFIG_ADDRESS=${OPENGROK_WEBAPP_CFGADDR}
@@ -1012,11 +1011,11 @@ DeployWar()
10121011
FatalError "Web Application Installation FAILED"
10131012
fi
10141013

1015-
# If user does not use default OPENGROK_INSTANCE_BASE or default
1016-
# WEBAPP_CONFIG_ADDRESS, then attempt to extract WEB-INF/web.xml from
1017-
# source.war using jar or zip utility, update the hardcoded values and
1018-
# then update source.war with the new WEB-INF/web.xml
1019-
if [ "${OPENGROK_INSTANCE_BASE}" != '/var/opengrok' ] || [ "${WEBAPP_CONFIG_ADDRESS}" != 'localhost:2424' ]
1014+
# If user does not use default OPENGROK_INSTANCE_BASE then attempt to
1015+
# extract WEB-INF/web.xml from source.war using jar or zip utility, update
1016+
# the hardcoded values and then update source.war with the new
1017+
# WEB-INF/web.xml.
1018+
if [ "${OPENGROK_INSTANCE_BASE}" != '/var/opengrok' ]
10201019
then
10211020
EXTRACT_COMMAND=""
10221021
COMPRESS_COMMAND=""
@@ -1042,14 +1041,6 @@ DeployWar()
10421041
mv "${warTarget}/WEB-INF/web.xml.tmp" \
10431042
"${warTarget}/WEB-INF/web.xml"
10441043
fi
1045-
if [ "${WEBAPP_CONFIG_ADDRESS}" != 'localhost:2424' ]
1046-
then
1047-
sed -e 's/localhost:2424/'"$WEBAPP_CONFIG_ADDRESS"'/g' \
1048-
"${warTarget}/WEB-INF/web.xml" \
1049-
> "${warTarget}/WEB-INF/web.xml.tmp"
1050-
mv "${warTarget}/WEB-INF/web.xml.tmp" \
1051-
"${warTarget}/WEB-INF/web.xml"
1052-
fi
10531044
eval "${COMPRESS_COMMAND} ${warTarget}/${FINAL_WAR_NAME}.war WEB-INF/web.xml"
10541045
rm -rf "${warTarget}/WEB-INF"
10551046
fi

0 commit comments

Comments
 (0)