Skip to content

Commit

Permalink
fix jbdcconfig and jdbcstore (#622)
Browse files Browse the repository at this point in the history
* fix jbdcconfig and jdbcstore

* fix config
  • Loading branch information
NyakudyaA authored Feb 13, 2024
1 parent ba563af commit 80c78bf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build_data/jdbcconfig/jdbcconfig.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Mon Feb 05 14:49:17 GMT 2024
initdb=true
pool.timeBetweenEvictionRunsMillis=-1L
import=false
import=true
pool.poolPreparedStatements=true
pool.testWhileIdle=false
pool.validationQuery=SELECT now()
Expand All @@ -13,7 +13,7 @@ password=${POSTGRES_PASS}
jdbcUrl=jdbc:postgresql://${HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?${SSL_PARAMETERS}
driverClassName=org.postgresql.Driver
pool.maxActive=10
initScript=jdbcconfig/scripts/initdb.postgres.sql
initScript=${GEOSERVER_DATA_DIR}/jdbcconfig/scripts/initdb.postgres.sql
debugMode=false
pool.testOnBorrow=true
username=${POSTGRES_USER}
4 changes: 2 additions & 2 deletions build_data/jdbcstore/jdbcstore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ ignoreDirs=${JDBC_IGNORE_PATHS}
enabled=${JDBC_STORE_ENABLED}
pool.maxOpenPreparedStatements=50
password=${POSTGRES_PASS}
jdbcUrl=jdbcUrl=jdbc:postgresql://${HOST}:${POSTGRES_PORT}/${JDBC_STORE_DB}?${SSL_PARAMETERS}
jdbcUrl=jdbc:postgresql://${HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?${SSL_PARAMETERS}
driverClassName=org.postgresql.Driver
pool.maxActive=10
initScript=jdbcstore/scripts/init.postgres.sql
initScript=${GEOSERVER_DATA_DIR}/jdbcstore/scripts/init.postgres.sql
pool.testOnBorrow=true
username=${POSTGRES_USER}
9 changes: 9 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,17 @@ if [[ ${RUN_AS_ROOT} =~ [Ff][Aa][Ll][Ss][Ee] ]];then
chown -R "${USER_NAME}":"${GEO_GROUP_NAME}" "${CLUSTER_CONFIG_DIR}"
fi
chown -R "${USER_NAME}":"${GEO_GROUP_NAME}" "${GEOSERVER_DATA_DIR}"/logging.xml
if [[ -d "${GEOSERVER_DATA_DIR}"/jdbcconfig ]];then
chown -R "${USER_NAME}":"${GEO_GROUP_NAME}" "${GEOSERVER_DATA_DIR}"/jdbcconfig
fi

if [[ -d "${GEOSERVER_DATA_DIR}"/jdbcconfig ]];then
chown -R "${USER_NAME}":"${GEO_GROUP_NAME}" "${GEOSERVER_DATA_DIR}"/jdbcstore
fi
fi



chmod o+rw "${CERT_DIR}";gwc_file_perms ;chmod 400 "${CATALINA_HOME}"/conf/*

if [[ ${SAMPLE_DATA} =~ [Tt][Rr][Uu][Ee] ]]; then
Expand Down
6 changes: 6 additions & 0 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ fi
function setup_jdbc_db_config() {
if [[ ${ext} == 'jdbcconfig-plugin' ]];then
if [[ ${DB_BACKEND} =~ [Pp][Oo][Ss][Tt][Gg][Rr][Ee][Ss] ]]; then
PGPASSWORD="${POSTGRES_PASS}"
export PGPASSWORD
postgres_ready_status "${HOST}" "${POSTGRES_PORT}" "${POSTGRES_USER}" "$POSTGRES_DB"
if [[ -d "${GEOSERVER_DATA_DIR}"/jdbcconfig ]];then
rm -r "${GEOSERVER_DATA_DIR}"/jdbcconfig
else
Expand All @@ -593,6 +596,9 @@ function setup_jdbc_db_config() {

function setup_jdbc_db_store() {
if [[ ${ext} == 'jdbcstore-plugin' ]];then
PGPASSWORD="${POSTGRES_PASS}"
export PGPASSWORD
postgres_ready_status "${HOST}" "${POSTGRES_PORT}" "${POSTGRES_USER}" "$POSTGRES_DB"
if [[ ${DB_BACKEND} =~ [Pp][Oo][Ss][Tt][Gg][Rr][Ee][Ss] ]]; then
if [[ -d "${GEOSERVER_DATA_DIR}"/jdbcstore ]];then
rm -r "${GEOSERVER_DATA_DIR}"/jdbcstore
Expand Down

0 comments on commit 80c78bf

Please sign in to comment.