Changeset 32432 for gs3-extensions/solr/trunk/src
- Timestamp:
- 2018-09-07T19:39:40+12:00 (6 years ago)
- Location:
- gs3-extensions/solr/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/gs3-setup.bat
r31755 r32432 12 12 :: sets the SOLR_PORT and SOLR_HOST to the values of tomcat.port and tomcat.host properties 13 13 14 set SOLR_PORT=8 98315 set SOLR_HOST= localhost14 set SOLR_PORT=8383 15 set SOLR_HOST=127.0.0.1 16 16 17 17 setlocal enabledelayedexpansion 18 18 set FOUNDPROPS= 19 :: The Solr servlet should only be locally accessible, thus restricting the protocol to http as 20 :: https certificates can't be issued for localhost/127.0.0.1 (https://letsencrypt.org/docs/certificates-for-localhost/) 21 :: This means we use the properties localhost.server.http (defaults to 127.0.0.1) and localhost.port.http 22 :: to construct the solr servlet url, rather than properties tomcat.server and tomcat.port.https 19 23 :: Loosely based on 20 24 :: http://stackoverflow.com/questions/7708681/how-to-read-from-a-properties-file-using-batch-script … … 24 28 :: for alternative suggestions useful in other instances 25 29 FOR /F "usebackq tokens=1,2 delims==" %%G IN ("%GSDL3SRCHOME%\build.properties") DO ( 26 if "%%G"==" tomcat.server" set SOLR_HOST=%%H& set FOUNDPROPS=!FOUNDPROPS!found27 if "%%G"==" tomcat.port" set SOLR_PORT=%%H& set FOUNDPROPS=!FOUNDPROPS!found30 if "%%G"=="localhost.server.http" set SOLR_HOST=%%H& set FOUNDPROPS=!FOUNDPROPS!found 31 if "%%G"=="localhost.port.http" set SOLR_PORT=%%H& set FOUNDPROPS=!FOUNDPROPS!found 28 32 :: break out of the loop as soon as both properties are found 29 33 if "!FOUNDPROPS!" == "foundfound" goto foundall -
gs3-extensions/solr/trunk/src/gs3-setup.sh
r31138 r32432 15 15 # The following sets the field separator IFS to the = sign, then reads the file line by 16 16 # line, setting propname and propval (which are fields separated by '=') for each line read 17 SOLR_PORT=8 98318 SOLR_HOST= localhost17 SOLR_PORT=8383 18 SOLR_HOST=127.0.0.1 19 19 file=$GSDL3SRCHOME/build.properties 20 # The Solr servlet should only be locally accessible, thus restricting the protocol to http as 21 # https certificates can't be issued for localhost/127.0.0.1 (https://letsencrypt.org/docs/certificates-for-localhost/) 22 # This means we use the properties localhost.server.http (defaults to 127.0.0.1) and localhost.port.http 23 # to construct the solr servlet url, rather than properties tomcat.server and tomcat.port.https 20 24 while IFS== read propname propval; do 21 if [ "x$propname" = "x tomcat.server" ] ; then25 if [ "x$propname" = "xlocalhost.server.http" ] ; then 22 26 SOLR_HOST=$propval 23 27 fi 24 if [ "x$propname" = "x tomcat.port" ] ; then28 if [ "x$propname" = "xlocalhost.port.http" ] ; then 25 29 SOLR_PORT=$propval 26 30 fi
Note:
See TracChangeset
for help on using the changeset viewer.